2 routers on the same network.

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


Joined: 04 Jun 2013
Posts: 3

PostPosted: Tue Jun 04, 2013 20:30    Post subject: 2 routers on the same network. Reply with quote
I'm not sure if this is the right place to post this, if I'm wrong, please move it to where it should be posted. Also my english is not that good.

I have a network with fewer than 20 machines. This network is conected trough a simple switch. A wireless router (linksys WAG120N) which doesn't support dd-wrt, this router is conected trough an ADSL conection. Additionaly I have a second router (which is not attached to the network) that is conected to a WISP.

I have a NAS attached to the main network, this NAS is used mainly for file sharing and backup.

I want to connect the second router the main network, so anyone, regardless of the internet connection they are using they can access the NAS services.

I've set up both networks the following way.

Code:
Router nº 1

IP. 192.168.1.1
SN. 255.255.255.0

Computer connected to it gets the following DHCP.

IP. 192.168.1.100~150
SN. 255.255.255.0
GW. 192.168.1.1
DNS. 208.67.222.123, 208.67.220.123

Router nº 2

IP. 192.168.1.2
SN. 255.255.255.0

Computer connected to it gets the following DHCP.

IP. 192.168.1.151~200
SN. 255.255.255.0
SN. 192.168.1.2
DNS. 208.67.222.123, 208.67.220.123

The NAS is assigned to the 192.168.1.10 IP.


Both works like a charm, unless I connect them simultaneously.

Anything goes fine if I connect only one of the routers, but if I connect both simultaneously computers gets DHCP only from the router nº 1, regardless of which wireless router they are connected.

I'd like to have the connections this way.

Stations connected through ethernet cable gets DHCP from router nº 1.
Stations connected through wireless on router nº 1 gets DHCP from router nº 1.
Stations connected through wireless on router nº 2 gets DHCP from router nº 2.

Notes.

1. If I set up the IP manualy (obviously) they work.
2. When both routers are connected, stations connected through router nº2 are getting DHCP from router nº 1, they should get it from router nº 2.
3. NAS doesn't need internet connection.
4. I have 2 types of internet connection due to some issues.
a. ADSL connection is slow, but stable. Good for remote desktop.
b. WISP connection is fast, but instable. Good for web browsing, uploads, downloads, etc...

Below there is a (barely drawed) image of my network.

https://www.dropbox.com/s/jp5dpdlfvx36xtz/network.jpg

I hope you guys can understand my poorly english, and some help would be very nice.

I heard something about disabling DHCP relay, but I couldn't find anything about it on dd-wrt admin panel.
Sponsor
Daw
DD-WRT Novice


Joined: 04 Jun 2013
Posts: 3

PostPosted: Wed Jun 05, 2013 5:07    Post subject: Reply with quote
You got it, I did connect the second router on the first router network.

The computers connected through ethernet cable should access the ISP from the primary router, I'm trying to get the computers connected through wireless to get the DHCP from the router they are connected to.

For some reason they only gets the DHCP from the primary router.
Daw
DD-WRT Novice


Joined: 04 Jun 2013
Posts: 3

PostPosted: Wed Jun 05, 2013 20:50    Post subject: Reply with quote
I've never looked at DHCP servers this ways, maybe the DHCP client looks for lower IP adress, so they keep geting DHCP from the primary router, never from the secondary one.

Is there a way to connect the second router to the main network, in another IP class, so users connected to the second router/isp can access the NAS device? Is it possible? Since the NAS is on the IP class of the main network.
SierraSabre
DD-WRT Novice


Joined: 02 Aug 2013
Posts: 2

PostPosted: Fri Aug 02, 2013 22:47    Post subject: Expanding on this idea Reply with quote
So, I'm a bit new the the world of "advanced routing." I can configure my dd-wrt routers in various modes, but its very much a "follow the recipe" level. I'd like to learn more about these concepts. I've done some limited playing around and I am beginning to know enough to be dangerous. Which is a precarious position.

So I ask for guidance...

eibgrad wrote:

NOTE: It would be possible to use two routers *if* they supported VLANs. Then you could, in effect, create a shared third network and route between them. But I’m assuming this option is not available on your non-ddwrt router. So I’m taking that option off the table.


Not to threadjack, but can we put it back on?

So... VLANs. I've read about them, and I'm trying to figure this out. I'm trying to do something similar to the OP, and I'm a bit lost. I'd like to figure out a way to do something like this. Two DHCP servers, each serving a different subnet, isolated from each other.


eibgrad wrote:


So what’s the solution? USE A THIRD ROUTER!
Use another router to create the gateway you need between the two networks so you can access resources between them, AND without having to deal w/ DHCP conflicts.

Now how to configure that third router depends on several factors, such as whether there is a security issue w/ having cross network access. IOW, should we assume each network trusts the other? Should access to resources be limited to only the NAS, or wide open (all resources)? Or perhaps only in one direction? IOW, it’s like anything else involving routing between two networks. It’s really these details that are the most complicated, and only something YOU can decide.

So architecturally it’s not really all that complicated. It only gets complicated if you insist on trying to solve a three-router problem w/ a two-router solution!


Lets keep it simple, just for the sake of learning. Assume wide open access to resources. I can figure out the rest, I think.

How do you go about configuring that third (middle) router using dd-wrt?
erwin9
DD-WRT Novice


Joined: 30 Jul 2013
Posts: 11

PostPosted: Sun Aug 04, 2013 16:08    Post subject: Reply with quote
There could be another way, but it requires some manual work and will lack the dynamicity of vlans. However, it keeps the manual things at one place, so it can be a temp solution for a while ...

- Remain in your current setup.
- Disable DHCP on one of the routers, presumably the non-dd-wrt one since it is probably the less flexible.
- Then do everything with ONE DHCP, on which you configure two dhcp-range for ip addresses. Play with start/end addresses to carve out what you need in your whole address space.
- To make things simple let's "tag" them 1 and 2 using the net:1 and net:2 locutions
See http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
- You normally do that in the "Services" tab of the Web UI, under the section "Additional DHCPd Options"
- For each range 1 and 2, you add a number of options in the same DD-WRT config place, to specify a different gateway, and anything else you want like DNS server, using dhcp-option
- The next step is the "manual" part. You have to collect all the MAC addresses of the workstations, and then assign them to either net 1 or net 2, using the dhcp-host command.

Something like the below, which you need to tune/verify as I didn't test it and I'm not sure the syntax is the latest or corresponds to your version of dd-wrt (in particular, net: can now be replaced by set: I believe, read the doc above in details). I am doing the same sort of things for a particular case of mine on one of my routers, which is Tomato, but I presume that dnsmasq on DD-WRT is as complete as in Tomato.

This is to give you the idea:
Code:
dhcp-range=net:1,192.168.1.64,192.168.1.127
dhcp-range=net:2,192.168.1.128,192.168.1.191
dhcp-option=net:1,option:router,192.168.1.1
dhcp-option=net:2,option:router,192.168.1.2
dhcp-option=net:1,option:dns-server,x.x.x.x
dhcp-option=net:2,option:dns-server,y.y.y.y
dhcp-host=aa:bb:cc:dd:ee:ff, net:1
dhcp-host=11:22:33:44:55:66, net:2
.. etc ...
<don't forget to set a default for the MAC addresses you don't know yet, so that they get one of the two gateways, and can still be operational until you assign them>


Hope that helps.
Erwin9.
Cylac
DD-WRT Novice


Joined: 16 Sep 2013
Posts: 6

PostPosted: Tue Oct 15, 2013 17:56    Post subject: Re: Expanding on this idea Reply with quote
SierraSabre wrote:
So, I'm a bit new the the world of "advanced routing." I can configure my dd-wrt routers in various modes, but its very much a "follow the recipe" level. I'd like to learn more about these concepts. I've done some limited playing around and I am beginning to know enough to be dangerous. Which is a precarious position.

So I ask for guidance...

eibgrad wrote:

NOTE: It would be possible to use two routers *if* they supported VLANs. Then you could, in effect, create a shared third network and route between them. But I’m assuming this option is not available on your non-ddwrt router. So I’m taking that option off the table.


Not to threadjack, but can we put it back on?

So... VLANs. I've read about them, and I'm trying to figure this out. I'm trying to do something similar to the OP, and I'm a bit lost. I'd like to figure out a way to do something like this. Two DHCP servers, each serving a different subnet, isolated from each other.


eibgrad wrote:


So what’s the solution? USE A THIRD ROUTER!
Use another router to create the gateway you need between the two networks so you can access resources between them, AND without having to deal w/ DHCP conflicts.

Now how to configure that third router depends on several factors, such as whether there is a security issue w/ having cross network access. IOW, should we assume each network trusts the other? Should access to resources be limited to only the NAS, or wide open (all resources)? Or perhaps only in one direction? IOW, it’s like anything else involving routing between two networks. It’s really these details that are the most complicated, and only something YOU can decide.

So architecturally it’s not really all that complicated. It only gets complicated if you insist on trying to solve a three-router problem w/ a two-router solution!


Lets keep it simple, just for the sake of learning. Assume wide open access to resources. I can figure out the rest, I think.

How do you go about configuring that third (middle) router using dd-wrt?

did you manage to get this setup working?
I'm also looking at linking 2 separate networks together using a wire connection. (VLAN or 3rd router)
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