Set up the vlan2 on port 4 of the router by changing (or creating) the following NVRAM variables.
vlan0ports="1 2 3 5*"
vlan2hwname=et0
vlan2ports="4 5*"
work_ifname=vlan2
work_proto=static
work_ipaddr=10.0.0.10
work_netmask=255.0.0.0
work_gateway=10.0.0.1
work_dns=10.0.0.1
Add the following line after ifup wifi in /etc/init.d/S40network.
Add the following rules to the '/etc/firewall.user' file to allow vlan2 acces to the internet.
iptables -A forwarding_rule -i vlan2 -o $WAN -j ACCEPT
Note: All the added rules have to be placed after the iptables flush lines (Ex: iptables -t nat -F prerouting_rule) or they will be deleted by the flush lines.
Add the following rules to the '/etc/firewall.user' file to cut vlan2 from the lan.
iptables -A forwarding_rule -i vlan2 -o $LAN -j DROP
iptables -A forwarding_rule -i $LAN -o vlan2 -j DROP
Add the following rules to the '/etc/firewall.user' file to cut vlan2 from the router (except for the dns request).
iptables -A input_rule -i vlan2 -p udp --dport 53 -j ACCEPT
iptables -A input_rule -i vlan2 -p tcp --dport 53 -j ACCEPT
iptables -A input_rule -i vlan2 -j DROP
iptables -A output_rule -o vlan2 -j DROP
Rules for allowing the dns replies into vlan2 are not necessary, because the firewall lets all packets go unhindered once the connection starts.
Now rebooooot... ;)
(Last edited by dominiquefortin on 19 Jun 2008, 05:46)