I want to configure 3 SSID with a nat

I need to configure a nat with 3 SSID and every SSID has it's own VLAN.

SSID :

  1. private (works on VLAN 110)
  2. public (works on VLAN 111)
  3. lan (works on VLAN 1)

And for the nat i have configured it on vlan 2 and i want only the lan who can access to the nat.
The problem is that i can ping the interface of the public and private network from the lan network.

This is my network config (uci show network) :

network.loopback=interface
network.loopback.ifname='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='fdca:6d3f:b97::/48'
network.lan_dev=device
network.lan_dev.name='eth0.1'
network.wan_dev=device
network.wan_dev.name='eth0.2'
network.@switch[0]=switch
network.@switch[0].name='switch0'
network.@switch[0].reset='1'
network.@switch[0].enable_vlan='1'
network.vlanLan=switch_vlan
network.vlanLan.device='switch0'
network.vlanLan.vlan='1'
network.vlanLan.vid='1'
network.vlanLan.ports='0 1 2 3 6t'
network.lan=interface
network.lan.type='bridge'
network.lan.proto='static'
network.lan.ipaddr='192.168.10.30'
network.lan.netmask='255.255.255.0'
network.lan.ifname='eth0.1 rai0 ra0'
network.lan.gateway='192.168.10.30'
network.lan.dns='8.8.8.8'
network.vlanWan=switch_vlan
network.vlanWan.device='switch0'
network.vlanWan.vlan='2'
network.vlanWan.vid='2'
network.vlanWan.ports='4 6t'
network.wan=interface
network.wan.type='bridge'
network.wan.ifname='eth0.2'
network.wan.proto='static'
network.wan.netmask='255.255.255.0'
network.wan.ipaddr='192.168.100.16'
network.vlan111=switch_vlan
network.vlan111.device='switch0'
network.vlan111.vlan='111'
network.vlan111.vid='111'
network.vlan111.ports='0t 1t 2t 3t 4t 6t'
network.brvlan111=interface
network.brvlan111.type='bridge'
network.brvlan111.proto='static'
network.brvlan111.ifname='eth0.111 rai1 ra2'
network.brvlan111.ipaddr='192.168.111.30'
network.brvlan111.netmask='255.255.255.0'
network.vlan110=switch_vlan
network.vlan110.device='switch0'
network.vlan110.vlan='110'
network.vlan110.vid='110'
network.vlan110.ports='0t 1t 2t 3t 4t 6t'
network.brvlan110=interface
network.brvlan110.type='bridge'
network.brvlan110.proto='static'
network.brvlan110.ifname='eth0.110 rai2 ra1'
network.brvlan110.ipaddr='192.168.110.30'
network.brvlan110.netmask='255.255.255.0'

and this is my firewall config (uci show firewall) :

firewall.@defaults[0]=defaults
mailto:firewall.@defaults[0].syn_flood='1'
mailto:firewall.@defaults[0].input='ACCEPT'
mailto:firewall.@defaults[0].output='ACCEPT'
mailto:firewall.@defaults[0].forward='REJECT'
firewall.@zone[0]=zone
mailto:firewall.@zone[0].name='lan'
mailto:firewall.@zone[0].network='lan'
mailto:firewall.@zone[0].input='ACCEPT'
mailto:firewall.@zone[0].output='ACCEPT'
mailto:firewall.@zone[0].forward='ACCEPT'
firewall.@zone[1]=zone
mailto:firewall.@zone[1].name='wan'
mailto:firewall.@zone[1].network='wan' 'wan6'
mailto:firewall.@zone[1].input='REJECT'
mailto:firewall.@zone[1].output='ACCEPT'
mailto:firewall.@zone[1].forward='REJECT'
mailto:firewall.@zone[1].masq='1'
mailto:firewall.@zone[1].mtu_fix='1'
firewall.@forwarding[0]=forwarding
mailto:firewall.@forwarding[0].src='lan'
mailto:firewall.@forwarding[0].dest='wan'
firewall.@rule[0]=rule
mailto:firewall.@rule[0].name='Allow-DHCP-Renew'
mailto:firewall.@rule[0].src='wan'
mailto:firewall.@rule[0].proto='udp'
mailto:firewall.@rule[0].dest_port='68'
mailto:firewall.@rule[0].target='ACCEPT'
mailto:firewall.@rule[0].family='ipv4'
firewall.@rule[1]=rule
mailto:firewall.@rule[1].name='Allow-Ping'
mailto:firewall.@rule[1].src='wan'
mailto:firewall.@rule[1].proto='icmp'
mailto:firewall.@rule[1].icmp_type='echo-request'
mailto:firewall.@rule[1].family='ipv4'
mailto:firewall.@rule[1].target='ACCEPT'
firewall.@rule[2]=rule
mailto:firewall.@rule[2].name='Allow-IGMP'
mailto:firewall.@rule[2].src='wan'
mailto:firewall.@rule[2].proto='igmp'
mailto:firewall.@rule[2].family='ipv4'
mailto:firewall.@rule[2].target='ACCEPT'
firewall.@rule[3]=rule
mailto:firewall.@rule[3].name='Allow-DHCPv6'
mailto:firewall.@rule[3].src='wan'
mailto:firewall.@rule[3].proto='udp'
mailto:firewall.@rule[3].src_ip='fc00::/6'
mailto:firewall.@rule[3].dest_ip='fc00::/6'
mailto:firewall.@rule[3].dest_port='546'
mailto:firewall.@rule[3].family='ipv6'
mailto:firewall.@rule[3].target='ACCEPT'
firewall.@rule[4]=rule
mailto:firewall.@rule[4].name='Allow-MLD'
mailto:firewall.@rule[4].src='wan'
mailto:firewall.@rule[4].proto='icmp'
mailto:firewall.@rule[4].src_ip='fe80::/10'
mailto:firewall.@rule[4].icmp_type='130/0' '131/0' '132/0' '143/0'
mailto:firewall.@rule[4].family='ipv6'
mailto:firewall.@rule[4].target='ACCEPT'
firewall.@rule[5]=rule
mailto:firewall.@rule[5].name='Allow-ICMPv6-Input'
mailto:firewall.@rule[5].src='wan'
mailto:firewall.@rule[5].proto='icmp'
mailto:firewall.@rule[5].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type' 'router-solicitation' 'neighbour-solicitation' 'router-advertisement' 'neighbour-advertisement'
mailto:firewall.@rule[5].limit='1000/sec'
mailto:firewall.@rule[5].family='ipv6'
mailto:firewall.@rule[5].target='ACCEPT'
firewall.@rule[6]=rule
mailto:firewall.@rule[6].name='Allow-ICMPv6-Forward'
mailto:firewall.@rule[6].src='wan'
mailto:firewall.@rule[6].dest='*'
mailto:firewall.@rule[6].proto='icmp'
mailto:firewall.@rule[6].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type'
mailto:firewall.@rule[6].limit='1000/sec'
mailto:firewall.@rule[6].family='ipv6'
mailto:firewall.@rule[6].target='ACCEPT'
firewall.@rule[7]=rule
mailto:firewall.@rule[7].name='Allow-IPSec-ESP'
mailto:firewall.@rule[7].src='wan'
mailto:firewall.@rule[7].dest='lan'
mailto:firewall.@rule[7].proto='esp'
mailto:firewall.@rule[7].target='ACCEPT'
firewall.@rule[8]=rule
mailto:firewall.@rule[8].name='Allow-ISAKMP'
mailto:firewall.@rule[8].src='wan'
mailto:firewall.@rule[8].dest='lan'
mailto:firewall.@rule[8].dest_port='500'
mailto:firewall.@rule[8].proto='udp'
mailto:firewall.@rule[8].target='ACCEPT'
firewall.@include[0]=include
mailto:firewall.@include[0].path='/etc/firewall.user'

I'm waiting for any advice.

This is normal behaviour. All the interfaces of the OpenWrt are considered as INPUT traffic, which is allowed. This means that from a host in the lan you can connect to OpenWrt on any of the IPs of its interfaces, i.e lan, wan. On a sidenote, you don't have configured the brvlan110 and brvlan111 interfaces in firewall, so they will be treated with default settings and no forwardings.

2 Likes

Thank you so much, your answer helped me a lot.

1 Like

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