Добрый день!
Есть сеть:
магазин-----------------------------------------------------------------------офис---------------------------------------------магазин
192.168.1.17winPc---192.168.1.100(Openwrt)----192.168.1.1(Debian)-----192.168.1.101(Openwrt)---192.168.1.34
OpenWRT - клиенты Openvpn-сервера на Debian.
Настроен ethernet-мост. Естественно, что broadcast-пакеты ходят по всей сети.
Но нужно запретить broadcast'ам проходить из одного магазина в другой.
Пробовал править iptables на 192.168.1.101, но ничего не помогло, выставил фильтр по маку и фильтр по ip - не работают. Каким образом можно решить задачу? Получится ли средствами iptables или может быть можно попробовать использовать vLAN?
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 0 0 ACCEPT tcp -- tap0 * 192.168.5.0/24 0.0.0.0/0 tcp dpt:22 /* ssh from local net accept */
2 244K 91M REJECT all -- eth0.2 * 0.0.0.0/0 0.0.0.0/0 state NEW /* New connect from WAN rejected */ reject-with icmp-port-unreachable
3 217K 59M delegate_input all -- * * 0.0.0.0/0 0.0.0.0/0
Chain [b]**FORWARD**[/b] (policy DROP 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 7 360 delegate_forward all -- * * 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 148K 68M delegate_output all -- * * 0.0.0.0/0 0.0.0.0/0
Chain[b] **delegate_forward**[/b] (1 references)
num pkts bytes target prot opt in out source destination
1 7 360 forwarding_rule all -- * * 0.0.0.0/0 0.0.0.0/0
2 0 0 forwarding_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for forwarding */
3 0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
4 0 0 zone_lan_forward all -- br-lan * 0.0.0.0/0 0.0.0.0/0
5 0 0 zone_wan_forward all -- eth0.2 * 0.0.0.0/0 0.0.0.0/0
6 0 0 zone_wan_forward all -- eth0.2 * 0.0.0.0/0 0.0.0.0/0
7 0 0 reject all -- * * 0.0.0.0/0 0.0.0.0/0
Chain delegate_input (1 references)
num pkts bytes target prot opt in out source destination
1 466 40324 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
2 217K 59M input_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for input */
3 203K 58M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
4 5 300 syn_flood tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x02
5 13770 1140K zone_lan_input all -- br-lan * 0.0.0.0/0 0.0.0.0/0
6 59 7369 zone_wan_input all -- eth0.2 * 0.0.0.0/0 0.0.0.0/0
7 0 0 zone_wan_input all -- eth0.2 * 0.0.0.0/0 0.0.0.0/0
Chain delegate_output (1 references)
num pkts bytes target prot opt in out source destination
1 466 40324 ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0
2 148K 68M output_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for output */
3 142K 68M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
4 5003 312K zone_lan_output all -- * br-lan 0.0.0.0/0 0.0.0.0/0
5 1034 77088 zone_wan_output all -- * eth0.2 0.0.0.0/0 0.0.0.0/0
6 0 0 zone_wan_output all -- * eth0.2 0.0.0.0/0 0.0.0.0/0
Chain forwarding_lan_rule (1 references)
num pkts bytes target prot opt in out source destination
Chain[b] **forwarding_rule**[/b] (2 references)
num pkts bytes target prot opt in out source destination
1 0 0 DROP all -- * * 192.168.5.34 192.168.5.17
2 0 0 DROP all -- * * 192.168.5.17 0.0.0.0/0
3 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 MAC 00:30:67:FB:CA:6E
4 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 MAC 00:1E:FC:A8:05:15
5 0 0 DROP all -- * * 192.168.5.16/29 0.0.0.0/0
6 7 360 ACCEPT tcp -- eth0.2 br-lan 0.0.0.0/0 192.168.5.33 tcp dpt:4899 /* Radmin from WAN forward accept */
7 0 0 ACCEPT tcp -- eth0.2 br-lan 0.0.0.0/0 192.168.5.35 tcp dpt:9780 /* real-time video accept */
8 0 0 ACCEPT tcp -- eth0.2 br-lan 0.0.0.0/0 192.168.5.35 tcp dpt:9779 /* recorded video accept */
9 0 0 ACCEPT all -- br-lan tap0 0.0.0.0/0 0.0.0.0/0
10 0 0 ACCEPT all -- tap0 * 0.0.0.0/0 0.0.0.0/0
Chain forwarding_wan_rule (1 references)
num pkts bytes target prot opt in out source destination
Chain input_lan_rule (1 references)
num pkts bytes target prot opt in out source destination
Chain input_rule (1 references)
num pkts bytes target prot opt in out source destination
Chain input_wan_rule (1 references)
num pkts bytes target prot opt in out source destination
Chain output_lan_rule (1 references)
num pkts bytes target prot opt in out source destination
Chain output_rule (1 references)
num pkts bytes target prot opt in out source destination
Chain output_wan_rule (1 references)
num pkts bytes target prot opt in out source destination
Chain reject (3 references)
num pkts bytes target prot opt in out source destination
1 42 1836 REJECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 reject-with tcp-reset
2 17 5533 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
Chain syn_flood (1 references)
num pkts bytes target prot opt in out source destination
1 5 300 RETURN tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x02 limit: avg 25/sec burst 50
2 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_dest_ACCEPT (1 references)
num pkts bytes target prot opt in out source destination
1 5003 312K ACCEPT all -- * br-lan 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_forward (1 references)
num pkts bytes target prot opt in out source destination
1 0 0 forwarding_lan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for forwarding */
2 0 0 zone_wan_dest_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 /* forwarding lan -> wan */
3 0 0 zone_lan_src_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_input (1 references)
num pkts bytes target prot opt in out source destination
1 13770 1140K input_lan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for input */
2 13770 1140K zone_lan_src_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_output (1 references)
num pkts bytes target prot opt in out source destination
1 5003 312K output_lan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for output */
2 5003 312K zone_lan_dest_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_src_ACCEPT (2 references)
num pkts bytes target prot opt in out source destination
1 13770 1140K ACCEPT all -- br-lan * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_dest_ACCEPT (2 references)
num pkts bytes target prot opt in out source destination
1 1034 77088 ACCEPT all -- * eth0.2 0.0.0.0/0 0.0.0.0/0
2 0 0 ACCEPT all -- * eth0.2 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_forward (2 references)
num pkts bytes target prot opt in out source destination
1 0 0 forwarding_wan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for forwarding */
2 0 0 zone_wan_src_REJECT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_input (2 references)
num pkts bytes target prot opt in out source destination
1 59 7369 input_wan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for input */
2 0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:68 /* Allow-DHCP-Renew */
3 0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmptype 8 /* Allow-Ping */
4 59 7369 zone_wan_src_REJECT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_output (2 references)
num pkts bytes target prot opt in out source destination
1 1034 77088 output_wan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for output */
2 1034 77088 zone_wan_dest_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_src_REJECT (2 references)
num pkts bytes target prot opt in out source destination
1 59 7369 reject all -- eth0.2 * 0.0.0.0/0 0.0.0.0/0
2 0 0 reject all -- eth0.2 * 0.0.0.0/0 0.0.0.0/0