You are not logged in.

#1 2012-06-04 15:40:51

romu
Member
Registered: 2012-06-04
Posts: 2

virtualbox bridge dhcp slow to get IP

Hi,

I have archlinux x86_64 installed in a virtualbox guest.  eth0 is hostonly, eth1 is bridged to laptop wifi.  eth1 uses net-profiles dhcp.  Every time netcfg starts eth1, it shows success after around 3 seconds but if you run ifconfig you'll see that eth1 does not have IP, and network does not work.  But if you do nothing and wait for about 5 minutes and run ifconfig again, you see that eth1 has got IP and network works.

If I manually run "dhcpcd eth1", it also gets IP in a few seconds, but in ifconfig output you don't see the IP and you also need to wait for a couple of minutes.

Here is eth1 profile:

CONNECTION='ethernet'
DESCRIPTION='A basic dhcp ethernet connection using iproute'
INTERFACE='eth1'
IP='dhcp'

Here is /etc/dhcpcd.conf:

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Inform the DHCP server of our hostname for DDNS.
hostname
# To share the DHCP lease across OSX and Windows a ClientID is needed.
# Enabling this may get a different lease than the kernel DHCP client.
# Some upstream DHCP servers may also require a ClientID, such as FRITZ!Box.
#clientid

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname
noipv4ll

Offline

#2 2012-06-04 17:53:16

erowley
Member
Registered: 2012-06-02
Posts: 10

Re: virtualbox bridge dhcp slow to get IP

I'm no expert in this, but you may want to try using these commands for debugging:

dhcpcd -g

^This will regenerate the information gathered by the DHCP client daemon. It should normally get you an IP address.

If this command doesn't seem to run, just kill the dhcpcd daemon:

ps ax | grep dhcpcd

then get the PID from the output, and

kill PID

(Use the actual PID number, not the letters PID)

After this, you can try

dhcpcd eth1

and see if you get your IP. If this doesn't work, I would read up on the dhcpcd manpage to find what command options will give more detailed output. Maybe something useful will be in the debug output?

Offline

#3 2012-06-13 12:48:35

romu
Member
Registered: 2012-06-04
Posts: 2

Re: virtualbox bridge dhcp slow to get IP

Thank you for your reply.

I tried "dhcpcd -g eth1" but it seems that the running dhcpcd process ignores it.  Then I killed the dhcpcd process and started it again by "dhcpcd -d eth1", and then eth1 got an IP after a couple of minutes.  Here is the output of dhcpcd:

dhcpcd[1277]: version 5.5.6 starting
dhcpcd[1277]: all: not configured to accept IPv6 RAs
dhcpcd[1277]: eth1: using hwaddr 08:00:27:87:ba:82
dhcpcd[1277]: eth1: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason PREINIT
dhcpcd[1277]: eth1: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason CARRIER
dhcpcd[1277]: eth1: reading lease `/var/lib/dhcpcd/dhcpcd-eth1.lease'
dhcpcd[1277]: eth1: rebinding lease of 192.168.1.101
dhcpcd[1277]: eth1: sending REQUEST (xid 0xae30e1d0), next in 4.72 seconds
dhcpcd[1277]: eth1: acknowledged 192.168.1.101 from 192.168.1.1 `▒'
dhcpcd[1277]: eth1: checking for 192.168.1.101
dhcpcd[1277]: eth1: sending ARP probe (1 of 3), next in 1.86 seconds
dhcpcd[1277]: eth1: sending ARP probe (2 of 3), next in 1.84 seconds
dhcpcd[1277]: eth1: sending ARP probe (3 of 3), next in 2.00 seconds
dhcpcd[1277]: eth1: leased 192.168.1.101 for 7200 seconds
dhcpcd[1277]: eth1: adding IP address 192.168.1.101/24
dhcpcd[1277]: eth1: adding route to 192.168.1.0/24
dhcpcd[1277]: eth1: adding default route via 192.168.1.1
dhcpcd[1277]: eth1: writing lease `/var/lib/dhcpcd/dhcpcd-eth1.lease'
dhcpcd[1277]: eth1: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason BOUND
dhcpcd[1290]: eth1: eth1: MTU set to 576
dhcpcd[1277]: forking to background
dhcpcd[1277]: forked to background, child pid 1306


I don't see anything wrong in the output.  The problem is dhcpcd runs successfully but why ifconfig shows eth1 has an IP only after a couple of minutes?

Maybe it's not problem of dhcpcd, but still I don't have any clue of the problem.

Offline

#4 2012-06-13 15:57:00

erowley
Member
Registered: 2012-06-02
Posts: 10

Re: virtualbox bridge dhcp slow to get IP

I can't decipher anything amiss in your dhcpcd output either. Its weird that ifconfig would take long to load your ip address. Since you are using a wireless network interface, I wonder if it's driver is affecting this.

Offline

#5 2012-06-14 14:53:13

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,223
Website

Re: virtualbox bridge dhcp slow to get IP

If you suspect dhcpcd, then you should definitely try out dhclient. At the very least it will rule out dhcpcd as a culprit. A few years back I solved a problem with slow dhcp-requests by moving to dhclient. Maybe this is still an issue in certain hard-/software-combinations...

Offline

Board footer

Powered by FluxBB