Bridge works on DHCP but not Static

Hi so I’ve setup up a bridge but it works on DHCP and not on static or unmanaged .

On static and unmanaged the device I connect to receives IP but no DNS and NAT. I had everything working before creating firewall rules I messed up the config so restored from backup . Only thing I have done since restore is Download Sqm and the USB Ethernet driver.

This is the topology I’m testing on

Router - PI - PS5

We’ve been here before. We proved the bridge was working. What did you change?

Let’s see the configs.

Havent changed anything except MTU , what settings in config would you like me to show?

In your previous thread, we proved the bridge worked. You must have done more than changing the mtu to break it. Show us your complete config.

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, VPN keys, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
root@OpenWrt:~# ubus call system board
/config/dhcp
cat{
        "kernel": "6.6.93",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 1",
        "model": "Raspberry Pi 5 Model B Rev 1.0",
        "board_name": "raspberrypi,5-model-b",
        "rootfs_type": "ext4",
        "release": {
                "distribution": "OpenWrt",
                "version": "24.10.2",
                "revision": "r28739-d9340319c6",
                "target": "bcm27xx/bcm2712",
                "description": "OpenWrt 24.10.2 r28739-d9340319c6",
                "builddate": "1750711236"


root@OpenWrt:~# cat /etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd5a:5152:a232::/48'
        option packet_steering '0'

config device
        option name 'br-lan'
        option type 'bridge'
        option ipv6 '0'
        list ports 'eth0'
        list ports 'eth1'
        option bridge_empty '1'
        option stp '1'
        option igmp_snooping '1'

config interface 'lan'
        option device 'br-lan'
        option proto 'dhcp'

 uci show sqm
sqm.eth1=queue
sqm.eth1.enabled='1'
sqm.eth1.interface='eth0'
sqm.eth1.download='800000'
sqm.eth1.upload='700000'
sqm.eth1.qdisc='cake'
sqm.eth1.script='piece_of_cake.qos'
sqm.eth1.qdisc_advanced='1'
sqm.eth1.ingress_ecn='ECN'
sqm.eth1.egress_ecn='ECN'
sqm.eth1.linklayer='ethernet'
sqm.eth1.debug_logging='0'
sqm.eth1.verbosity='5'
sqm.eth1.squash_dscp='1'
sqm.eth1.squash_ingress='1'
sqm.eth1.overhead='44'
root@OpenWrt:~#
root@OpenWrt:~# cat /etc/config/firewall
config defaults
        option syn_flood        1
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

config zone
        option name             lan
        list   network          'lan'
        option input            ACCEPT
        option output           ACCEPT
        option forward          ACCEPT

config zone
        option name             wan
        list   network          'wan'
        list   network          'wan6'
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
        option masq             1
        option mtu_fix          1

config forwarding
        option src              lan
        option dest             wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
        option name             Allow-DHCP-Renew
        option src              wan
        option proto            udp
        option dest_port        68
        option target           ACCEPT
        option family           ipv4

# Allow IPv4 ping
config rule
        option name             Allow-Ping
        option src              wan
        option proto            icmp
        option icmp_type        echo-request
        option family           ipv4
        option target           ACCEPT

config rule
        option name             Allow-IGMP
        option src              wan
        option proto            igmp
        option family           ipv4
        option target           ACCEPT

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
config rule
        option name             Allow-DHCPv6
        option src              wan
        option proto            udp
        option dest_port        546
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-MLD
        option src              wan
        option proto            icmp
        option src_ip           fe80::/10
        list icmp_type          '130/0'
        list icmp_type          '131/0'
        list icmp_type          '132/0'
        list icmp_type          '143/0'
        option family           ipv6
        option target           ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Input
        option src              wan
        option proto    icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        list icmp_type          router-solicitation
        list icmp_type          neighbour-solicitation
        list icmp_type          router-advertisement
        list icmp_type          neighbour-advertisement
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Forward
        option src              wan
        option dest             *
        option proto            icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-IPSec-ESP
        option src              wan
        option dest             lan
        option proto            esp
        option target           ACCEPT

config rule
        option name             Allow-ISAKMP
        option src              wan
        option dest             lan
        option dest_port        500
        option proto            udp
        option target           ACCEPT


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#       option src              lan
#       option src_ip   
#       option dest             wan
#       option proto    tcp
#       option target   REJECT

# block a specific mac on wan
#config rule
#       option dest             wan
#       option src_mac  00:11:22:33:44:66
#       option target   REJECT

# block incoming ICMP traffic on a zone
#config rule
#       option src              lan
#       option proto    ICMP
#       option target   DROP

# port redirect port coming in on wan to lan
#config redirect
#       option src                      wan
#       option src_dport        80
#       option dest                     lan
#       option dest_ip          
#       option dest_port        80
#       option proto            tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#       option src              wan
#       option src_dport        22001
#       option dest             lan
#       option dest_port        22
#       option proto            tcp

### FULL CONFIG SECTIONS
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  00:11:22:33:44:55
#       option src_port 80
#       option dest             wan
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp
#       option target   REJECT

#config redirect
#       option src              lan
#       option src_ip   
#       option src_mac  00:11:22:33:44:55
#       option src_port         1024
#       option src_dport        80
#       option dest_ip  
#       option dest_port        120
#       option proto    tcp
root@OpenWrt:~#

root@OpenWrt:~# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option cachesize '1000'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'hybrid'
        option ra 'hybrid'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'
        option ignore '1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

100% havent changed anything as i have restored from last working point , just before i switched to unmanaged

You added sqm with the intent of breaking the bridge so it could be processed.

Go back to the state where your pi was operating with a static ip and a dhcp server using the bridge from here. Make sure the driver package is installed. When that is working, you can the change it to dhcp client or unmanaged and connect it to the upstream and your ps5 should still work.

i deleted the last 2 lines as I have DHCP disabled , switched to static still receive IP but no DNS or NAT .

When setting static ive tried 8.8.8.8 and my Gateway ip still nothing

Reset the entire device.
Make sure you have the drivers for the usb Ethernet adapter. Add eth1 to the bridge.

Test both ports to ensure that a computer that is connected to the port gets an ip address in the otherwise default configuration.

Then, you can change the config to make the lan interface unmanaged (once this is done, you’ll need to use the usb keyboard and hdmi display to make future edits). Connect one port to the upstream, and the other port to your ps5. What happens?

I had done that still no luck I switched back to static and connected to ps5 I checked the ARP table only showed my PC and Pi so i pinged the PS5 forcing to add it to the ARP table now it works in static, but not unmanaged

In unmanaged mode, the pi will not have an arp table.

The question is if the pi (in the bridge config, unmanaged, with nothing else altered/added) will transparently pass Ethernet frames in the same way as an unmanaged switch. Thst is, we would expect the ps5 to be able to get online though the pi via that bridge.

So to recap…

From a completely default config, adding only the usb Ethernet driver package and then adding eth1 to the bridge…

A device plugged into either Ethernet port should get an ip address from the pi.

Then, if you make the lan interface unmanaged, and then connect one Ethernet port to the upstream network (where there is a dhcp server already confined) and your PS5 to the other port, the ps5 should get an ip from the upstream network and should be able to get online.

Do not make any other changes, additions, or removals relative to the things I have just described.

1 Like

Yes following all of that still DHCP worked but DNS and NAT failed . I can try all again won’t be long but 100% same issue will occur as I’ve done that many times.

If that fails, try connecting the ps5 directly to the upstream instead of the pi.

From my own experimentation, I can confirm that the bridge works as expected based on the directions I have been providing to you. In fact, I'm using the (unmanaged) bridge to write this message now.

Here's my recipe:

  • Pi400 + Linksys USB3gigV1
  • Customized 24.10.3 image
    • defaults + kmod-usb-net-rtl8152
    • nothing removed, no other packages added
    • ext4 image written via Raspberry Pi Imager

I then added eth1 to the bridge:

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	list ports 'eth1'

Immediately, both ports worked without issue to obtain an address from the Pi400 (based on the default config of the lan interface).

I changed the lan to dhcp client:

config interface 'lan'
	option device 'br-lan'
	option proto 'dhcp'

And then connected eth1 to the upstream (i.e. my main network), with eth0 connected to my computer.

The Pi obtained an address from my main router, as did my computer connected to eth0. I was able to use the internet normally with all the traffic passing through the Pi400 running OpenWrt.

Finally, I changed the lan to unmanaged:

config interface 'lan'
	option device 'br-lan'
	option proto 'none'

Once again the bridge performed exactly as expected -- my computer had full access to the internet. But, notably, the Pi does not have an address anymore (by definition since it's unmanaged), so it is only reachable using either the console (USB keyboard + HDMI monitor connected to the Pi) or via the backup interface that I created using a VLAN.

Anyway, with this setup, I can conclusively say that the bridge works properly. Any problems you are experiencing are a function of your upstream network and/or other things you're doing (likely incorrectly) with your OpenWrt configuration that you have not disclosed. (There is the slim possibility that there is some issue with your USB ethernet adapter, but I don't think it's likely since you were able to get the bridge to work with the lan configured with static IP).

1 Like

Thanks for that I will try again today

So mine works I’m not sure if settings never applied once I set them but settings like DHCP etc were still enabled causing a issue I disabled DHCP and now everything works fine thanks for your help

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.