LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bringing up interface eth0 determining IP information fails (https://www.linuxquestions.org/questions/linux-newbie-8/bringing-up-interface-eth0-determining-ip-information-fails-838561/)

chickonlinux 10-16-2010 08:07 PM

Bringing up interface eth0 determining IP information fails
 
CentOS 4.7 a minimal installation with no GUI

Ethernet Controller RTL-8029

Running /sbin/lspci shows the Ethernet card....

ifcfg-eth0 shows BOOTPROTO=dhcp

NIC is connected to a LINKSYS WRT54G running DHCP. There are plenty of available IP assignments. All other PC that I have connected to the LINKSYS work fine. The CAT 5 cable is fine.

Why is this NIC not taking a DHCP assignment ?

johnshen64 10-16-2010 08:22 PM

what is the output of the following?

dhclient eth0

and then

ifconfig eth0

chickonlinux 10-16-2010 08:41 PM

DHCPDISCOVER on NUMEROUS ports, then No DHCPOFFERS received. Np working leases in persistent database - sleeping

ifconfig eth0 shows the interface but no inet IP assignment. Also to note is 113 dropped RX packets and 8 errors on TX packets

Quote:

Originally Posted by johnshen64 (Post 4129942)
what is the output of the following?

dhclient eth0

and then

ifconfig eth0


paulsm4 10-16-2010 09:13 PM

Hi -

From the sounds of it, it *should* work. A couple of observations/suggestions:

1. It sounds like you're knowledgeable, and that you're doing everything right.

2. You imply you've got an Ethernet adapter (not wifi), and you're plugging it directly into your WRT54G router.

Q: is this correct?

3. If so, please double-check your /sbin/ifconfig output, and DISABLE all interfaces besides your eth0. Don't mess with multiple interfaces until we get *one* interface working.

4. The problem clearly appears to be DHCP.

Q: Have you considered simply assigning a static address (if only for debugging purposes)?

chickonlinux 10-16-2010 09:26 PM

I have quite a few years of technical experience so Im not exactly a newbie ;-)

Yes, I have a Ethernet card with a CAT 5 cable connected to the router.

eth0 is the only interface at this point aside from local loopback.

Static assignment ? I still want to understand why assignment is not happening dynamically. If need be, we can go that route.

Quote:

Originally Posted by paulsm4 (Post 4129978)
Hi -

From the sounds of it, it *should* work. A couple of observations/suggestions:

1. It sounds like you're knowledgeable, and that you're doing everything right.

2. You imply you've got an Ethernet adapter (not wifi), and you're plugging it directly into your WRT54G router.

Q: is this correct?

3. If so, please double-check your /sbin/ifconfig output, and DISABLE all interfaces besides your eth0. Don't mess with multiple interfaces until we get *one* interface working.

4. The problem clearly appears to be DHCP.

Q: Have you considered simply assigning a static address (if only for debugging purposes)?


paulsm4 10-17-2010 01:53 AM

Well, you can always try a network trace to see who's dropping the ball. You can use tcpdump (cmd-line) on Centos, or Wireshark on any of the other PCs on your LAN.

There might be some kind of conflict between Netmanager and your low-level configuration files (such as /etc/sysconfig/network-scripts/ifcfg-eth0, which I believe you cited in your original post). Who knows - Centos might also have some firewall setting that's blocking DHCP. But I think I'm stretching...

If it's no hassle, try seeing if a static address works.

And if so, double-check the settings in your /etc/sysconfig/network-scripts and/or go back to DHCP and try taking a network trace.

Good luck - and please post back what you find!

PS:
1. FIREWALL EXAMPLE:
Code:

iptables -I INPUT -i eth0 -p udp --sport 67:68 --dport -j ACCEPT
  <= Insure DHCP isn't getting blocked

2. NETCONF EXAMPLE:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
Code:

# Example static: DON'T do this!
# DEVICE=eth0
# BOOTPROTO=static
# HWADDR=00:19:D1:2A:BA:A8
# IPADDR=10.10.29.66
# NETMASK=255.255.255.192
# ONBOOT=yes

# Example DHCP: DON'T specify IP or subnet mask...
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:19:D1:2A:BA:A8
ONBOOT=yes


paulsm4 10-18-2010 05:33 PM

Hi, Stephanie -

Q: Did you get it working?

Q: If so, what was the problem?
If not, perhaps maybe I could install CentOS 4.7 on a VM and try reproducing it? (I'm currently running CentOS 5.5 on a VPS, but that's not really applicable to your scenario).

Please let us know!

TIA .. PSM

michaelk 10-18-2010 06:03 PM

The card may nor may not be configured for auto negotiation. Does mii-tool or ethtool recognize the adapter? If so how is it configured?

chickonlinux 10-19-2010 05:45 AM

Nope, I upgraded to CentOS 4.8 because my application allowed that. I acutally ordered a new ethernet card that is stated to be compatible with Linux. My current card uses a RTL8029 chipset which is a commonly used chipset though.

Quote:

Originally Posted by paulsm4 (Post 4131816)
Hi, Stephanie -

Q: Did you get it working?

Q: If so, what was the problem?
If not, perhaps maybe I could install CentOS 4.7 on a VM and try reproducing it? (I'm currently running CentOS 5.5 on a VPS, but that's not really applicable to your scenario).

Please let us know!

TIA .. PSM


chickonlinux 10-19-2010 05:46 AM

The adapter appears to be recognized as one can configure it manually. Tell me more about these tools! I am new to these

Quote:

Originally Posted by michaelk (Post 4131837)
The card may nor may not be configured for auto negotiation. Does mii-tool or ethtool recognize the adapter? If so how is it configured?


paulsm4 10-19-2010 10:04 AM

OK, then please cut/paste the exact output of the following:

1. ifconfig eth0
Code:

  /sbin/ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:76:E2:71:C5
          inet addr:192.168.1.xxx  Bcast:192.168.1.xxx  Mask:255.255.255.0
          inet6 addr: fe80::xxx:76ff:fee2:71c5/64 Scope:Link
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:593541 errors:0 dropped:0 overruns:0 frame:0
          TX packets:386699 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:88323609 (84.2 Mb)  TX bytes:487001350 (464.4 Mb)
          Interrupt:10 Base address:0xcf00

2. dhclient eth0
Code:

/sbin/dhclient eth0
Internet Systems Consortium DHCP Client V3.0.5-RedHat
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

/sbin/dhclient-script: configuration for eth0 not found. Continuing with defaults.
/etc/sysconfig/network-scripts/network-functions: line 78: eth0: No such file or directory
SIOCSIFADDR: No such device
eth0: unknown interface: No such device
eth0: unknown interface: No such device
Failed to get interface index: No such device

3. ethtool eth0 ("ethtool" is generally preferred over "mii-tool"):
Code:

/usr/sbin/ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: yes

4. less /var/log/messages
<= Cut/paste any messages related to the failed DHCP request(s)

... and, most importantly ...

5. dhcpcd -r
Code:

/sbin/dhcpcd -r
****  /sbin/dhcpcd: already running
****  /sbin/dhcpcd: if not then delete /var/run//dhcpcd-eth0.pid file


chickonlinux 10-19-2010 08:39 PM

Getting information off the machine onto this machine is a bit of an issue.

I can summarize the results this way:


ifconfig eth0: shows no assigned inet addr, states UP BROADCAST RUNNING MULTICAST, 18 RX packet errors & 7 TX packet errors

dhclient eth0: shows several DHCPDISCOVER attempt messages and finally NO DHCP OFFERS received

ethtool eth0: showed results similar to your "code" results. Actually, the RTL8029 NIC showed "NO DATA AVAILABLE" after running ethtool. My new DLINK NIC showed a whole table of results.

less /var/log/messages: showed ifup failed. Bringing up interfae eth0 failed. Saw a number of NETDEV WATCHDOG eth0 transmit timed out messages

dhcpcd does not exist in sbin...this is the client daemon ? If I type dhclient again it tells me its already running.


Quote:

Originally Posted by paulsm4 (Post 4132553)
OK, then please cut/paste the exact output of the following:

1. ifconfig eth0
Code:

  /sbin/ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:76:E2:71:C5
          inet addr:192.168.1.xxx  Bcast:192.168.1.xxx  Mask:255.255.255.0
          inet6 addr: fe80::xxx:76ff:fee2:71c5/64 Scope:Link
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:593541 errors:0 dropped:0 overruns:0 frame:0
          TX packets:386699 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:88323609 (84.2 Mb)  TX bytes:487001350 (464.4 Mb)
          Interrupt:10 Base address:0xcf00

2. dhclient eth0
Code:

/sbin/dhclient eth0
Internet Systems Consortium DHCP Client V3.0.5-RedHat
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

/sbin/dhclient-script: configuration for eth0 not found. Continuing with defaults.
/etc/sysconfig/network-scripts/network-functions: line 78: eth0: No such file or directory
SIOCSIFADDR: No such device
eth0: unknown interface: No such device
eth0: unknown interface: No such device
Failed to get interface index: No such device

3. ethtool eth0 ("ethtool" is generally preferred over "mii-tool"):
Code:

/usr/sbin/ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: yes

4. less /var/log/messages
<= Cut/paste any messages related to the failed DHCP request(s)

... and, most importantly ...

5. dhcpcd -r
Code:

/sbin/dhcpcd -r
****  /sbin/dhcpcd: already running
****  /sbin/dhcpcd: if not then delete /var/run//dhcpcd-eth0.pid file



paulsm4 10-19-2010 11:50 PM

Sorry :-(

You're *so* doing all the right things - it's frustrating that it hasn't paid off yet.

If at all possible, please try a static IP. If only for debugging purposes.

IMHO...

PS:
Some "grasping at straws" suggestions:

1. Disable your Linux firewall, e.g.
service iptables stop

2. Disable selinux (frankly, if you're at Centos 4.x, I doubt you even *have* selinux):
setenforce 0

3. You could do worse than run a tcpdump trace on Centos, and/or a Wireshark trace anywhere else

chickonlinux 10-20-2010 08:39 PM

It is frustrating...wah ! lol

I tried setting a static IP. Set a default GW. Flushed iptables of its rules. Still cant ping beyond my NIC.

Have any good primers on interpreting tcpdump ?


Quote:

Originally Posted by paulsm4 (Post 4133127)
Sorry :-(

You're *so* doing all the right things - it's frustrating that it hasn't paid off yet.

If at all possible, please try a static IP. If only for debugging purposes.

IMHO...

PS:
Some "grasping at straws" suggestions:

1. Disable your Linux firewall, e.g.
service iptables stop

2. Disable selinux (frankly, if you're at Centos 4.x, I doubt you even *have* selinux):
setenforce 0

3. You could do worse than run a tcpdump trace on Centos, and/or a Wireshark trace anywhere else


paulsm4 10-21-2010 01:01 PM

Hi -

1. At its simplest level (which is absolutely all you need), "tcpdump" is really, really easy:
Quote:

tcpdump -nS
Here's an example:
Code:

tcpdump -nS > tmp.txt
<<wait a few moments, then Ctl-C>>

less tmp.txt
10:55:10.193469 IP zz.183.40.xxx.49985 > zz.99.83.xxx.ssh: . ack 3499409730 win 32920
10:55:10.193509 IP zz.99.83.xxx.ssh > zz.183.40.xxx.49985: P  499409846:3499410146(300) ack 4003329759 win 8576
10:55:10.242646 IP zz.183.40.xxx.49985 > zz.99.83.xxx.ssh: . ack  499410146 win 32504
10:55:12.499468 IP zz.183.40.xxx.49985 > zz.99.83.xxx.ssh: P  003329759:4003329811(52) ack 3499410146 win 32504

2. Here are two tcpdump links:
http://www.tcpdump.org/
http://danielmiessler.com/study/tcpdump/

3. Any luck on the "grasping at straws" suggestions (firewall and/or SELinux)?

4. Any chance to try swapping hardware (swap cable, swap NIC, try on a side-by-side PC, etc)?

Crossing my fingers :)


All times are GMT -5. The time now is 10:57 PM.