LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 03-03-2010, 05:08 PM   #1
garydale
Member
 
Registered: Feb 2007
Posts: 118

Rep: Reputation: 22
Debian/Squeeze fails to get DHCP address on startup


This one has been bugging me for some time now. The network interface (as defined in Debian's /etc/network/interfaces file) fails to obtain an IP address from my router. However dhclient br0 does.

I'm using br0 since I run a Windows XP virtual machine. The network/interface changes are from a Debian howto on setting up the tap interface.

As near as I can tell, the /etc/init.d/networking script basically calls /sbin/ifup -a. ifup is a binary.

My /etc/network/interfaces file is:
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0
iface eth0 inet manual
auto br0
iface br0 inet dhcp
pre-up /usr/sbin/tunctl -u garydale -t tap0
pre-up ifconfig tap0 up
bridge_ports all tap0
post-down ifconfig tap0 down
post-down tunctl -d tap0

When I run /etc/init.d/networking start I get:
Configuring network interfaces...Set 'tap0' persistent and owned by uid 1000

Waiting for br0 to get ready (MAXWAIT is 32 seconds).
Internet Software Consortium DHCP Client
Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
All rights reserved.

Please contribute if you find this software useful.
For info, please visit http://www.isc.org/dhcp-contrib.html

Usage: dhclient [-c] [-d] [-e] [-p <port>] [-lf lease-file]
[-pf pidfile] [interface]
exiting.
Failed to bring up br0.
done.

ifconfig shows:
br0 Link encap:Ethernet HWaddr 00:24:1d:14:d8:42
inet6 addr: 2002:63f3:ddfd:0:224:1dff:fe14:d842/64 Scope:Global
inet6 addr: fe80::224:1dff:fe14:d842/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:96 (96.0 B) TX bytes:546 (546.0 B)

eth0 Link encap:Ethernet HWaddr 00:24:1d:14:d8:42
inet6 addr: fe80::224:1dff:fe14:d842/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:660 (660.0 B) TX bytes:546 (546.0 B)
Interrupt:27

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:790 errors:0 dropped:0 overruns:0 frame:0
TX packets:790 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:48441 (47.3 KiB) TX bytes:48441 (47.3 KiB)

tap0 Link encap:Ethernet HWaddr ba:5d:22:12:a1:1c
inet6 addr: fe80::b85d:22ff:fe12:a11c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:8 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

At this point I can run dhclient br0 and get the networking to complete. The only thing that seemed to be missing was the IPv4 address anyway. This gives the following response to ifconfig:

br0 Link encap:Ethernet HWaddr 00:24:1d:14:d8:42
inet addr:192.168.1.17 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: 2002:63f3:ddfd:0:224:1dff:fe14:d842/64 Scope:Global
inet6 addr: fe80::224:1dff:fe14:d842/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:329 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:75239 (73.4 KiB) TX bytes:1543 (1.5 KiB)

eth0 Link encap:Ethernet HWaddr 00:24:1d:14:d8:42
inet6 addr: fe80::224:1dff:fe14:d842/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:334 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:80695 (78.8 KiB) TX bytes:1543 (1.5 KiB)
Interrupt:27

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:790 errors:0 dropped:0 overruns:0 frame:0
TX packets:790 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:48441 (47.3 KiB) TX bytes:48441 (47.3 KiB)

tap0 Link encap:Ethernet HWaddr ba:5d:22:12:a1:1c
inet6 addr: fe80::b85d:22ff:fe12:a11c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:331 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

I suspect that the problem is with the interfaces file, but I'm not a networking guru so I can't see what the issue is. Any ideas?
 
Old 03-03-2010, 05:37 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
iface eth0 inet manual
auto br0
iface br0 inet dhcp


if you want an ip address from the router change manual to dhcp

edit
sorry you are talking about br0
does it work without the auto br0 ?

Last edited by smoker; 03-03-2010 at 05:50 PM.
 
Old 03-03-2010, 06:47 PM   #3
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,732
Blog Entries: 12

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
All I have in my /etc/network/interfaces is

# 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 eth0
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

and Xp in virtualbox works just fine.
 
Old 03-04-2010, 11:51 AM   #4
garydale
Member
 
Registered: Feb 2007
Posts: 118

Original Poster
Rep: Reputation: 22
Quote:
Originally Posted by smoker View Post
iface eth0 inet manual
auto br0
iface br0 inet dhcp


if you want an ip address from the router change manual to dhcp

edit
sorry you are talking about br0
does it work without the auto br0 ?
No. If I remove "auto br0" then /etc/init.d/networking start does nothing.
 
Old 03-04-2010, 11:54 AM   #5
garydale
Member
 
Registered: Feb 2007
Posts: 118

Original Poster
Rep: Reputation: 22
Quote:
Originally Posted by craigevil View Post
All I have in my /etc/network/interfaces is

# 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 eth0
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

and Xp in virtualbox works just fine.
Yes, qemu-kvm can work the same way with the proper command line parameters. However when run this way, the networking is extremely slow. The tap bridge mechanism gives dramatically better performance.
 
Old 03-04-2010, 12:10 PM   #6
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Maybe you should do the bridging before the br0 declaration, because it can't use eth0 to contact the router until it has a route to the router.
eth0 is the only real port isn't it ?
 
  


Reply

Tags
bridge, debian, networking, tap


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Preventing dhcp/dhclient request at startup? (Debian lenny) Cyberman Linux - Networking 1 10-16-2009 02:28 PM
DHCP via router on Debian fails, XP works fine oopsdude Linux - Wireless Networking 8 09-02-2008 07:51 PM
DHCP daemon fails at startup MickyMe Linux - Networking 6 01-07-2007 05:56 AM
Debian 3.1 sarge: DHCP autodetection fails sparka Linux - Networking 4 01-21-2006 09:59 PM
DHCP (client) fails at startup frankwaanders Linux - Networking 1 09-22-2005 01:43 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration