Guest network can see private subnet

I'm trying to set up a test guest wifi network on Openwrt 18.06.2. 192.168.0.1 is a virgin media router connected to the internet 192.168.2.1 is Openwrt 18.06.2 connected to 192.168.0.1 with a subnet of 192.168.2.1. I have set up a guest network 192.168.4.1 on 192.168.2.1 which has internet connection. The problem is that 192.168.4.1 can ping 192.168.0.1 which is not the point of a guest network.
I followed https://openwrt.org/docs/guide-user/network/wifi/guestwifi/guest-wlan-webinterface and http://www.askmeaboutlinux.com/?p=3231 which are basically the same with some firewall differences. Is this a firewall problem? I have pasted etc/config/firewall below.
Thanks for any help

`config defaults
	option syn_flood '1'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'REJECT'

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

config zone
	option name 'wan'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option masq '1'
	option mtu_fix '1'
	option network 'wan 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 src_ip 'fc00::/6'
	option dest_ip 'fc00::/6'
	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 include
	option path '/etc/firewall.user'

config zone
	option name 'Guestat8'
	option forward 'REJECT'
	option output 'ACCEPT'
	option network 'Guestat8'
	option input 'REJECT'

config forwarding
	option dest 'wan'
	option src 'Guestat8'

config rule
	option target 'ACCEPT'
	option proto 'tcp udp'
	option dest_port '53'
	option name 'Guestsid-DNS'
	option src 'Guestat8'

config rule
	option enabled '1'
	option target 'ACCEPT'
	option proto 'udp'
	option dest_port '67-68'
	option name 'Guestsid-DHCP'
	option src 'Guestat8'
`

Take a look here.

From the point of view of the OpenWrt router, the 192.168.0 network is on the WAN side, and thus indistinguishable from any other internet server, that are accessible from your guest network.

You need to add a specific rule to block traffic coming from the guess network and directed to the 192.168.0 network.

1 Like

I’m a novice. What would such a rule look like?

This network is on WAN, you allow traffic from Guestat8 to WAN. This is why you can still ping.

They should look like your rules above. If you mean specifically:

# in /etc/config/network

config rule                   
	option name 'Drop_Guest_to_WAN'
	option family 'any'
	option proto 'all'
	option src 'Guestat8'
	# option dest_ip '192.168.0.0/24'
	option dest 'wan'
	option target 'DROP'

Also see: https://openwrt.org/docs/guide-user/firewall/firewall_configuration

1 Like