Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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