How to block VLAN from accessing ISP modem/router

I have managed to block my VLAN20 devices to access LAN network. This works.
But I just noticed that my ISP's router/modem which is in passthru mode is accessible by my VLAN devices.
How do I block that?

OpenWRT router:
LAN : 192.168.4.0/24
VLAN20: 10.0.20.0/24

ISP Modemin passthru: 192.168.1.254

package firewall

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

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

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'

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 network 'VLAN20'
	option forward 'REJECT'
	option name 'VLAN20'
	option output 'ACCEPT'
	option input 'REJECT'

config forwarding
	option dest 'wan'
	option src 'VLAN20'

config forwarding
	option dest 'VLAN20'
	option src 'lan'

config redirect
	option dest_port '51820'
	option src 'wan'
	option name 'Wireguard-VPN'
	option src_dport '51820'
	option target 'DNAT'
	option dest_ip '192.168.4.8'
	option dest 'lan'
	list proto 'udp'

config rule
	option dest_port '53'
	option src 'VLAN20'
	option name 'VLAN20-DNS'
	option target 'ACCEPT'

config rule
	option src 'VLAN20'
	option name 'VLAN20-DHCP'
	option target 'ACCEPT'
	list proto 'udp'
	option src_port '68'
	option dest_port '67'

Make a rule to drop from vlan20 to wan ip of the modem.

1 Like

That much I understood but did not wanna bring down the network.
Can you give me an example of the rules I need to create?

Go to the firewall page, add a new rule, for source zone use lan, destination zone is wan, all protocols, and destination IP the one of the modem. Save, apply, and you are ready.

3 Likes

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