Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

'netstat --tcp' is empty list! How to add eth0 tcp listner?

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
gr1zzly



Joined: Mon Apr 09, 2012 1:27 pm
Posts: 11
Location: United Kingdom

PostPosted: Wed Apr 11, 2012 1:52 pm    Post subject: 'netstat --tcp' is empty list! How to add eth0 tcp listner? Reply with quote

Hi, I'm having trouble connecting my PCI NIC card to my (wired) router [Linux Mint 10] -- it's a Realtek based chipset (r8169).

'ifconfig' shows eth0 device up and configured (static IP) -- I have manually set this config in '/etc/network/interfaces'

however the 'route' table was empty until i restarted the networking service, then it lists:

Code:

192.168.0.0    *    255.255.255.0    U  ...  eth0
169.254.0.0    *    255.255.0.0    U  ...  eth0
default    router.local    0.0.0.0    UG  ...  eth0


I have not set-up or defined the 169 address and have no idea where it's coming from!

The 'default' route using '-nn' switch is:

Code:
0.0.0.0    192.168.0.1    0.0.0.0    UG  ...  eth0


-- My router is a netgear DGN1000SP (supplied by virginmedia) --

'lshw -c Network | grep driver' shows driver is 'r8169' and the driver version as '2.3LK-NAPI'

However after I did an 'rmmod r8169' then 'modprobe -i r8169' the driver version has changed to 6.016.00-NAPI

nm-tool show status as connected and the state as unmanaged (I think this is okay as I'm trying to configure eth0 manually because NetworkManager fails to establish a connection!)

As I stated in the subject line, when I do netstat --tcp I just get a blank table!

netstat --tcp --listening shows:

Code:

tcp    0    0    localhost.localdoma:www    *:*    LISTEN
tcp    0    0    localhost.localdoma:ipp    *:*    LISTEN
tcp    0    0    localhost.localdo:mysql    *:*    LISTEN
tcp6    0    0    localhost6.localdom:ipp    *:*    LISTEN


Surely I need something showing on my network card's IP / Port? !!

The light on the router / back of the network card show a connection but no traffic activity.

Can anyone help please? I must have internet access on my linux box or it's just a very heavy open-source door stop!

Sad

Thank in advance!!
Back to top
View user's profile Send private message
Mayhem



Joined: Tue Apr 10, 2012 10:12 pm
Posts: 11

PostPosted: Wed Apr 11, 2012 2:21 pm    Post subject: Reply with quote

Why the static IP ? Did the nic stop working when you changed to static IP, or has it never worked ? Generally I find Ubuntu derivatives to be pretty good at setting up nics out the box, (without static IPs and via network manager) hence the question

As far as I know, netstat --tcp would show any connections to the box via tcp. So I'm guessing you where sitting in front of the box (not SSH'd in etc), hence no connections ?

I think more info is required:
* "ifconfig -a" output
* "route -n" output
* /etc/network/interfaces contents.
Back to top
View user's profile Send private message
gr1zzly



Joined: Mon Apr 09, 2012 1:27 pm
Posts: 11
Location: United Kingdom

PostPosted: Wed Apr 11, 2012 2:59 pm    Post subject: Reply with quote

I want to use the box for web development so it made sense for me to set a static IP in-case I need to use it as a server later on for remote access (as you mentioned).

I switched to the ethernet card after the on-board one blew up -- at least I figure it's dead anyway, see post here for details:
http://www.linuxformat.com/forums/viewtopic.php?t=14723

As I said in my OP ifconfig shows the device is up
lshw and lspci show the device detected and driver loaded.
Everything seems it's as it should be except for the fact that there are no active network services for my NIC's IP, no tcp listeners, so no ports are open or bound to that device??!!


- terminal output:
Code:

~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1f:1f:e9:c9:1b 
          inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21f:1fff:fee9:c91b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:2399141745 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17 Base address:0x2000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:114 errors:0 dropped:0 overruns:0 frame:0
          TX packets:114 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8032 (8.0 KB)  TX bytes:8032 (8.0 KB)

~ $ dmesg | grep r81
[    1.205760] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[    1.205774] r8169 0000:00:0c.0: enabling device (0000 -> 0003)
[    1.205790] r8169 0000:00:0c.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[    1.205821] r8169 0000:00:0c.0: (unregistered net_device): no PCI Express capability
[    2.024017] r8169 0000:00:0c.0: setting latency timer to 64
[    2.024022] r8169 0000:00:0c.0: (unregistered net_device): unknown MAC, using family default
[    2.024485] r8169 0000:00:0c.0: eth0: RTL8169 at 0xf8152000, ff:ff:ff:ff:ff:ff, XID 9cf0f8ff IRQ 17
[   24.392032] r8169 0000:00:0c.0: eth0: link up

~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0



- /etc/networking/interfaces:
Code:

auto lo eth0

iface lo inet loopback

iface eth0 inet static
   address 192.168.0.100
   netmask 255.255.255.0
   broadcast 192.168.0.255 # ( optional )
   newtwork 192.168.0.0 # ! required for linux 2.4.x !
   metric 2
   gateway 192.168.0.1 # ( optional )
#   pointopoint 192.168.0.1
#   media ? # ( value ? )
   hwaddress ether 00:1F:1F:E9:C9:1B
   mtu 1000


I hope this helps!

- thnx
Back to top
View user's profile Send private message
nelz
Moderator


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8000
Location: Warrington, UK

PostPosted: Wed Apr 11, 2012 3:59 pm    Post subject: Reply with quote

Are you sure the new card is eth0? That would have been taken by the onboard NIC and even if it is completely dead and tirned off in the BIOS, udev may be assigning a different name to this NIC because it has a different MAC address. What does ifconfig -a show?
_________________
Unix is user-friendly. It's just very selective about who it's friends are.
Back to top
View user's profile Send private message
wyliecoyoteuk
LXF regular


Joined: Sun Apr 10, 2005 11:41 pm
Posts: 3358
Location: Birmingham, UK

PostPosted: Wed Apr 11, 2012 5:01 pm    Post subject: Reply with quote

169.254.0.0 is an "autoconfig" IP subnet address, self assigned by a NIC when it has no static address and it cannot connect to a DHCP server.
It can also be defined as the default route: the metric of 1000 indicates that it should be used only if the main gateway is non functional.

You also have a MAC address error.

What you may have is an auto-negotiation failure, often caused by non-gigabit compliant cabling or incompatible network devices.
changing the speed to 100 Mbit and then restarting the router may cure it, if it does, your cable may be to blame.

EDIT: maybe the spelling of newtwork doesn't help! Smile
_________________
The sig between the asterisks is so cool that only REALLY COOL people can even see it!

*************** ************
Back to top
View user's profile Send private message
gr1zzly



Joined: Mon Apr 09, 2012 1:27 pm
Posts: 11
Location: United Kingdom

PostPosted: Wed Apr 11, 2012 6:16 pm    Post subject: Reply with quote

@nelz - If you check my dmesg output from before you can see that the device using the r8169 driver (i.e. my RealTek card) is assigned to eth0.

@wyliecoyoteuk - I have tested the cable in another computer so it's definitely not that, however you could be right about the gigabit / 100mbit setup if the auto-negotiate / auto-sense isn't working.

AFAIK the cable is a standard CAT5 shielded twisted pair / cross-over cable. But (also AFAIK) modern routers are happy with both straight patch cables and cross-over cables, they just flip the connections internally so it shouldn't matter which type I've got. (right ?)

Er.. I can re-define the adapter's connection speed with ifconfig right? Or should I do it in the 'interfaces' file?
-- edit: It's okay I've found it -- 'media' attribute in the interfaces file now set to '100baseT'!

Also what's the problem with the MAC address?

The NetworkManager kept trying to set the default address of 'ff:ff:ff:ff:ff:ff' but the sticker on the back of the card says it's MAC address is '00:1F:1F:E9:C9:1B' so that's what I set it as in the config! -- Is this wrong?

Thanks, I really appreciate the help!
Back to top
View user's profile Send private message
nelz
Moderator


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8000
Location: Warrington, UK

PostPosted: Wed Apr 11, 2012 7:50 pm    Post subject: Reply with quote

Cat 5 is rated for 100Mbit. You should be using Cat 5e or Cat 6 for gigabit connections.
_________________
Unix is user-friendly. It's just very selective about who it's friends are.
Back to top
View user's profile Send private message
wyliecoyoteuk
LXF regular


Joined: Sun Apr 10, 2005 11:41 pm
Posts: 3358
Location: Birmingham, UK

PostPosted: Wed Apr 11, 2012 8:22 pm    Post subject: Reply with quote

gr1zzly wrote:


AFAIK the cable is a standard CAT5 shielded twisted pair / cross-over cable. But (also AFAIK) modern routers are happy with both straight patch cables and cross-over cables, they just flip the connections internally so it shouldn't matter which type I've got. (right ?)

Nope.
Many standard 100mbit crossovers only swap the orange and green pairs. Gigabit uses all eight cores, so the blue and brown cores need swapping too. (Also, some MDI 100Mbit NICs only swap four cores, which can cause quite an issue)
http://wlanbook.com/ethernet-crossover-cable-pinout/
Quote:

Er.. I can re-define the adapter's connection speed with ifconfig right? Or should I do it in the 'interfaces' file?
-- edit: It's okay I've found it -- 'media' attribute in the interfaces file now set to '100baseT'!

Also what's the problem with the MAC address?

The dmesg line says:
Code:

[    2.024022] r8169 0000:00:0c.0: (unregistered net_device): unknown MAC, using family default


which is why the following happens:
Quote:

The NetworkManager kept trying to set the default address of 'ff:ff:ff:ff:ff:ff' but the sticker on the back of the card says it's MAC address is '00:1F:1F:E9:C9:1B' so that's what I set it as in the config! -- Is this wrong?

Thanks, I really appreciate the help!


But as I said, the mispelling of newtwork in the interfaces file may be more of a problem!
_________________
The sig between the asterisks is so cool that only REALLY COOL people can even see it!

*************** ************
Back to top
View user's profile Send private message
gr1zzly



Joined: Mon Apr 09, 2012 1:27 pm
Posts: 11
Location: United Kingdom

PostPosted: Wed Apr 11, 2012 8:48 pm    Post subject: Reply with quote

@nelz - Okay thanks, I will check...

also (@wileycoyoteuk) thanks for the detailed cable spec info...

My cable is a Category 5 UTP 4 Pairs 24AWG Patch Cable (I guess I'd remebered it wrong -- though it was a cross-over cable!)

Okay I've corrected my typo in the interfaces file (apologies) however this line was previously commented out as it's only required for an older kernel verison (Linux Mint 10 installs with kernel 2.6.35-22) so I doubt it's the main cause of the problem but at least now it isn't a contributing factor.

FYI: before my problems with this RealTek card I lost my on-board ethernet functionality after having performed an 'update' and an 'upgrade' using 'apt-get' (this is where all my troubles started!!).

So in my '/usr/src/' folder, as well as my 2.6.35-22 headers, I now also have a folder called 'linux-3.2.11' -- is this part of the problem and if so how do I fix it please? ... if not then...

I still have no tcp listeners showing with netsat

How can I set the correct media type for eth0?
(i.e. 100baseT if that's what I should be using?)

Thanks for all your help so far, I'm determined to get this working before the end of today! (or maybe the week)
Back to top
View user's profile Send private message
wyliecoyoteuk
LXF regular


Joined: Sun Apr 10, 2005 11:41 pm
Posts: 3358
Location: Birmingham, UK

PostPosted: Wed Apr 11, 2012 8:54 pm    Post subject: Reply with quote

To be honest, I think that you should start over.
Shut down, remove the PCI card, boot up and have a look at dmesg, to see if there is any trace of the onboard NIC.
If possible, disable it in the BIOS.

Then reinstall your PCI card and see what happens.

Sometimes these cards need firmware updates, which are usually supplied by the driver, and that might be the cause of your original problem, the new driver could not install the new firmware. (although that is usually more common with wifi cards)
_________________
The sig between the asterisks is so cool that only REALLY COOL people can even see it!

*************** ************
Back to top
View user's profile Send private message
dandnsmith
LXF regular


Joined: Fri Apr 15, 2005 11:01 am
Posts: 267
Location: Berks, UK

PostPosted: Thu Apr 12, 2012 9:13 am    Post subject: Reply with quote

I have one PC for which the onboard ethernet port went U/S, so I installed a PCI card with a Realtek chip.
When the dust died down I found that
a) the original port was still being registered, but wouldn't (still) take traffic and couldn't be disabled at the BIOS level
b) when I achieved a working configuration, the new port was listed as eth0 by the Ubuntu/Mint
c) I had problems with the connection just going to sleep and being almost impossible to wake up to use (but it seemed to work under WinXP).

After a bit of research, I found that I was using the r8169 driver, but that chipset had given trouble and using the r8168 driver instead cleared everything up. This isn't the only hardware for which I had this problem and solution.
_________________
Derek
Back to top
View user's profile Send private message
gr1zzly



Joined: Mon Apr 09, 2012 1:27 pm
Posts: 11
Location: United Kingdom

PostPosted: Thu Apr 12, 2012 3:07 pm    Post subject: Reply with quote

Thanks all, I'm really busy so I'll give those suggestions a try when I can and post back here in a few days with a progress update.

Kind regards,

Very Happy
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast