Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

The goal here is to allow someone to use a computer on vlan2 without having access to the rest of my network.

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

Any ideas?

iptables:

 Chain INPUT (policy ACCEPT)     
 target     prot opt source               destination     
 ACCEPT     0    --  anywhere             anywhere            state RELATED,ESTABLISHED     
 DROP       udp  --  anywhere             anywhere            udp dpt:route     
 DROP       udp  --  anywhere             anywhere            udp dpt:route     
 ACCEPT     udp  --  anywhere             anywhere            udp dpt:route     
 logaccept  tcp  --  anywhere             DD-WRT              tcp dpt:www        
 DROP       icmp --  anywhere             anywhere     
 DROP       igmp --  anywhere             anywhere     
 ACCEPT     0    --  anywhere             anywhere            state NEW     
 logaccept  0    --  anywhere             anywhere            state NEW     
 ACCEPT     0    --  anywhere             anywhere     
 ACCEPT     0    --  anywhere             anywhere     
 ACCEPT     0    --  anywhere             anywhere     
 DROP       0    --  anywhere             anywhere     

 Chain FORWARD (policy ACCEPT)     
 target     prot opt source               destination     
 DROP       0    --  anywhere             anywhere     
 DROP       0    --  anywhere             anywhere     
 DROP       0    --  anywhere             anywhere     
 ACCEPT     gre  --  192.168.1.0/24       anywhere     
 ACCEPT     tcp  --  192.168.1.0/24       anywhere            tcp dpt:1723     
 ACCEPT     0    --  anywhere             anywhere     
 ACCEPT     0    --  anywhere             anywhere     
 ACCEPT     0    --  anywhere             anywhere     
 ACCEPT     0    --  anywhere             anywhere     
 logdrop    0    --  anywhere             anywhere            state INVALID     
 TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN tcpmss match 1461:65535 TCPMSS set 1460     
 lan2wan    0    --  anywhere             anywhere     
 ACCEPT     0    --  anywhere             anywhere            state RELATED,ESTABLISHED     
 ACCEPT     tcp  --  anywhere             192.168.1.98        tcp dpt:www     
 ACCEPT     tcp  --  anywhere             192.168.1.111       tcp dpt:www         
 TRIGGER    0    --  anywhere             anywhere            TRIGGER type:in match:0 relate:0     
 trigger_out  0    --  anywhere             anywhere     
 ACCEPT     0    --  anywhere             anywhere            state NEW     
 DROP       0    --  anywhere             anywhere     

 Chain OUTPUT (policy ACCEPT)     
 target     prot opt source               destination     

 Chain advgrp_1 (0 references)     
 target     prot opt source               destination     

 Chain advgrp_10 (0 references)     
 target     prot opt source               destination     

 Chain advgrp_2 (0 references)     
 target     prot opt source               destination     

 Chain advgrp_3 (0 references)     
 target     prot opt source               destination     

 Chain advgrp_4 (0 references)     
 target     prot opt source               destination     

 Chain advgrp_5 (0 references)     
 target     prot opt source               destination     

 Chain advgrp_6 (0 references)     
 target     prot opt source               destination     

 Chain advgrp_7 (0 references)     
 target     prot opt source               destination     

 Chain advgrp_8 (0 references)     
 target     prot opt source               destination     

 Chain advgrp_9 (0 references)     
 target     prot opt source               destination     

 Chain grp_1 (1 references)     
 target     prot opt source               destination     

 Chain grp_10 (0 references)     
 target     prot opt source               destination     

 Chain grp_2 (0 references)     
 target     prot opt source               destination     

 Chain grp_3 (0 references)     
 target     prot opt source               destination     

 Chain grp_4 (0 references)     
 target     prot opt source               destination     

 Chain grp_5 (0 references)     
 target     prot opt source               destination     

 Chain grp_6 (0 references)     
 target     prot opt source               destination     

 Chain grp_7 (0 references)     
 target     prot opt source               destination     

 Chain grp_8 (0 references)     
 target     prot opt source               destination     

 Chain grp_9 (0 references)     
 target     prot opt source               destination     

 Chain lan2wan (1 references)     
 target     prot opt source               destination     
 grp_1      0    --  anywhere             anywhere     

 Chain logaccept (3 references)     
 target     prot opt source               destination     
 ACCEPT     0    --  anywhere             anywhere     

 Chain logdrop (1 references)     
 target     prot opt source               destination     
 DROP       0    --  anywhere             anywhere     

 Chain logreject (0 references)     
 target     prot opt source               destination     
 REJECT     tcp  --  anywhere             anywhere            tcp reject-with tcp-reset     

 Chain trigger_out (1 references)     
 target     prot opt source               destination     
 root@DD-WRT:~#     
share|improve this question

2 Answers 2

up vote 0 down vote accepted

You can still use the same Port Forwarding app in the GUI. The loopback is broken on DD-WRT v24-sp1 (07/27/08) std. So to test it you will have to hit it from outside your network.

share|improve this answer

You don't forward a single port to a VLAN, you forward it to a specific IP. If you want it broadcast to the entire VLAN for some reason, you can forward it do the broadcast address for VLAN2.

Also, you may want to make sure all your VLANs are using separate subnets. dd-wrt gets a bit strange when it starts looping on itself because it's trying to route between multiple VLANs with the same subnet.

share|improve this answer
    
Right... I need to forward a port to a single IP on vlan2. –  NitroxDM Apr 20 '11 at 15:52
    
So far I haven't had any issues running: vlan2 192.168.50.0/24 vlan3 192.168.100.0/24 vlan4 192.168.200.0/24 –  NitroxDM Apr 20 '11 at 15:55
    
Yep, those are all three separate subnets, so you're ok. –  Hyppy Apr 20 '11 at 16:08

Your Answer

 
discard

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.