Making the router accept connections from a different subnet

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
Hamy
DD-WRT Novice


Joined: 25 Apr 2010
Posts: 8

PostPosted: Sun Apr 25, 2010 16:24    Post subject: Making the router accept connections from a different subnet Reply with quote
Hey guys

I have an Asus router with dd-wrt firmware running on gateway mode (lets call it Router1) and my setup is like this:
WAN port is connected and pppoe connection is up.
LAN1 has the ip address of 192.168.10.1/255.255.255.0
now i have another router(Router2) with the ip of 192.168.10.2 connected to LAN1, this router(Router2) is also connected to 3 other networks and its perfectly capable of routing the traffics between them. the networks are : 192.168.0.0/255.255.255.0, 192.168.4.0/255.255.255.0 , 192.168.5.0/255.255.255.0 . now routing between them works perfectly. what i want to do is make the Router1 to accept the connections from these networks which have been routed by Router2. and i don't want to use NAT. i want those networks could access to the WAN with their real ips.

What I have tried so far:
1- setting the Router1 ip to 192.168.10.1/255.255.0.0 to include all those other subnets. Result: Failed. maybe because the subnet is not match with other networks

2- setting the gateway in "Router IP" in Router1 to 192.168.10.2 . Result: Failed. this gateway was not even showed up in the routing table. maybe because i already have a gateway (pppoe connection)

3- adding a static routes with destination matching other networks (with and without gateway) . result: Failed

(The firewall was off for all tests)

I would really appropriate if someone could help me out.

Best Regards
Hamy
Sponsor
mstombs
DD-WRT User


Joined: 31 Oct 2007
Posts: 151

PostPosted: Sun Apr 25, 2010 17:26    Post subject: Reply with quote
You cannot use local IP addresses 192.168.x.x across the internet, you need a real IP address, so I don't see how you can avoid nat on the second router with the pppoe connection.

One way to get the main router to allow connections from a different local lan is to assign its lan port a secondary IP in the range of the second router using, for example,

Code:
ifconfig br0:0 192.168.10.4.254


A better way would be to use the web gui to separate the lan ports into vlans, then you could apply further iptables/route commands based on source interface.
Hamy
DD-WRT Novice


Joined: 25 Apr 2010
Posts: 8

PostPosted: Sun Apr 25, 2010 17:49    Post subject: Reply with quote
mstombs wrote:
You cannot use local IP addresses 192.168.x.x across the internet, you need a real IP address, so I don't see how you can avoid nat on the second router with the pppoe connection.


I do not intend to not use nat in Router1 . ofc i need nat to be able to access to the internet, i just dont want to use nat in Router2 to be able to connect to Router1. Thank you for your response. right now seems i messed up my connection to the router with wrong vlan settings Confused . Ill try that tomorrow and get back to you.

Best Regards
Hamy
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Sun Apr 25, 2010 17:57    Post subject: Reply with quote
Router 1 needs a route to router 2's subnet and router 2 need to be configured with router 1 as its gateway. You probably entered the static route incorrectly before.

http://www.dd-wrt.com/wiki/index.php/Linking_Subnets_with_Static_Routes

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
Hamy
DD-WRT Novice


Joined: 25 Apr 2010
Posts: 8

PostPosted: Mon Apr 26, 2010 4:23    Post subject: Reply with quote
phuzi0n wrote:
Router 1 needs a route to router 2's subnet and router 2 need to be configured with router 1 as its gateway. You probably entered the static route incorrectly before.

http://www.dd-wrt.com/wiki/index.php/Linking_Subnets_with_Static_Routes


Oh my. it did work! I did not know that you could set a gateway out of your subnet and it would work. Thanks man, you made my life easier.

and thank you mstombs, seems i need to learn a lot about VLANs and all ;)

Best Regards
Hamy
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC 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 can attach files in this forum
You can download files in this forum