tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Changing the default subnet route.



Hi List!

I'm having a spot of bother getting dhcpcd to change the default subnet
route AND remove interface addresses correctly. It's probably something
that I'm doing wrong though.

Here is the scenario.
re0 and ral0 obtain DHCP leases on the same subnet. dhcpcd prefers re0
and ensures it gets the default subnet route.
Network works via re0.
re0 goes down, dhcpcd changes the subnet route to use ral0 and removes
address from re0.
Network works via ral0.
re0 goes up, dhcpcd changes the subnet route to use re0 after adding the
address
At this point, dhcpcd does not report any error adding the interface
address, which means the ioctl reported success. However, the address is
not present as reported via ifconfig. Using ifconfig to add or remove
the address from re0 now results in an error. Also, the subnet route is
subtly different as reported by netstat.
Interestingly, taking re0 down again, dhcpcd changes the subnet route
back to ral0 and that works just fine - the network works once more.

I've attached logs of dhcpcd and the commands used whilst dhcpcd is
running.
Any insight into what dhcpcd is doing wrong, if it's a NetBSD issue
(only tested this on NetBSD-5.99.4, will try and test on NetBSD 5.0beta
and FreeBSD-7.0 tomorrow) or any other ideas are more than welcome.

The only thing I can think of is that the subnet route message is
slightly wrong, but if so, why does it work for one interface and not
the other? I struggled to find how or where the kernel creates the
default subnet route - any pointers to this would be appreciated also.
Note, swapping the preference order has the same issue, just on
different interfaces so it's not a driver bug.

Thanks

Roy
# netstat -nrf inet
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use    Mtu  Interface
default            10.73.1.1          UGS         0        6      -  re0
10.73.1/24         link#1             UC          1        0      -  re0
10.73.1.1          00:09:5b:xx:xx:xx  UHLc        3       24      -  re0
127/8              127.0.0.1          UGRS        0        0  33648  lo0
127.0.0.1          127.0.0.1          UH          5    10079  33648  lo0
# ifconfig re0 down
# netstat -nrf inet
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use    Mtu  Interface
default            10.73.1.1          UGS         1        3      -  ral0
10.73.1/24         link#4             UC          1        0      -  ral0
10.73.1.1          00:09:5b:xx:xx:xx  UHLc        2       15      -  ral0
127/8              127.0.0.1          UGRS        0        0  33648  lo0
127.0.0.1          127.0.0.1          UH          5    10111  33648  lo0
# ifconfig re0 up
# netstat -nrf inet
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use    Mtu  Interface
default            10.73.1.1          UGS         1       18      -  ral0
10.73.1/24         link#1             U           1        0      -  re0
127/8              127.0.0.1          UGRS        0        0  33648  lo0
127.0.0.1          127.0.0.1          UH          5    10129  33648  lo0
# ifconfig re0
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    
capabilities=3f80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx>
    enabled=0
    address: 00:50:8d:xx:xx:xx
    media: Ethernet autoselect (100baseTX full-duplex)
    status: active
# ifconfig re0 10.73.1.198/24
ifconfig: SIOCAIFADDR: File exists
# ifconfig re0 -alias 10.73.1.198/24
ifconfig: SIOCDIFADDR: Can't assign requested address
# 

# ./dhcpcd -dBA
dhcpcd - - - version 4.99.6 starting
dhcpcd - - - fwip0: unsupported interface type
dhcpcd - - - re0: executing `/libexec/dhcpcd-run-hooks', reason PREINIT
dhcpcd - - - re0: rebinding lease of 10.73.1.198
dhcpcd - - - re0: sending DHCP_REQUEST (xid 0x4ca505bf), next in 3.59 seconds
dhcpcd - - - ral0: executing `/libexec/dhcpcd-run-hooks', reason PREINIT
dhcpcd - - - ral0: rebinding lease of 10.73.1.30
dhcpcd - - - ral0: sending DHCP_REQUEST (xid 0xeb8fc6e9), next in 4.02 seconds
dhcpcd - - - re1: executing `/libexec/dhcpcd-run-hooks', reason PREINIT
dhcpcd - - - re1: waiting for carrier
dhcpcd - - - re0: acknowledged 10.73.1.198 from 10.73.1.1 `uberserver'
dhcpcd - - - re0: leased 10.73.1.198 for 86400 seconds
dhcpcd - - - re0: adding IP address 10.73.1.198/24
dhcpcd - - - re0: adding route to 10.73.1.0/24
dhcpcd - - - re0: adding default route via 10.73.1.1
dhcpcd - - - re0: executing `/libexec/dhcpcd-run-hooks', reason REBOOT
Stopping named.
Waiting for PIDS: 12572.
Starting named.
Stopping ntpd.
Starting ntpd.
dhcpcd - - - ral0: acknowledged 10.73.1.30 from 10.73.1.1 `uberserver'
dhcpcd - - - ral0: leased 10.73.1.30 for 86400 seconds
dhcpcd - - - ral0: adding IP address 10.73.1.30/24
dhcpcd - - - ral0: executing `/libexec/dhcpcd-run-hooks', reason REBOOT
Stopping named.
Waiting for PIDS: 13933.
Starting named.
Stopping ntpd.
Waiting for PIDS: 10599.
Starting ntpd.
dhcpcd - - - re0: carrier lost
dhcpcd - - - ral0: changing route to 10.73.1.0/24
dhcpcd - - - ral0: changing default route via 10.73.1.1
dhcpcd - - - re0: deleting IP address 10.73.1.198/24
dhcpcd - - - re0: executing `/libexec/dhcpcd-run-hooks', reason EXPIRE
Stopping named.
Waiting for PIDS: 13302.
Starting named.
Stopping ntpd.
Waiting for PIDS: 11442.
Starting ntpd.
dhcpcd - - - re0: carrier acquired
dhcpcd - - - re0: rebinding lease of 10.73.1.198
dhcpcd - - - re0: sending DHCP_REQUEST (xid 0x666b30ed), next in 3.97 seconds
dhcpcd - - - re0: ignoring packet with xid 0x4ca505bf as it's not ours 
(0x666b30ed)
dhcpcd - - - re0: acknowledged 10.73.1.198 from 10.73.1.1 `uberserver'
dhcpcd - - - re0: leased 10.73.1.198 for 86400 seconds
dhcpcd - - - re0: adding IP address 10.73.1.198/24
dhcpcd - - - re0: changing route to 10.73.1.0/24
dhcpcd - - - re0: changing default route via 10.73.1.1
dhcpcd - - - re0: executing `/libexec/dhcpcd-run-hooks', reason REBOOT
Stopping named.
Waiting for PIDS: 9629.
Starting named.
Stopping ntpd.
Waiting for PIDS: 11910.
Starting ntpd.

Attachment: signature.asc
Description: This is a digitally signed message part



Home | Main Index | Thread Index | Old Index