我在OpenWrt Backfire 10.03上configuration了不同的VLAN,属于fwz2 k2就是其中之一。 在这个testing环境中, WAN是IP地址为192.168.1.1的DHCP:
config 'interface' 'wan' option 'ifname' 'eth0.1' option 'proto' 'dhcp' option 'defaultroute' '0' option 'peerdns' '0' config 'interface' 'k2' option 'proto' 'static' option 'ifname' 'eth0.3' option 'netmask' '255.255.255.0' option 'defaultroute' '0' option 'peerdns' '0' option 'ipaddr' '192.168.172.1' config 'zone' option 'name' 'wan' option 'input' 'REJECT' option 'output' 'ACCEPT' option 'forward' 'REJECT' option 'masq' '1'
如果在防火墙设置中configuration了VLAN
config 'forwarding' #FWD-RULE# option 'src' 'fwz2' option 'dest' 'wan'
NAT工作正常,但是我想只允许select的端口(如ICMP):
config 'rule' #ICMP-RULE# option 'target' 'ACCEPT' option '_name' 'fwz2-ICMP' option 'src' 'fwz2' option 'dest' 'wan' option 'proto' 'icmp'
我想到了一个类似的设置,我删除了#FWD-RULE#并添加了#ICMP-RULE#并且它可以工作,但是如果我在这里这样做了,NAT就不再工作了,并且在WAN接口IP 192.168.172.100 > 213.165.64.75: ICMP echo request ,如果NAT工作,src.addr 192.168.172.100应该被转换成WAN地址。