I set up multiple isolated vlans in dd-wrt. Now I need to forward a port to vlan2.

I isolated the vlans using:

iptables -I FORWARD -i br0 -o vlan2 -j DROP
iptables -I FORWARD -i br0 -o vlan3 -j DROP
iptables -I FORWARD -i br0 -o vlan4 -j DROP

Now I need to block a clients on each vlan from accessing the router.

This doesn't work:

iptables -I INPUT -i br0 -o vlan2 --dport telnet -j REJECT --reject-with tcp-reset

I'm new it iptables... am I missing something?

link|improve this question

69% accept rate
feedback

1 Answer

If you want the client to not access the router, you can't use -o. In addition, if you want to use --dport, you must specify the protocol. So, do it like this:

iptables -I INPUT -i br0 -p tcp --dport telnet -j REJECT --reject-with tcp-reset

-o is used only if you want to apply the rule to a packet passing the router.

link|improve this answer
How do I specify vlan2 with out using -0? – NitroxDM May 17 '11 at 15:31
@NitroxDM have you tried iptables -I INPUT -i vlan2 __rest_of_rule__ ? – pepoluan May 18 '11 at 5:19
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.