R7800 and VLANS

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
Per Yngve Berg
DD-WRT Guru


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

PostPosted: Sun Mar 10, 2019 9:28    Post subject: Reply with quote
Almost correct.

Physical port1 = switch port4,
Physical port2 = switch port3,
Physical port3 = switch port2,
Physical port4 = switch port1.
Note that the processor port is switch port6 (eth0), and switch port5 is the secondary processor port (eth1).

WAN = switch port0

By distributing over both port6 and port5, you get better performance as traffic is split over two gigabit ports instead of sharing one.
Sponsor
Trossy
DD-WRT Novice


Joined: 10 Mar 2019
Posts: 13

PostPosted: Sun Mar 10, 2019 9:57    Post subject: Reply with quote
Thanks Per Yngve Berg

I decided to read the dd-wrt documentation on "Switched Ports" since posting.

The "t", "u" stands for tagged and untagged. Still very confusing gathering up all this information and putting it to use but know I at least have much more to work with.
Trossy
DD-WRT Novice


Joined: 10 Mar 2019
Posts: 13

PostPosted: Sun Mar 10, 2019 10:22    Post subject: Reply with quote
Per Yngve Berg wrote:
Almost correct.

Physical port1 = switch port4,
Physical port2 = switch port3,
Physical port3 = switch port2,
Physical port4 = switch port1.
Note that the processor port is switch port6 (eth0), and switch port5 is the secondary processor port (eth1).

WAN = switch port0

By distributing over both port6 and port5, you get better performance as traffic is split over two gigabit ports instead of sharing one.


This is my config I am about to test out.

swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports "4 6"
swconfig dev switch0 vlan 4 set ports "3 6t"
###Why do we tag the switch port 6 processor port here?
swconfig dev switch0 set apply
vconfig add eth1 4
ifconfig eth1.4 192.168.4.1 netmask 255.255.255.0
Per Yngve Berg
DD-WRT Guru


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

PostPosted: Sun Mar 10, 2019 10:39    Post subject: Reply with quote
The port is tagged so the processor can see it on eth1.4 separated from VLAN1 (eth1).
Trossy
DD-WRT Novice


Joined: 10 Mar 2019
Posts: 13

PostPosted: Sun Mar 10, 2019 10:56    Post subject: Reply with quote
Per Yngve Berg wrote:
The port is tagged so the processor can see it on eth1.4 separated from VLAN1 (eth1).


I have my VLANS working didn't think I would get it working this morning.

Got another question for you if you don't mind.

I use OpenVPN Client through the router and it currently enables vpn on all VLANS and subnets.
How would you configure each VLAN or subnet individually to use or Not use the VPN?

*** EDIT**
I found what the answers is, it's policy based routing.
https://wiki.dd-wrt.com/wiki/index.php/Policy_Based_Routing

Thanks Per Yngve Berg for replying right off the bat this morning thought I wasn't going to get a reply for days.
Per Yngve Berg
DD-WRT Guru


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

PostPosted: Sun Mar 10, 2019 12:02    Post subject: Reply with quote
Don't use that wiki page, use the PBR field in the OpenVPN setup. Remember to disable SFE and don't include the router's own address in PBR.

See the Advanced Networking Forum for VPN issues.
ait109
DD-WRT Novice


Joined: 08 Feb 2008
Posts: 4

PostPosted: Wed Jun 12, 2019 18:57    Post subject: Working R7500v2 setup Reply with quote
First I want to say that this discussion has been super helpful for me in getting this working on my R7500v2 and I want to share my findings for future users.

I'm running r37495M and it has no "VLAN" tab in the menu.

My goal was to have a separate WWAN along with a single LAN port that was isolated from my regular home computing network. I used the UI to create a virtual WWAN, and added it to a new bridge (br2). Also using the UI, I added another DHCP range for br2. I then added the following startup commands:

swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports "2 3 4 6"
swconfig dev switch0 vlan 4 set ports "1 6t"
swconfig dev switch0 set apply
vconfig add eth1 4
brctl addif br2 eth1.4


This successfully allowed me to have a new WWAN along with port # 4 (as physically numbered on the switch) on a separate network with internet access.

My final hurdle was trying to get the configuration to work after a reboot. WWAN worked, but I was getting no DHCP on the ethernet port. After some experimentation (mostly around restarting dnsmasq that didn't help), adding the following two commands to the end of the startup solved my problem:

ifconfig eth1.4 down
ifconfig eth1.4 up


Hope this helps someone.
student13
DD-WRT User


Joined: 17 Nov 2016
Posts: 95

PostPosted: Sat Dec 05, 2020 19:32    Post subject: nighthawk x4s isolated ethernet vlans. Reply with quote
Hello I have a nighthawk x4s, and I want to isolate all ethernet ports such that they can only access the internet and not see other ethernet or wifi devices on my network. Here are my nighthawk X4S (r7800) settings. Can someone tell me what is wrong with my settings.

Thanks.


startup>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports "6"
swconfig dev switch0 vlan 3 set ports "1 6t"
swconfig dev switch0 vlan 4 set ports "2 6t"
swconfig dev switch0 vlan 5 set ports "3 6t"
swconfig dev switch0 vlan 6 set ports "4 6t"
swconfig dev switch0 set apply
vconfig add eth1 3
ifconfig eth1.3 192.168.10.1 netmask 255.255.255.0
vconfig add eth1 4
ifconfig eth1.4 192.168.20.1 netmask 255.255.255.0
vconfig add eth1 5
ifconfig eth1.5 192.168.30.1 netmask 255.255.255.0
vconfig add eth1 6
ifconfig eth1.6 192.168.40.1 netmask 255.255.255.0


Firewall >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.

iptables -I FORWARD -i eth1.4 -o eth1.3 -m state --state NEW -j REJECT
iptables -I FORWARD -i eth1.5 -o eth1.3 -m state --state NEW -j REJECT
iptables -I FORWARD -i eth1.6 -o eth1.3 -m state --state NEW -j REJECT
iptables -I FORWARD -i eth1.6 -o eth1.4 -m state --state NEW -j REJECT
iptables -I FORWARD -i eth1.5 -o eth1.4 -m state --state NEW -j REJECT
iptables -I FORWARD -i eth1.6 -o eth1.5 -m state --state NEW -j REJECT
iptables -I FORWARD -i eth1.4 -o eth1.5 -m state --state NEW -j REJECT
iptables -I FORWARD -i eth1.4 -o eth1.6 -m state --state NEW -j REJECT
iptables -I FORWARD -i eth1.5 -o eth1.6 -m state --state NEW -j REJECT
iptables -I INPUT -i ath1.1 -d 192.168.2.1 -j DROP
iptables -I INPUT -i eth1.4 -d 192.168.2.1 -j DROP
iptables -I INPUT -i eth1.5 -d 192.168.2.1 -j DROP
iptables -I INPUT -i eth1.6 -d 192.168.2.1 -j DROP
student13
DD-WRT User


Joined: 17 Nov 2016
Posts: 95

PostPosted: Sat Dec 05, 2020 20:08    Post subject: Reply with quote
Here are som pictures of my settings

EDITED BY MODERATOR- YOU WERE ASKED TO CHANGE THE PICTURE SIZE AND DIDN'T. PICTURES REMOVED. POST AGAIN AT 768 PIXELS WIDE.
student13
DD-WRT User


Joined: 17 Nov 2016
Posts: 95

PostPosted: Sat Dec 05, 2020 20:12    Post subject: Reply with quote
more pics

EDITED BY MODERATOR- YOU WERE ASKED TO CHANGE THE PICTURE SIZE AND DIDN'T. PICTURES REMOVED. POST AGAIN AT 768 PIXELS WIDE.
Per Yngve Berg
DD-WRT Guru


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

PostPosted: Sat Dec 05, 2020 20:38    Post subject: Reply with quote
I don't see any rules targeting br0 and ath1.1
student13
DD-WRT User


Joined: 17 Nov 2016
Posts: 95

PostPosted: Sun Dec 06, 2020 0:05    Post subject: Reply with quote
Hi Per,

My wireless setup is as such


ath0=main 5 GHz
ath1= main2.4 GHz
ath1.1=vap #1 on 2.4 GHz
ath1.2=vap #2 on 2.4 GHz

What rules do I have to add so that basically any Ethernet connected device won't see wifi connected devices?

Thanks.


Could this be a good example of what I have to enter:

iptables -I FORWARD -i eth1.4 -o ath1 -m state --state NEW -j REJECT ?

iptables -I FORWARD -i eth1.4 -o ath1.1 -m state --state NEW -j REJECT

iptables -I FORWARD -i eth1.4 -o ath1.2 -m state --state NEW -j REJECT
Per Yngve Berg
DD-WRT Guru


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

PostPosted: Sun Dec 06, 2020 17:55    Post subject: Reply with quote
ath1 is bridged, so you have to use the bridge br0 on yhe rule.
foz111
DD-WRT Guru


Joined: 01 Oct 2017
Posts: 705
Location: Earth

PostPosted: Mon Dec 07, 2020 20:47    Post subject: Reply with quote
What config and firewall would i require for 1 single vlan on R7800 (I am a complete vlan beginner)
My aim is to isolate Ethernet IoT devices. Hive tv's etc
My wireless is disabled on router, i use a mesh system that has isolated guest network already for wireless IoT
Thanks for any assistance in advance
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6435
Location: UK, London, just across the river..

PostPosted: Tue Dec 08, 2020 14:13    Post subject: Reply with quote
foz111 wrote:
What config and firewall would i require for 1 single vlan on R7800 (I am a complete vlan beginner)
My aim is to isolate Ethernet IoT devices. Hive tv's etc
My wireless is disabled on router, i use a mesh system that has isolated guest network already for wireless IoT
Thanks for any assistance in advance


yep that's what i do, i have an isolated VLAN with a managed switch and a small TP-link router into that switch so all untrusted devices are in the switch or using that Tp-Link Wi-Fi ( NAT or you can use as a WAP)...

im away of my R7800, but based on this thread config should be looking like that, you can test and adjust it to your case, if its not working...have a good read in the begging of this thread...lets hope someone else will jump in to shred some light too...

start up script

swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports "1 2 3 6"
swconfig dev switch0 vlan 3 set ports "4 6t"
swconfig dev switch0 set apply
vconfig add eth1 3
brctl addif br1 eth1.3
ifconfig eth1.3 192.168.10.1 netmask 255.255.255.0

"I guess Vlan 2 is your default WAN"
and br0 is the main wifi + lan

Copy text below and paste into the 'Administration/Commands' Command Shell window of GUI save Firewall

iptables -t nat -A POSTROUTING -s 192.168.10.1/24 -o $(get_wanface) -j MASQUERADE

create br1
you ve to add DHCP server to Vlan3 aka br1

also add those 2 to firewall
iptables -I FORWARD -i br1 -o br0 -m state --state NEW -j REJECT
iptables -I FORWARD -i br0 -o br1 -m state --state NEW -j REJECT

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55779 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913


Last edited by Alozaros on Sat Jan 16, 2021 18:37; edited 1 time in total
Goto page Previous  1, 2, 3, 4, 5, 6  Next Display posts from previous:    Page 3 of 6
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware 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