[Bug 277904] DHCP and static ip not correctly configured

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 23 Mar 2024 09:43:07 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277904

            Bug ID: 277904
           Summary: DHCP and static ip not correctly configured
           Product: Base System
           Version: 14.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: conf
          Assignee: bugs@FreeBSD.org
          Reporter: crb@ChrisBowman.com

I have the following line in my /etc/rc.conf:

ifconfig_bge0="DHCP"
ifconfig_bge0_alias0="99.104.201.113/29"
ifconfig_bge0_ipv6="inet6 accept_rtadv"

If I reboot with this, upon restart ifconfig reports the following:

bge0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0
mtu 1500
       
options=c019b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE>
        ether c4:2c:03:0b:9d:f6
        inet 192.168.1.48 netmask 0xffffff00 broadcast 192.168.1.255
        inet6 fe80::c62c:3ff:fe0b:9df6%bge0 prefixlen 64 scopeid 0x1
        inet6 2600:1700:5430:10b1:c62c:3ff:fe0b:9df6 prefixlen 64 autoconf
pltime 604800 vltime 2592000
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

Note that only the DHCP address is present not the static IP of
99.104.201.113/31
If I immediately run "service netif restart;ifconfig" as root I get the
following output:

# service netif restart ; ifconfig
Stopping dhclient.
Stopping Network: lo0 bge0.
lo0: flags=8048<LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
bge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
       
options=c019b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE>
        ether c4:2c:03:0b:9d:f6
        media: Ethernet autoselect
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
/etc/rc.d/netif: WARNING: $ifconfig_bge0_alias0 needs leading "inet" keyword
for an IPv4 address.
Starting Network: lo0 bge0.
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
bge0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0
mtu 1500
       
options=c019b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE>
        ether c4:2c:03:0b:9d:f6
        inet 192.168.1.48 netmask 0xffffff00 broadcast 192.168.1.255
        inet 99.104.201.113 netmask 0xfffffff8 broadcast 99.104.201.119
        inet6 fe80::c62c:3ff:fe0b:9df6%bge0 prefixlen 64 scopeid 0x1
        inet6 2600:1700:5430:10b1:c62c:3ff:fe0b:9df6 prefixlen 64 autoconf
pltime 604800 vltime 2592000
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
bge0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0
mtu 1500
       
options=c019b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE>
        ether c4:2c:03:0b:9d:f6
        inet 192.168.1.48 netmask 0xffffff00 broadcast 192.168.1.255
        inet 99.104.201.113 netmask 0xfffffff8 broadcast 99.104.201.119
        inet6 fe80::c62c:3ff:fe0b:9df6%bge0 prefixlen 64 scopeid 0x1
        inet6 2600:1700:5430:10b1:c62c:3ff:fe0b:9df6 prefixlen 64 autoconf
pltime 604800 vltime 2592000
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>


Note the final ifconfig lists both the DHCP address and the Static IP.
Fro this I conclude that the configuration in /etc/rc.conf is correct but for
some reason doesn't work correctly at start up.  I'm still trying to read
startup script to understand why.

-- 
You are receiving this mail because:
You are the assignee for the bug.