Connect to Guest from LAN - what's wrong with my (mis)configuration?

Guest network is already set up and working as expected. I would like to e.g. SSH from a machine on the LAN (192.168.1.xxx) into another machine on the Guest (192.168.3.xxx) network. This post describes the fix that should work (add config forwarding). However, I did that (shown below) and the connection still just times out. On the client side (ubuntu) I even added static routes to both 192.168.3.0/24 and the exact ip address, both through the 192.168.1.1 gateway. None of it worked.

Can someone double-check my OpenWRT config?

Contents of /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 'fd28:9f44:261d::/48'
option packet_steering '1'

config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'

config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
list dns '192.168.1.214'

config interface 'wan'
option device 'wan'
option proto 'dhcp'

config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'

config device
option type 'bridge'
option name 'br-guest'
option bridge_empty '1'
list ports 'lan4'

config interface 'guest'
option proto 'static'
option device 'br-guest'
option ipaddr '192.168.3.1'
option netmask '255.255.255.0'
list dns '192.168.1.214'

Contents of /etc/config/firewall

config defaults
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'

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

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

config forwarding
option src 'lan'
option dest 'wan'

config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'

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'

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'

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'

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'

config zone
option name 'guest'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
list network 'guest'

config forwarding
option src 'guest'
option dest 'wan'

config forwarding
option src 'lan'
option dest 'guest'

config rule
option src 'guest'
option name 'guest-dns-default'
option dest_port '53'
option target 'ACCEPT'

config redirect
option dest 'lan'
option target 'DNAT'
option name 'force-dns-pihole'
option src 'lan'
option src_ip '!192.168.1.214'
option src_dport '53'
option dest_ip '192.168.1.214'
option dest_port '53'

config nat
option name 'dns_pihole_masq'
list proto 'all'
option src 'lan'
option dest_ip '192.168.1.214'
option target 'MASQUERADE'

config redirect
option dest 'lan'
option target 'DNAT'
option name 'force-guest-pihole'
option src 'guest'
option src_dport '53'
option dest_ip '192.168.1.214'
option dest_port '53'

config rule
option src 'guest'
option dest 'lan'
option name 'guest-dns-pihole'
list dest_ip '192.168.1.214'
option dest_port '53'
option target 'ACCEPT'

config rule
option src 'guest'
option name 'guest-dhcp'
option dest_port '67'
option target 'ACCEPT'
list proto 'udp'

config rule
option src 'guest'
option dest 'lan'
list dest_ip '192.168.1.214'
option dest_port '445'
option target 'ACCEPT'
option name 'guest-to-samba'

config rule
option src 'guest'
option dest 'lan'
list dest_ip '192.168.1.214'
option dest_port '137-139'
option target 'ACCEPT'
option name 'guest-to-samba2

I see no fault in your 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 (red circle; this works best in the 'Markdown' composer view in the blue oval):

Screenshot 2025-10-20 at 8.14.14 PM

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

You have to allow traffic on the client coming from the lan subnet

1 Like

ubus call system board

{
	"kernel": "6.6.119",
	"hostname": "OpenWrt",
	"system": "ARMv8 Processor rev 4",
	"model": "Linksys E8450 (UBI)",
	"board_name": "linksys,e8450-ubi",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "24.10.5",
		"revision": "r29087-d9c5716d1d",
		"target": "mediatek/mt7622",
		"description": "OpenWrt 24.10.5 r29087-d9c5716d1d",
		"builddate": "1766005702"
	}
}

/etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option phy 'wl0'
	option cell_density '0'
	option htmode 'HT40'
	option band '2g'
	option channel 'auto'
	option disabled '1'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option mode 'ap'
	option ssid 'not the actual guest wlan 1'
	option encryption 'sae-mixed'
	option isolate '1'
	option key 'this is not a password'
	option ocv '0'
	option network 'guest'
	option disabled '1'

config wifi-device 'radio1'
	option type 'mac80211'
	option phy 'wl1'
	option cell_density '0'
	option htmode 'HE80'
	option band '5g'
	option channel 'auto'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'not the actual wlan'
	option encryption 'sae-mixed'
	option key 'this is not a password'
	option ocv '0'

config wifi-iface 'wifinet2'
	option device 'radio1'
	option mode 'ap'
	option ssid 'not the actual guest wlan2'
	option encryption 'sae-mixed'
	option isolate '1'
	option key 'this is not a password'
	option network 'guest'
	option ocv '0'

/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 authoritative '1'
	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 'server'
	option ra 'server'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'
	list dns 'fd28:9f44:261d::be1'
	list dhcp_option '6,192.168.1.214'

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'
	option piofolder '/tmp/odhcpd-piofolder'

config host
	list mac 'E4:5F:01:6E:50:8E'
	option ip '192.168.1.214'

config dhcp 'guest'
	option interface 'guest'
	option start '100'
	option limit '150'
	option leasetime '12h'
	list dhcp_option '6,192.168.1.214'

I don't think I understand.

So, the setup is: ubuntu1 on the lan (192.168.1.xx) wants to connect to ubuntu2 on the guest (192.168.3.xxx).

Are you saying there's configuration needed not only on ubuntu1 but also on ubuntu2?

Ubuntu needs to allow incoming connections in its own firewall....

1 Like

That's taken care of. I can ssh from ubuntu1 to ubuntu2 when they're both on the lan. Only an issue when I move ubuntu2 over to the guest.

Somebody with better eye has to look at it

This rule does nothing (not related to problem at hand)

This may or may not be causing any issues, but it should be resolved...

Since your device is DSA, you should be using a single bridge and bridge-VLANs for splitting the port assignments. In general, DSA hasn't often supported multiple bridges addressing the same switch chip.

It should look like this, instead:

config device
    option name 'br-lan'
    option type 'bridge'
    list ports 'lan1'
    list ports 'lan2'
    list ports 'lan3'
    list ports 'lan4'

config bridge-vlan
    option device 'br-lan'
    option vlan '1'
    list ports 'lan1:u*'
    list ports 'lan2:u*'
    list ports 'lan3:u*'

config bridge-vlan
    option device 'br-lan'
    option vlan '3'
    list ports 'lan4:u*'

Then, you will edit your lan and guest interfaces to use br-lan.1 and br-lan.3 respectively. (you can also remove the DNS line -- it doesn't do anything there):

config interface 'lan'
    option device 'br-lan.1'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ip6assign '60'

...
config interface 'guest'
    option proto 'static'
    option device 'br-lan.3'
    option ipaddr '192.168.3.1'
    option netmask '255.255.255.0'

Don't forget to delete this:

Meanwhile...

Your hosts should not have static routes assigned locally. All of the traffic that is not on the local subnet will go to the router for routing to the correct network. The router itself will take care of all of that.

1 Like

This may or may not be causing any issues, but it should be resolved...

Since your device is DSA, you should be using a single bridge and bridge-VLANs for splitting the port assignments. In general, DSA hasn't often supported multiple bridges addressing the same switch chip.

Thanks and sorry for the delay. I edited the network file and did a /etc/init.d/network restart and in luci I see the lan and guest now show up as "software vlan" on the network -> interfaces screen. Everything seems to work as it did before, so that's good. I wasn't aware of the multiple bridges on the same switch chip thing.

Still getting a ssh timeout when attempting to connect to machines on guest from lan. I can move the target box from ethernet port 4 (guest) over to 3 (lan) and connect without issue.

Utterly stumped on this one. :melting_face:

Let’s review the updated 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 (red circle; this works best in the 'Markdown' composer view in the blue oval):

Screenshot 2025-10-20 at 8.14.14 PM

Remember to redact passwords, VPN keys, MAC addresses and any public IP addresses you may have:

cat /etc/config/network
cat /etc/config/firewall

Thanks for taking a look

ubus call system board

{
	"kernel": "6.6.119",
	"hostname": "OpenWrt",
	"system": "ARMv8 Processor rev 4",
	"model": "Linksys E8450 (UBI)",
	"board_name": "linksys,e8450-ubi",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "24.10.5",
		"revision": "r29087-d9c5716d1d",
		"target": "mediatek/mt7622",
		"description": "OpenWrt 24.10.5 r29087-d9c5716d1d",
		"builddate": "1766005702"
	}
}

/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 'fd28:9f44:261d::/48'
	option packet_steering '1'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

config bridge-vlan
	option device 'br-lan'
	option vlan '1'
	list ports 'lan1:u*'
	list ports 'lan2:u*'
	list ports 'lan3:u*'

config bridge-vlan
	option device 'br-lan'
	option vlan '3'
	list ports 'lan4:u*'

config interface 'lan'
	option device 'br-lan.1'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config interface 'wan'
	option device 'wan'
	option proto 'dhcp'

config interface 'wan6'
	option device 'wan'
	option proto 'dhcpv6'

config interface 'guest'
	option proto 'static'
	option device 'br-lan.3'
	option ipaddr '192.168.3.1'
	option netmask '255.255.255.0'

/etc/config/firewall

config defaults
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option synflood_protect '1'

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

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

config forwarding
	option src 'lan'
	option dest 'wan'

config rule
	option name 'Allow-DHCP-Renew'
	option src 'wan'
	option proto 'udp'
	option dest_port '68'
	option target 'ACCEPT'
	option family 'ipv4'

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'

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'

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'

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'

config zone
	option name 'guest'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	list network 'guest'

config forwarding
	option src 'guest'
	option dest 'wan'

config forwarding
	option src 'lan'
	option dest 'guest'

config rule
	option src 'guest'
	option name 'guest-dns-default'
	option dest_port '53'
	option target 'ACCEPT'

config redirect
	option dest 'lan'
	option target 'DNAT'
	option name 'force-dns-pihole'
	option src 'lan'
	option src_ip '!192.168.1.214'
	option src_dport '53'
	option dest_ip '192.168.1.214'
	option dest_port '53'

config nat
	option name 'dns_pihole_masq'
	list proto 'all'
	option src 'lan'
	option dest_ip '192.168.1.214'
	option target 'MASQUERADE'

config redirect
	option dest 'lan'
	option target 'DNAT'
	option name 'force-guest-pihole'
	option src 'guest'
	option src_dport '53'
	option dest_ip '192.168.1.214'
	option dest_port '53'

config rule
	option src 'guest'
	option dest 'lan'
	option name 'guest-dns-pihole'
	list dest_ip '192.168.1.214'
	option dest_port '53'
	option target 'ACCEPT'

config rule
	option src 'guest'
	option name 'guest-dhcp'
	option dest_port '67'
	option target 'ACCEPT'
	list proto 'udp'

config rule
	option src 'guest'
	option dest 'lan'
	list dest_ip '192.168.1.214'
	option dest_port '445'
	option target 'ACCEPT'
	option name 'guest-to-samba'

config rule
	option src 'guest'
	option dest 'lan'
	list dest_ip '192.168.1.214'
	option dest_port '137-139'
	option target 'ACCEPT'
	option name 'guest-to-samba2'

I don't see any issues with the current config that would block the connections.

Things to look for now:

  1. Make sure that both the source and destination/target machines do not have any VPNs running locally on their systems. If they do, disable them.
  2. The target machine may have a host-level firewall that is blocking inbound connections. Turn off any local firewalls on that device.
  3. Make sure the ssh server itself on the target machine accepts non-local traffic.

I also tried with VPN disconnected. Is there any common firewall config on the target machine that might allow connections when they're both on the same subnet but block them if coming from elsewhere? Off the top of my head I don't think so, but maybe I missed something.

When both machines are on the lan, I can connect with no problem.

I do feel better that at least it isn't a problem with a simple solution I'm overlooking. :wink:

Host level (as in on the actual host machines, not the router) -- yes. The default Windows firewall prohibits incoming connections from non-local subnets. This same principle is sometimes applied to other OS's. If there is a firewall, turn it off.

Make sure you always have the VPN disabled for these connections/tests, as it will almost certainly not work if a VPN is enabled on either or both hosts.

VPN and firewall both on both machines are disabled. Target has an iptables rule for allowing connections from 192.168.0.0/16, but the firewall is disabled for testing.

Run a traceroute in each direction from the source/destination to the other. Repeat with a ping test. We expect the guest > lan to fail, but we want to see the other side succeed, and we want both traceroutes to at least hit the router.

1 Like

Looks like it times out in both directions?

lan (192.168.1.214) to guest (192.168.3.139):

traceroute to 192.168.3.139 (192.168.3.139), 64 hops max
  1   192.168.1.1  0.607ms  0.508ms  0.395ms 
  2   *  *  * 
  3   *  *  * 
  4   *  *  * 
...
 63   *  *  * 
 64   *  *  *

traceroute from 192.168.3.139 back to 192.168.1.214 (and also other machines on the lan) shows similar results:

traceroute to 192.168.1.214 (192.168.1.214), 644 hops max
  1   *  *  * 
  2   *  *  * 
  3   *  *  * 
  4   *  *  * 

(Had to type that one, since I can't ssh into the machine to copy/paste.)

Ping from multiple machines both ways lan / guest all show 100% packet loss:

--- 192.168.3.139 ping statistics ---
12 packets transmitted, 0 received, 100% packet loss, time 11260ms

Okay, wait. I added a clean install (ubuntu on a rpi5) and one of them can connect. Not sure what's going on client-side, but it's got to be a client issue.

traceroute to 192.168.3.167 (192.168.3.167), 64 hops max
  1   192.168.1.1  0.388ms  0.298ms  0.276ms 
  2   192.168.3.167  0.719ms  0.556ms  0.536ms

Okay, so I now have 2 machines on the lan, both with no VPN and firewall disabled. One could connect to guest but the other couldn't. Not sure what was going on there, but it's apparently a client issue. Was easier to nuke and repave with ansible than to figure out what was wrong with the one client.

The troubleshooting help (and updated vlan config) is very appreciated.