isolate one vlan from another

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
mwimpelb
DD-WRT Novice


Joined: 24 Aug 2019
Posts: 2

PostPosted: Sat Aug 24, 2019 16:52    Post subject: isolate one vlan from another Reply with quote
My goal here is to have one device on my network that can only access the internet and nothing else on my LAN. My approach to this was to create a separate VLAN, assign it a subnet and DHCP range and then write some iptables rules to prevent communication from that subnet to the other subnet. I'm not sure how within one device the gateways work though, would the default gateway of 192.168.5.1 for the new VLAN5 still route to the internet, or does the gateway still have to be 192.168.1.1?

I saw this guide, but the iptables commands specify vlan+ which would be layer2.

Code:
iptables -I FORWARD -i vlan+ -o vlan+ -j DROP
iptables -I FORWARD -i vlan+ -o vlan1 -j ACCEPT
iptables -I FORWARD -i vlan1 -o vlan+ -j ACCEPT


https://wiki.dd-wrt.com/wiki/index.php/VLAN_Detached_Networks_%28Separate_Networks_With_Internet%29

Am I on the right track or is there a better way to do this?
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6870
Location: Romerike, Norway

PostPosted: Sat Aug 24, 2019 17:11    Post subject: Reply with quote
You are on the right track here if the device is wired to the router with a cable.

The client's gateway shall be the router's address on the interface the device is connected to. Traffic between the VLANs are done through L2 routing.

PS. VLAN is very chip-set dependant (Broadcom, Atheros, Marvell etc.). See the corresponding forums on how to do this.
mwimpelb
DD-WRT Novice


Joined: 24 Aug 2019
Posts: 2

PostPosted: Mon Sep 02, 2019 17:14    Post subject: Reply with quote
I was able to get this working with the attached screenshots.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum