Hi folks!
I am trying to understand how VLAN filtering is working - therefore i set up a little test environment.
involved hardware:
Router 1: hEXs
Router 2: RB951G (VLAN switch presenting some untagged ports - not yet productive)
cAP: for wifi, managed by cAPsman on Router 1
Logic:
VLAN1: 192.168.1.x, administrative
VLAN2: 192.168.2.x, DMZ, NASes
VLAN3: 192.168.3.x, IOT devices, www but no access to clients or dmz
VLAN4: 192.168.4.x, “hot” zone, isolated and no www
VLAN10: 192.168.10.x, Clients, Tablets, desktops
VLAN100: 192.168.100.x, guests
current setup:
router is a hEXs
firewall is wide open until basic functions are established
mainbridge VLAN filtering = on
eth1: WAN
eth2: VLAN10 untagged → e.g. local Client PC sitting on 192.168.10.7
eth3: VLAN2 untagged → e.g. NAS1 192.168.2.111 and NAS2 192.168.2.112
eth4: trunk tagged
eth5: VLAN10 untagged → cAP for wlans
Working
VLAN filtering
untagged ports are fine
dhcp is working
internet access is ok
NAT is ok
Questions
I can ping and access my 2 NASes (192.168.2.x sitting in VLAN2) from a VLAN10 client (192.168.10.7), but I cannot ping them from each other? (traceroute shows 1 hop and (!H) unreachable.
What am I missing?
Any hint is highly appreciated ![]()
NAS1:
[~] # ifconfig eth0
eth0 Link encap:Ethernet HWaddr 24:5E:BE:0E:81:CA
inet addr:192.168.2.111 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:195372901 errors:0 dropped:0 overruns:0 frame:0
TX packets:148956135 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:253944645608 (236.5 GiB) TX bytes:131403311187 (122.3 GiB)
Memory:fe600000-fe67ffff
[~] # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
ping 1910.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 t un0
10.8.0.2 * 255.255.255.255 UH 0 0 0 tun0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
224.0.0.0 * 240.0.0.0 U 0 0 0 eth0
[~] # ping 192.168.2.112
PING 192.168.2.112 (192.168.2.112): 56 data bytes
^C
--- 192.168.2.112 ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss
NAS2:
root@127.0.0.1:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:14:FD:15:A1:D2
inet addr:192.168.2.112 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::214:fdff:fe15:a1d2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23099 errors:0 dropped:0 overruns:0 frame:0
TX packets:6203 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2902870 (2.7 MiB) TX bytes:2954910 (2.8 MiB)
root@127.0.0.1:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.161.210.2 * 255.255.255.255 UH 0 0 0 tun0
10.161.210.0 10.161.210.2 255.255.255.0 UG 0 0 0 tun0
192.168.2.0 * 255.255.255.0 U 0 0 0 eth1
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
ping 192.168.2.default 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
root@127.0.0.1:~# ping 192.168.2.111
PING 192.168.2.111 (192.168.2.111): 56 data bytes
^C
--- 192.168.2.111 ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss
current config of router 1 / hEXs:
# aug/25/2018 10:16:22 by RouterOS 6.42.7
# software id = SVCD-AT91
#
# model = RB760iGS
# serial number = 87F208623453
/interface bridge
add admin-mac=CC:2D:E0:EF:0E:CF auto-mac=no name=mainbridge vlan-filtering=\
yes
/interface ethernet
set [ find default-name=ether1 ] name=ether1-WAN
set [ find default-name=ether2 ] name=ether2-vlan10-clients
set [ find default-name=ether3 ] name=ether3-vlan2-dmz
set [ find default-name=ether4 ] disabled=yes name=ether4-trunk
set [ find default-name=ether5 ] name=ether5-vlan10-wlan poe-out=forced-on
/interface vlan
add interface=mainbridge name=vlan1 vlan-id=1
add interface=mainbridge name=vlan2 vlan-id=2
add interface=mainbridge name=vlan3 vlan-id=3
add interface=mainbridge name=vlan4 vlan-id=4
add interface=mainbridge name=vlan10 vlan-id=10
add interface=mainbridge name=vlan100 vlan-id=100
/caps-man security
add authentication-types=wpa2-psk encryption=aes-ccm,tkip name=sec_mafia
add authentication-types=wpa2-psk encryption=aes-ccm,tkip name=sec_iot
add authentication-types=wpa2-psk encryption=aes-ccm,tkip name=sec_gast
/caps-man configuration
add channel.band=5ghz-a/n/ac name=cfg-mafia_ac security=sec_mafia ssid=\
Mafia_AC
add channel.band=2ghz-b/g/n name=cfg-mafia_bgn security=sec_mafia ssid=\
Mafia_BGN
add channel.band=2ghz-b/g/n name=cfg-gast security=sec_gast ssid=\
Komm_nackt_und_bring_Bier
add channel.band=2ghz-b/g/n name=cfg-iot security=sec_iot ssid=Mafia_IoT
/caps-man interface
add configuration=cfg-mafia_bgn disabled=no l2mtu=1600 mac-address=\
CC:2D:E0:ED:04:0D master-interface=none name=cap1-mafia_bgn radio-mac=\
CC:2D:E0:ED:04:0D security=sec_mafia
add configuration=cfg-mafia_ac disabled=no l2mtu=1600 mac-address=\
CC:2D:E0:ED:04:0E master-interface=none name=cap2-mafia_ac radio-mac=\
CC:2D:E0:ED:04:0E security=sec_mafia
add configuration=cfg-gast disabled=no mac-address=CE:2D:E0:ED:04:0E \
master-interface=cap1-mafia_bgn name=cap1-gast radio-mac=\
00:00:00:00:00:00 security=sec_gast
add configuration=cfg-iot disabled=no l2mtu=1600 mac-address=\
CE:2D:E0:ED:04:0D master-interface=cap1-mafia_bgn name=cap1-iot \
radio-mac=00:00:00:00:00:00 security=sec_iot
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa2-psk group-ciphers=\
tkip,aes-ccm supplicant-identity=MikroTik unicast-ciphers=tkip,aes-ccm
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip pool
add name=dhcp_pool-vlan1 ranges=192.168.1.2-192.168.1.254
add name=dhcp_pool-vlan10 ranges=192.168.10.2-192.168.10.254
add name=dhcp_pool-vlan2 ranges=192.168.2.2-192.168.2.254
add name=dhcp_pool-vlan3 ranges=192.168.3.2-192.168.3.254
add name=dhcp_pool-vlan4 ranges=192.168.4.2-192.168.4.254
add name=dhcp_pool-vlan100 ranges=192.168.100.2-192.168.100.254
/ip dhcp-server
add address-pool=dhcp_pool-vlan1 disabled=no interface=vlan1 name=dhcp-vlan1
add address-pool=dhcp_pool-vlan10 disabled=no interface=vlan10 name=\
dhcp-vlan10
add address-pool=dhcp_pool-vlan2 disabled=no interface=vlan2 name=dhcp-vlan2
add address-pool=dhcp_pool-vlan3 disabled=no interface=vlan3 name=dhcp-vlan3
add address-pool=dhcp_pool-vlan4 disabled=no interface=vlan4 name=dhcp-vlan4
add address-pool=dhcp_pool-vlan100 disabled=no interface=vlan100 name=\
dhcp-vlan100
/caps-man manager
set ca-certificate=auto certificate=auto enabled=yes
/interface bridge port
add bridge=mainbridge frame-types=admit-only-untagged-and-priority-tagged \
interface=ether2-vlan10-clients pvid=10
add bridge=mainbridge interface=ether4-trunk
add bridge=mainbridge interface=ether5-vlan10-wlan pvid=10
add bridge=mainbridge interface=sfp1
add bridge=mainbridge interface=vlan1
add bridge=mainbridge frame-types=admit-only-vlan-tagged interface=vlan2 \
pvid=2
add bridge=mainbridge frame-types=admit-only-vlan-tagged interface=vlan3 \
pvid=3
add bridge=mainbridge frame-types=admit-only-vlan-tagged interface=vlan4 \
pvid=4
add bridge=mainbridge frame-types=admit-only-vlan-tagged interface=vlan10 \
pvid=10
add bridge=mainbridge frame-types=admit-only-vlan-tagged interface=vlan100 \
pvid=100
add bridge=mainbridge frame-types=admit-only-untagged-and-priority-tagged \
interface=ether3-vlan2-dmz pvid=2
add bridge=mainbridge interface=cap1-gast pvid=100
add bridge=mainbridge interface=cap1-iot pvid=3
add bridge=mainbridge interface=cap1-mafia_bgn pvid=10
add bridge=mainbridge interface=cap2-mafia_ac pvid=10
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface bridge vlan
add bridge=mainbridge tagged=mainbridge,vlan1 untagged=ether4-trunk vlan-ids=\
1
add bridge=mainbridge tagged=mainbridge,vlan2 untagged=ether3-vlan2-dmz \
vlan-ids=2
add bridge=mainbridge tagged=mainbridge,vlan3 untagged=cap1-iot vlan-ids=3
add bridge=mainbridge tagged=mainbridge,vlan4 vlan-ids=4
add bridge=mainbridge tagged=mainbridge,vlan10 untagged=\
ether2-vlan10-clients,ether5-vlan10-wlan,cap1-mafia_bgn,cap2-mafia_ac \
vlan-ids=10
add bridge=mainbridge tagged=mainbridge,vlan100 untagged=cap1-gast vlan-ids=\
100
/interface list member
add comment=defconf interface=mainbridge list=LAN
add comment=defconf interface=ether1-WAN list=WAN
/ip address
add address=192.168.88.1/24 comment=defconf interface=ether2-vlan10-clients \
network=192.168.88.0
add address=192.168.1.1/24 interface=vlan1 network=192.168.1.0
add address=192.168.2.1/24 interface=vlan2 network=192.168.2.0
add address=192.168.3.1/24 interface=vlan3 network=192.168.3.0
add address=192.168.4.1/24 interface=vlan4 network=192.168.4.0
add address=192.168.10.1/24 interface=vlan10 network=192.168.10.0
add address=192.168.100.1/24 interface=vlan100 network=192.168.100.0
/ip dhcp-client
add comment=defconf dhcp-options=hostname,clientid disabled=no interface=\
ether1-WAN
/ip dhcp-server lease
add address=192.168.2.111 mac-address=24:5E:BE:0E:81:CA server=dhcp-vlan2
add address=192.168.10.104 client-id=1:b8:27:eb:66:59:a9 mac-address=\
B8:27:EB:66:59:A9 server=dhcp-vlan10
add address=192.168.2.22 client-id=1:30:cd:a7:11:eb:be mac-address=\
30:CD:A7:11:EB:BE server=dhcp-vlan2
add address=192.168.10.2 client-id=1:cc:2d:e0:ed:4:b mac-address=\
CC:2D:E0:ED:04:0B server=dhcp-vlan10
add address=192.168.10.103 mac-address=B8:27:EB:14:7A:F9 server=dhcp-vlan10
add address=192.168.3.250 mac-address=34:EA:34:42:F6:7D server=dhcp-vlan3
add address=192.168.2.112 mac-address=00:14:FD:15:A1:D2 server=dhcp-vlan2
/ip dhcp-server network
add address=192.168.1.0/24 dns-server=192.168.100.1,8.8.8.8 gateway=\
192.168.1.1
add address=192.168.2.0/24 dns-server=192.168.2.1,8.8.8.8 gateway=192.168.2.1
add address=192.168.3.0/24 dns-server=192.168.3.1,8.8.8.8 gateway=192.168.3.1
add address=192.168.4.0/24 dns-server=192.168.4.1,8.8.8.8 gateway=192.168.4.1
add address=192.168.10.0/24 dns-server=192.168.10.1,8.8.8.8 gateway=\
192.168.10.1
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1
add address=192.168.100.0/24 dns-server=192.168.100.1,8.8.8.8 gateway=\
192.168.100.1
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 name=router.lan
/ip firewall filter
add action=accept chain=input in-interface=all-ethernet
add action=accept chain=forward in-interface=all-ethernet
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
disabled=yes in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
add action=dst-nat chain=dstnat dst-port=8888 in-interface=ether1-WAN \
protocol=tcp to-addresses=192.168.2.111 to-ports=443
add action=dst-nat chain=dstnat dst-port=8082 in-interface=ether1-WAN \
protocol=tcp to-addresses=192.168.10.104 to-ports=8081
add action=dst-nat chain=dstnat dst-port=8083 in-interface=ether1-WAN \
protocol=tcp to-addresses=192.168.10.103 to-ports=8081
add action=dst-nat chain=dstnat dst-port=58050 in-interface=ether1-WAN \
protocol=tcp to-addresses=192.168.2.111 to-ports=58050
add action=dst-nat chain=dstnat dst-port=60022 in-interface=ether1-WAN \
protocol=tcp to-addresses=192.168.2.111 to-ports=22
add action=dst-nat chain=dstnat dst-port=21 in-interface=ether1-WAN protocol=\
tcp to-addresses=192.168.2.111
add action=dst-nat chain=dstnat dst-port=30034-32000,55536-56559 \
in-interface=ether1-WAN protocol=tcp to-addresses=192.168.2.111
add action=dst-nat chain=dstnat dst-port=82,8081 in-interface=ether1-WAN \
protocol=tcp to-addresses=192.168.2.111
add action=dst-nat chain=dstnat dst-port=58051 in-interface=ether1-WAN \
protocol=tcp to-addresses=192.168.2.111 to-ports=58051
/ip service
set telnet disabled=yes
/system clock
set time-zone-name=Europe/Vienna
/system identity
set name=MikroTik_hEXs
/system routerboard settings
# Firmware upgraded successfully, please reboot for changes to take effect!
set silent-boot=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
/tool sniffer
set filter-interface=mainbridge filter-ip-address=192.168.2.112/32