LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-09-2012, 05:14 PM   #1
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Rep: Reputation: 7
2nd NIC doesn't get a dhcp ip address


I'm struggling with an issue here.
I have Ubuntu server 10.04 2 network cards in it.
eth0 is LAN side and has fixed ip, eth1 will be having a dynamic ip from the isp provider when they come next week.
Now i was already testing the eth1 card to put it also in the same LAN side to obtain an IP from the dhcp server running on the server, can this work for only testing?
Because when i restart the interfaces eth1 does not get an IP
And I'm worried and thinking that this NIC isn't working properly but the output with ifconfig -a gives me all kind of information about eth1
I also have ipv4forward enabled and later on when the actual isp line is there i will also activate the NAT in iptables.
But first I'd like to know if I can test eth1 to get an ip from the dhcp server on eth0 ?
If I give eth1 a static IP in the range of the LAN I can ping to it. but why does it not get a dhcp IP ?
I also have tried a new NIC eth2 but it gives me the same result

Even after connecting a router to this nic eth2 and did a restart it gave me this result :
/etc/init.d/networking restart
* Reconfiguring network interfaces... There is already a pid file /var/run/dhclient.eth2.pid with pid 7936
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth2/00:0e:2e:37:20:83
Sending on LPF/eth2/00:0e:2e:37:20:83
Sending on Socket/fallback
ssh stop/waiting
ssh start/running, process 10443
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth2/00:0e:2e:37:20:83
Sending on LPF/eth2/00:0e:2e:37:20:83
Sending on Socket/fallback
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 17
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 14
 
Old 10-10-2012, 01:59 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
where are your server logs?
 
Old 10-10-2012, 04:37 AM   #3
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Original Poster
Rep: Reputation: 7
Quote:
Originally Posted by acid_kewpie View Post
where are your server logs?
Which one do you need? system or dmesg or messages?
 
Old 10-10-2012, 04:40 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
whatever relates to the dhcp server. Right now, we can only presume that the DHCP server is not running, not responding etc.
 
Old 10-10-2012, 05:23 AM   #5
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Original Poster
Rep: Reputation: 7
for example : and dhcp-server is running

dhcpd: DHCPREQUEST for 192.168.123.130 from 00:1d:ec:02:bf:52 via eth0
dhcpd: DHCPACK on 192.168.123.130 to 00:1d:ec:02:bf:52 via eth0
dhcpd: Dynamic and static leases present for 192.168.123.114.
dhcpd: Remove host declaration SiriusZwarts or remove 192.168.123.114
dhcpd: from the dynamic address pool for 192.168.123/24
dhcpd: DHCPREQUEST for 192.168.123.114 from 00:1d:0f:b3:d0:bb via eth0
dhcpd: DHCPACK on 192.168.123.114 to 00:1d:0f:b3:d0:bb via eth0
dhclient: Internet Systems Consortium DHCP Client V3.1.3
dhclient: For info, please visit https://www.isc.org/software/dhcp/
dhclient: Internet Systems Consortium DHCP Client V3.1.3
dhclient: For info, please visit https://www.isc.org/software/dhcp/
dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 8
dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 20

---------- Post added 10-10-12 at 12:23 ----------


Last edited by rytec; 10-10-2012 at 05:24 AM.
 
Old 10-10-2012, 06:25 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
so is the server receiving the DHCPDISCOVER? It should be in the logs there, or you could use tcpdump to watch for it live.
 
Old 10-10-2012, 07:11 AM   #7
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Original Poster
Rep: Reputation: 7
Can I filter tcpdump in live situation? there are so many things passing by in my terminal screen.
The strange thing is that even if I use another router connected to this NIC it won't get a ip but when i connect the router to my pc it gives an ip.
In some kind of way this NIC or even another new NIC doesn't get an dhcp offer.
Could it be that I have to add a rule in iptables for this eth1 so it receives data?
 
Old 10-10-2012, 07:24 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
sure, if you try "tcpdump -i eth0 -vn port 67 or port 68" you'll only see the dhcp traffic.
 
Old 10-10-2012, 07:41 AM   #9
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Original Poster
Rep: Reputation: 7
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
14:36:08.481949 IP (tos 0x0, ttl 128, id 38171, offset 0, flags [none], proto UDP (17), length 328)
192.168.123.113.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:25:22:d8:43:e8, length 300, xid 0x3d1ea4cf, Flags [none]
Client-IP 192.168.123.113
Client-Ethernet-Address 00:25:22:d8:43:e8 [|bootp]
14:36:08.482494 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 328)
192.168.123.2.67 > 192.168.123.113.68: BOOTP/DHCP, Reply, length 300, xid 0x3d1ea4cf, Flags [none]
Client-IP 192.168.123.113
Server-IP 192.168.123.2
Client-Ethernet-Address 00:25:22:d8:43:e8 [|bootp]
 
Old 10-10-2012, 07:48 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
right, so what's that telling you? Just dumping some output with no context isn't useful.
 
Old 10-10-2012, 07:52 AM   #11
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Original Poster
Rep: Reputation: 7
It's telling me that this eth1 is not getting a dhcp lease.Can it be that I have to open some rules in iptables for this?
 
Old 10-10-2012, 07:56 AM   #12
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
tcpdump will see traffic before iptables messes with it, so maybe you just have a physical issue on the link? is it meant to be on the same local subnet?
 
Old 10-10-2012, 08:00 AM   #13
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Original Poster
Rep: Reputation: 7
actualy it is ment to configure this server also as router/firewall, eth0 is LAN side and eth1 is WAN side (but for this testing I have connected eth1 also in the LAN side switch), so this eth1 should be set as dhcp because the isp gives dynamic ip addresses.
If I give a static ip to eth1 then I can ping wit another PC in the LAN to this static ip assigned to eth1 and it gives me responses so the physical connection should be ok, als the green led lights up on 100Mbits on eth1 card and LAN switch.
Even with another nic card tested this and had the same issue so I do not think that the NIC card is broken.
 
Old 10-10-2012, 08:18 AM   #14
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Original Poster
Rep: Reputation: 7
I have did another tcpdump but this time on eth1 and it gives me this result :

eth1: no IPv4 address assigned
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
15:15:53.100149 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:50:bf:d5:83:5a, length 300, xid 0xfa221022, Flags [none]
Client-Ethernet-Address 00:50:bf:d5:83:5a [|bootp]
15:16:05.623684 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:50:bf:d5:83:5a, length 300, xid 0xfa221022, secs 7, Flags [none]
Client-Ethernet-Address 00:50:bf:d5:83:5a [|bootp]
15:16:07.007083 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:50:bf:d5:83:5a, length 300, xid 0xfa221022, secs 14, Flags [none]
Client-Ethernet-Address 00:50:bf:d5:83:5a [|bootp]
15:16:28.021072 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:50:bf:d5:83:5a, length 300, xid 0xfa221022, secs 35, Flags [none]
Client-Ethernet-Address 00:50:bf:d5:83:5a [|bootp]


Can you explain a bit what this means ?
 
Old 10-10-2012, 09:58 AM   #15
nikmit
Member
 
Registered: May 2011
Location: Nottingham, UK
Distribution: Debian
Posts: 178

Rep: Reputation: 34
It means that a client with MAC address 00:50:bf:d5:83:5a is repeatedly broadcasting DHCP requests but is receiving no replies.

Your tcpdumps seem unrelated to each other and I am struggling to figure out what your setup is.

If both interfaces on the router are connected to the same switch, are they in different vlans? Can you capture traffic at the DHCP server?
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
2 NICs & DHCP: 1 gets an address, 1 doesn't wesc78 Linux - Networking 5 05-14-2007 10:01 AM
DHCP seems to set hostname = Mac address, doesn't reverse lookup techsimian Linux - Networking 4 08-15-2006 04:11 PM
Why Scourge (2nd computer) isn't getting ip address from Misery (1st computer) dhcp? pslave Linux - Networking 2 04-09-2006 05:58 AM
Static address works but DHCP doesn't... devahl Linux - Networking 1 05-03-2004 04:55 PM
Trouble getting an IP address with DHCP Dec 12140 Nic. Works in Windows eww Linux - Networking 11 12-07-2003 05:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration