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
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):
Remember to redact passwords, VPN keys, MAC addresses and any public IP addresses you may have:
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):
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.
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.
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):
Remember to redact passwords, VPN keys, MAC addresses and any public IP addresses you may have:
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.
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.
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.