Networking Forums

Networking Forums > Computer Networking > Linux Networking > Problem opening a listening port using netcat ( or other server )

Reply
Thread Tools Display Modes

Problem opening a listening port using netcat ( or other server )

 
 
bradphelan
Guest
Posts: n/a

 
      10-06-2006, 06:51 PM
Hi all,

My original problem was starting up a ruby on rails mongrel server but
I've tracked the problem back to the fact that I can't seem to set up
any process to listen on a port. I have tried netcat -l -p. But first
some details on me.

I have an Ubuntu Dapper laptop running NetworkManager to obtain a
wireless network connection to a WPA enabled router ( Netgear ). I am
perfectly able to make outgoing connections, ie surf the web, ssh to my
remote webserver account. No problems at all. Then I try to set up a
listening port on my local machine using netcat

netcat -l -p 1234

in another terminal I do

netcat 127.0.0.1 1234

and then type in the first terminal but nothing goes through. I have
also tried

netcat beermonster 1234
netcat 192.168.1.5 1234

but also no luck.

then I run netstat -al to find out what is up

tcp 0 0 *:1234 *:*
LISTEN
tcp 0 0 192.168.1.5:51730 72.14.217.99:www
ESTABLISHED
udp 0 0 *:bootpc *:*
raw 0 0 *:icmp *:*

netstat -r gives

Destination Gateway Genmask Flags MSS Window
irtt Iface
192.168.117.0 * 255.255.255.0 U 0 0
0 vmnet8
192.168.245.0 * 255.255.255.0 U 0 0
0 vmnet1
192.168.1.0 * 255.255.255.0 U 0 0
0 eth1
default 192.168.1.1 0.0.0.0 UG 0 0
0 eth1

netstat -i gives
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP
TX-OVR Flg
eth0 1500 0 0 0 0 0 0 0 0
0 BMU
eth1 1500 0 930 1 1 0 602 0 0
0 BMRU
vmnet 1500 0 0 0 0 0 6 0 0
0 BMRU
vmnet 1500 0 0 0 0 0 6 0 0
0 BMRU


Strangley too my machine does not respond to ping either.

ping 127.0.0.1
ping beermonster
ping 192.168.1.5

all do nothing.

It is like I have some magic firewall installed but I have never (
intentionally ) done such a thing. The only thing that I can think of
is that when vmware player installed it monkyed with my network
settings somewhere as it set up it's own virtual devices and thus broke
my machine but I am at a loss. Netcat says there is a port listening
but it doesn't seem to be doing anything?

Any help will be well regarded.

--
Brad Phelan
http://xtargets.com

 
Reply With Quote
 
 
 
 
Stephane CHAZELAS
Guest
Posts: n/a

 
      10-06-2006, 07:06 PM
2006-10-6, 11:51(-07), bradphelan:
[...]
> netcat -l -p 1234
>
> in another terminal I do
>
> netcat 127.0.0.1 1234

[...]
> netstat -i gives
> Kernel Interface table
> Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP
> TX-OVR Flg
> eth0 1500 0 0 0 0 0 0 0 0
> 0 BMU
> eth1 1500 0 930 1 1 0 602 0 0
> 0 BMRU
> vmnet 1500 0 0 0 0 0 6 0 0
> 0 BMRU
> vmnet 1500 0 0 0 0 0 6 0 0
> 0 BMRU

[...]

Your "lo" (loopback) interface doesn't seem to be configured

Try a:

ifup lo

or

ifconfig lo 127.1/8 up


--
Stéphane
 
Reply With Quote
 
bradphelan
Guest
Posts: n/a

 
      10-06-2006, 07:24 PM
Stephane CHAZELAS wrote:

> 2006-10-6, 11:51(-07), bradphelan:
> [...]
> > netcat -l -p 1234
> >
> > in another terminal I do
> >
> > netcat 127.0.0.1 1234

> [...]
> > netstat -i gives
> > Kernel Interface table
> > Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP
> > TX-OVR Flg
> > eth0 1500 0 0 0 0 0 0 0 0
> > 0 BMU
> > eth1 1500 0 930 1 1 0 602 0 0
> > 0 BMRU
> > vmnet 1500 0 0 0 0 0 6 0 0
> > 0 BMRU
> > vmnet 1500 0 0 0 0 0 6 0 0
> > 0 BMRU

> [...]
>
> Your "lo" (loopback) interface doesn't seem to be configured
>
> Try a:
>
> ifup lo
>
> or
>
> ifconfig lo 127.1/8 up
>
>
> --
> Stéphane


Thanks for the tip. I've added in the "lo" device

brad@beermonster:~$ netstat -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP
TX-OVR Flg
eth0 1500 0 0 0 0 0 0 0 0
0 BMU
eth1 1500 0 4331 1 1 0 3213 0 0
0 BMRU
lo 16436 0 0 0 0 0 0 0 0
0 LRU
vmnet 1500 0 0 0 0 0 6 0 0
0 BMRU
vmnet 1500 0 0 0 0 0 6 0 0
0 BMRU

but still netcat refuses to play ?

my /etc/network/interfaces files looks like

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

---

I can't think of any more information.

Brad

 
Reply With Quote
 
bradphelan
Guest
Posts: n/a

 
      10-06-2006, 08:04 PM

Stephane CHAZELAS wrote:

> 2006-10-6, 11:51(-07), bradphelan:
> [...]
> > netcat -l -p 1234
> >
> > in another terminal I do
> >
> > netcat 127.0.0.1 1234

> [...]
> > netstat -i gives
> > Kernel Interface table
> > Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP
> > TX-OVR Flg
> > eth0 1500 0 0 0 0 0 0 0 0
> > 0 BMU
> > eth1 1500 0 930 1 1 0 602 0 0
> > 0 BMRU
> > vmnet 1500 0 0 0 0 0 6 0 0
> > 0 BMRU
> > vmnet 1500 0 0 0 0 0 6 0 0
> > 0 BMRU

> [...]
>
> Your "lo" (loopback) interface doesn't seem to be configured
>
> Try a:
>
> ifup lo
>
> or
>
> ifconfig lo 127.1/8 up
>
>
> --
> Stéphane


You were right. It was the loopback device. Don't know why it didn't
work when I replied last time but I rebooted and it now seems up. The
strange thing is the problem is still there when I first foot the
machine. I have to

sudo ifdown lo
sudo ifup lo

before I can see the lo interface in with netstat -i. Just doing sudo
ifup lo gives me an error saying it is allready configured, probably
badly.

Thanks for the help.

Brad

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Port Not Listening Thomas R Grassi Jr Windows Networking 4 12-13-2008 09:17 AM
Socket connection to port fails despite port open / listening ! Jack Linux Networking 2 12-19-2007 03:46 PM
Two Services Listening on Same Port Buck Turgidson Linux Networking 13 03-06-2005 01:23 PM
1 port, listening and connecting, how to Marcia Hon Linux Networking 1 02-10-2004 08:55 AM
How do you ping a server to find out if it is listening on a specific port Matt Windows Networking 1 12-01-2003 06:02 PM



1 2 3 4 5 6 7 8 9 10 11