Firewall rule for one IP to access vlan2vlan

Hello,

openwrt is running like vanilla since a while now - the config is

  • three vlan's (lan, iot, guest)
  • vlan.lan and vlan.iot are going out over a wireguard vpn connection
  • vlan.guest is connected directly with the outer world
  • only vlan.lan can access vlan.iot for admin purposes
  • vlan.iot and vlan.guest are isolated

Now I need a change. I am going to install a UPS with NUT in vlan.lan.
In vlan.lan I have the master and one client.
But I also want to setup one nut client in vlan.iot as well.

Therefore I think I have to allow this nut-client (eg IP 192.168.11.14) in vlan.iot to access vlan.lan as well?
How do I configure openwrt firewall for this?

Just in case - here is my firewall config


config defaults
	option input 'REJECT'
	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 'ACCEPT'

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

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 'wgzone'
	option input 'DROP'
	option output 'ACCEPT'
	option forward 'DROP'
	list network 'wginterface'
	option masq '1'

config forwarding
	option src 'lan'
	option dest 'wgzone'

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

config zone
	option name 'iot'
	option input 'DROP'
	option output 'ACCEPT'
	option forward 'DROP'
	list network 'iot'

config forwarding
	option src 'lan'
	option dest 'iot'

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

config forwarding
	option src 'iot'
	option dest 'wgzone'

config rule
	option name 'Guest-DHCP'
	option src 'guest'
	option dest_port '67 68'
	option target 'ACCEPT'

config rule
	option name 'IoT-DHCP'
	option src 'iot'
	option dest_port '67 68'
	option target 'ACCEPT'

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

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

Nut defaults to 3493/tcp, but nut to ups you need to know specific protocol used like snmp trap etc and open individual ports via firewall rules.

yes, I have not changed the default of 3493/tcp. The nut master is 192.168.33.10 and the nut client is 192.168.11.14.
Where I do have my issues now, is to setup the correct openwrt firewall rule that the new nut client can get access to the nut master...

Like this

thank you - worked out of the box, the new client confirmed contact to the master!

1 Like

Admit wiki needs picturesque walkthroughs for simpler starter tasks....

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