Cannot power off by software or push buttons - Investigating why

Not wishing to hijack this other post:
I started this one...

I have a FreeBSD 15.0-RELEASE-p5 host that has an ASUS N3150I-C motherboard in a 1U rackmount case. The PSU has about six months of use from new. The 'server' runs four thick jails just fine. However, I have noticed that when I need to reboot it after for a freebsd-update install or any other reason after three days or more of running it no longer powers off with the 'poweroff' command or responds to the physical power on/off and rest buttons on the 1U case. The last output from the shutdown command executed by poweroff is about bridge0. To power off the machine the powerlead has to be pulled out of the PSU. The first restart afterwards requires saving settings in UEFI and that then confirms no settings have been changed. The server boot fines and runs normally. After all jails have started I can run poweroff and get the expected result. The physical buttons on the case also work for now.

I looked in /var/log/messages and found this:

Code:
kernel: bridge0: WARNING: Adding member interface re0 which has an IP address assigned is deprecated and will be unsupported in a future release.

So, my thoughts are, fix the known issue, then investigate further.
1. Get the bridge for vnet jails running in the preferred non-deprecated config
2. Try poweroff after four days, then five, then six etc to see if a pattern emerges with what runs from /etc/periodic

Starting with the bridge configuration​

My /etc/rc.conf has this:

Code:
cloned_interfaces=bridge0
ifconfig_bridge0="addm re0 up"
ifconfig_re0="-lro SYNCDHCP"

I tried this, to see if that cures the problem, but it wouldn't get an IPv4 address from DHCP:

Code:
cloned_interfaces=bridge0
ifconfig_bridge0="-lro SYNCDHCP addm re0"

So I tried the following. The static IP address was bound to bridge0, but bridge0 did not like the defaultrouter despite it being the correct one.
My jails should all DHCP from static reservations, but they refused to start as they couldn't find the DHCP server

Code:
cloned_interfaces=bridge0
ifconfig_bridge0="inet 10.26.4.10/24 addm re0"
defaultrouter="10.26.4.254"

Using the handbook instructions 34.8.1
This doesn't work either:

Code:
cloned_interfaces=bridge0
ifconfig_bridge0="addm re0 up"
ifconfig_re0="up"
ifconfig_bridge0="DHCP"

I have put it back to how it was.

If you have a known working FreeBSD 15.0-RELEASE bridge configuration for vnet jails that can DHCP, please post it here.
 
I will try:

Code:
cloned_interfaces=bridge0
ifconfig_bridge0="inet 10.26.4.10 netmask 255.255.255.0 addm re0 up"
defaultrouter="10.26.4.254"
 
That last config didn't work. I cannot ping the default gateway 10.26.4.254 from the host with the bridge IP 10.26.4.10 .

The config below does work, I can ping the default gateway, but it is also deprecated as the IP is assigned to the interface not the bridge:

Code:
cloned_interfaces=bridge0
ifconfig_bridge0="addm re0 up"
ifconfig_re0="inet 10.26.4.10 netmask 255.255.255.0"
defaultrouter="10.26.4.254"

Does anyone have a running config for FreeBSD 15.0-RELEASE that has IP assigned to the bridge and also has vnet jails on the host that can DHCP their IP addresses?
 
Does anyone have a running config for FreeBSD 15.0-RELEASE that has IP assigned to the bridge and also has vnet jails on the host that can DHCP their IP addresses?

The following test setup works for me. The servers, hosts and guests are configured as simple as possible, no firewall, all running in bhyve(8) guests.

The jail(8) host and the jail guest get their IP lease from another VM, running net/dhcpd.

DHCP server: dhcpd.conf
Code:
subnet 192.168.2.0 netmask 255.255.255.0 {
   range 192.168.2.20 192.168.2.30 ;
   option subnet-mask 255.255.255.0 ;
...

Jail host: /etc/rc.conf, configured according to handbook 7.5.3. Creating a VNET Jail:
Code:
defaultrouter="192.168.2.1"

cloned_interfaces="bridge0"
ifconfig_bridge0="SYNCDHCP addm vtnet0 up"
ifconfig_vtnet0="up"
No IP configured for vtnet0.

The jail configuration is copied from handbook 7.5.3. Creating a VNET Jail, green and red highlighted lines are edited.

/etc/jail.conf
Rich (BB code):
vnet {
  # STARTUP/LOGGING
  exec.consolelog = "/var/log/jail_console_${name}.log";

  # PERMISSIONS
  allow.raw_sockets;
  exec.clean;
  mount.devfs;
  devfs_ruleset = 6;

  # PATH/HOSTNAME
  path = "/Jails/15.0R-V1";
  host.hostname = "${name}";

  # VNET/VIMAGE
  vnet;
  vnet.interface = "${epair}b";

  # NETWORKS/INTERFACES
  $id = "154"; 
  #$ip = "192.168.2.${id}/24";
  $gateway = "192.168.2.1";
  $bridge = "bridge0"; 
  $epair = "epair${id}";

  # ADD TO bridge INTERFACE
  exec.prestart  = "/sbin/ifconfig ${epair} create up";
  exec.prestart += "/sbin/ifconfig ${epair}a up descr jail:${name}";
  exec.prestart += "/sbin/ifconfig ${bridge} addm ${epair}a up";
  #exec.start    += "/sbin/ifconfig ${epair}b ${ip} up";
  exec.start    += "/sbin/dhclient ${epair}b";
  exec.start    += "/sbin/ifconfig ${epair}b up";
  exec.start    += "/sbin/route add default ${gateway}";
  exec.start    += "/bin/sh /etc/rc";
  exec.stop     = "/bin/sh /etc/rc.shutdown";
  exec.poststop = "/sbin/ifconfig ${bridge} deletem ${epair}a";
  exec.poststop += "/sbin/ifconfig ${epair}a destroy";
}

Jail host: /etc/devfs.rules
Rich (BB code):
[devfsrules_jail_vnet=6]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add include $devfsrules_jail
add path pf unhide
add path bpf* unhide
# without /dev/bpf* no dhcp lease of 'exec.start    += "/sbin/dhclient ${epair}b" '

Jail host, running "vnet" jail:
Rich (BB code):
root@BHY-Jails:~ # ifconfig
vtnet0: flags=1008b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        options=880028<VLAN_MTU,JUMBO_MTU,LINKSTATE,HWSTATS>
        ether 58:9c:fc:0a:af:c8
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,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>
bridge0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        options=10<VLAN_HWTAGGING>
        ether 58:9c:fc:10:cd:f1
        inet 192.168.2.22 netmask 0xffffff00 broadcast 192.168.2.255
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        bridge flags=0<>
        member: epair154a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                port 4 priority 128 path cost 2000 vlan protocol 802.1q
        member: vtnet0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                port 1 priority 128 path cost 2000 vlan protocol 802.1q
        groups: bridge
        nd6 options=9<PERFORMNUD,IFDISABLED>
epair154a: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        description: jail:vnet
        options=200009<RXCSUM,VLAN_MTU,RXCSUM_IPV6>
        ether 58:9c:fc:10:d9:b3
        groups: epair
        media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        
root@BHY-Jails:~ # netstat -rn4
 Routing tables

Internet:
Destination        Gateway            Flags         Netif Expire
default            192.168.2.1        UGS         bridge0
127.0.0.1          link#2             UH              lo0
192.168.2.0/24     link#3             U           bridge0
192.168.2.22       link#2             UHS             lo0

Jail "vnet":
Rich (BB code):
root@vnet:~ # ifconfig
 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 0x6
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair154b: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        options=200009<RXCSUM,VLAN_MTU,RXCSUM_IPV6>
        ether 58:9c:fc:10:b6:e9
        inet 192.168.2.26 netmask 0xffffff00 broadcast 192.168.2.255
        groups: epair
        media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        
root@vnet:~ # netstat -rn4
 Routing tables

Internet:
Destination        Gateway            Flags         Netif Expire
default            192.168.2.1        UGS       epair154b
127.0.0.1          link#6             UH              lo0
192.168.2.0/24     link#5             U         epair154b
192.168.2.26       link#6             UHS             lo0

root@vnet:~ # ping -c2 freebsd.org
PING freebsd.org (96.47.72.84): 56 data bytes
64 bytes from 96.47.72.84: icmp_seq=0 ttl=47 time=165.989 ms
64 bytes from 96.47.72.84: icmp_seq=1 ttl=47 time=164.807 ms

--- freebsd.org ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 164.807/165.398/165.989/0.591 ms
 
  • Thanks
Reactions: vmb
It's very unlikely that a simple warning concerning the network configuration prevents to poweroff your machine. That said, it's better to address this problem because it will bite you with the future FreeBSD versions (hence the warning).

That last config didn't work. I cannot ping the default gateway 10.26.4.254 from the host with the bridge IP 10.26.4.10 .
It should work, yet. What ifconfig says? Look also at your routing tables ( netstat -r).
 
I found a configuration for assigning an IP address to the bridge that works for my network.

My machine is connected to a switched network that has VLANs. The ethernet port that the host is connected to has VLANs assigned and the host uses the untagged VLAN present on that port. This is not a problem when the IPv4 is assigned to the interface. The network backbone has Link Aggregated connections and Spanning Tree is enabled to detect accidental loops between the switches.

Despite using an untagged VLAN with this host, if VLANs are enabled in /boot/loader.conf
Code:
if_vlan_load="YES"

Bringing up the physical interface in /etc/rc.conf enables the bridge to acquire an IPv4 address via DHCP
Code:
cloned_interfaces=bridge0
ifconfig_bridge0="SYNCDHCP addm re0 up"
ifconfig_re0="up"

Ifconfig now lists all of the VLANs present on the host interface, but DHCP works untagged, just as it did before. All vnet jails can DHCP again too.

I use static reservations for all of my DHCP clients and I had to change the jail host's reservation from the interface MAC address to a new 'FreeBSD' MAC address belonging to bridge0.

I am not sure if I need to enable STP on the host's bridge0, it works OK without it.
 
Rebooting and powering off by software and hardware switches has been working OK while trying to fix the bridge IP problem. Now that this has been achieved I will reboot in 2 days, 4 days, 8 days, 16 days to see if the machine still has a problem powering off. Previously, when a software poweroff was issued, the shutdown process would stop after outputting to the screen that bridge0 had been taken down.
 
Back
Top