Guest network on a subnet

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
vinibudd
DD-WRT Novice


Joined: 28 Mar 2019
Posts: 26

PostPosted: Tue May 21, 2019 12:05    Post subject: Guest network on a subnet Reply with quote
Hi, I've done an advanced static routing and I'm trying to create a GUEST NET with a different subnet, the network connects but there's no internet

My main router 192.168.1.4



[/img][/b]

My second router 192.168.3.1





[/img]
Sponsor
ian5142
DD-WRT Guru


Joined: 23 Oct 2013
Posts: 2319
Location: Canada

PostPosted: Tue May 21, 2019 12:51    Post subject: Guest wifi Reply with quote
Guest Wifi is here: https://wiki.dd-wrt.com/wiki/index.php/Guest_WiFi_%2B_abuse_control_for_beginners

As for Guest LAN, I would use double NAT for this (one router behind another router), both in Gateway mode, not router mode.

_________________
Before asking a question on the forums, update dd-wrt: Where do I download firmware? I suggest reading it all.
QCA Best WiFi Settings


Some dd-wrt wiki pages are up to date, others are not. PM me if you find an old one.

Atheros:
Netgear R7800 x3 - WDS AP / station, gateway, QoS
TP-Link Archer C7 v2 x2 - WDS Station
TP-Link TL-WDR3600 v1 - WDS Station
TP-Link 841nd v8 - NU
D-Link 615 C1/E3/I1 x 7 - 1 WDS station
D-Link 825 B1 - NU
D-Link 862L A1 x2 - WDS Station
Netgear WNDR3700v2 - NU
UBNT loco M2 x2 - airOS

Broadcom
Linksys EA6400 - Gateway, QoS
Asus N66U - AP
Netgear WNDR3700v3 - not used
MediaTek
UBNT EdgeRouter X - switch
Per Yngve Berg
DD-WRT Guru


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

PostPosted: Tue May 21, 2019 18:03    Post subject: Reply with quote
I see two networks in the screenshot:

192.168.10.0
192.168.3.0

Only the last one is entered into the routing table.

Use masquerade for the NAT:

iptables -t nat -A POSTROUTING -o `get_wanface` -j MASQUERADE

Can you ping the primary router from a client on the guest network on the secondary router?
vinibudd
DD-WRT Novice


Joined: 28 Mar 2019
Posts: 26

PostPosted: Tue May 21, 2019 20:06    Post subject: Reply with quote
Per Yngve Berg wrote:
I see two networks in the screenshot:

192.168.10.0
192.168.3.0

Only the last one is entered into the routing table.

Use masquerade for the NAT:

iptables -t nat -A POSTROUTING -o `get_wanface` -j MASQUERADE

Can you ping the primary router from a client on the guest network on the secondary router?



Failed to get IP address

This is the message that comes back to me. Insert the iptables code on my second router, but it still does not connect
vinibudd
DD-WRT Novice


Joined: 28 Mar 2019
Posts: 26

PostPosted: Tue May 21, 2019 20:10    Post subject: Reply with quote
When I connect to my main network (router) 192.168.1.4 I can not see my second router 192.168.3.1. Now when I connect to the second router 192.168.3.1, I can see my main router. Was it a bug?
Per Yngve Berg
DD-WRT Guru


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

PostPosted: Tue May 21, 2019 20:16    Post subject: Reply with quote
The NAT command must be run on the main router.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12915
Location: Netherlands

PostPosted: Wed May 22, 2019 9:17    Post subject: Reply with quote
As far as I understand, you have daisy chained the routers i.e. connected LAN<>WAN

There is always access from downstream (secondary router) to upstream (primary router) but not the other way around.

To get access from upstream to downstream you have to do 2 things:
1. Set a static route (like you did)
2. Punch a hole in the firewall of the secondary router
As DDWRT relies for a lot of things that the router is in gateway mode I would just leave the secondary router in gateway mode and add the following firewall rules to the secondary router:
Code:
iptables -I INPUT -s 192.168.1.0/24 -j ACCEPT
iptables -I FORWARD -s 192.168.1.0/24 -j ACCEPT


Instead of gateway mode you can set the secondary router in router mode, in that case you do not have a firewall so you do not have to use the firewall rules but instead have to NAT the traffic out of the primary router by adding the NAT rule according to Per Yngve's post. But as said I would not recommend that (when routers were very old and slow, router mode had a speed advantage, but for modern routers that is not a concern especially with SFE available)

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
vinibudd
DD-WRT Novice


Joined: 28 Mar 2019
Posts: 26

PostPosted: Wed May 22, 2019 11:24    Post subject: Reply with quote
I went back to the default second router 192.168.3.1. I removed the ADVANCED ROUTING entry on my main router 192.168.1.4. Now my main router QoS no longer responds with the IP of RANGE 192.168.3.0/24 only with the gateway, is there any way for my router to re-respond in my QoS with 192.168.3.0/24?
Display posts from previous:    Page 1 of 1
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