LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-23-2015, 04:44 PM   #1
keirvt
Member
 
Registered: Sep 2006
Location: Sydney Australia
Distribution: fedora/Ubuntu
Posts: 156

Rep: Reputation: 18
router and sub router


I have two networks

Network A talks to the world wide web through an ISP
Network A 192.168.0.0 and Network B 192.168.1.0

The A and B networks each have a router that answers DHCP requests within their network and it is required that each router remains servicing on their Network addresses.

Network B is usually physically isolated, for security reasons, however to upgrade or install new software we wish to plug into Network A router port (temporarily) and get a NAT connection tot the outside world.

How can I configure the B router to get out through the A router. I can change configuration on both routers if required but so far I am confused about how to configure this.

I could increase the subnet mask so both networks are "unified" but then the DHCP services are in conflict. What I need is for B router to "see" the A router as a gateway. Route add doesn't work for me.
 
Old 03-23-2015, 06:40 PM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
In order for B to use A as router, B must be on the subnet 192.168.0.0.

You can set this by adding an alias:
Code:
ifconfig eth0:1 192.168.0.200 255.255.255.0 up
When you set the default gw to something on network A, traffic will use that as a gateway. You might want to bring eth0 (without the alias :1) down to prevent it will request a DHCP and get it from A.

jlinkels
 
Old 03-23-2015, 09:07 PM   #3
thegwer
Member
 
Registered: Jan 2012
Location: San Antonio. TX
Distribution: CentOS. Ubuntu
Posts: 48

Rep: Reputation: Disabled
Please list the two routers you are using here.
 
Old 03-24-2015, 04:29 PM   #4
keirvt
Member
 
Registered: Sep 2006
Location: Sydney Australia
Distribution: fedora/Ubuntu
Posts: 156

Original Poster
Rep: Reputation: 18
Routers

I am testing the setup at home with two physical routers a dlink and a billion on network B.
As an aside comment , I find the Billion frustrating since it takes a long time to reboot.
Config changes, flashing the memory, rebooting, restarting the browser connection often finds no change has taken place and the lengthy process has to be repeated.

The previous suggestion assumes a linux router rather than a hardware router, presumably with IP 192.168.0.200
This can lead to a conflict with both routers acting as DHCP servers the second then attempting to serve DHCP requests on Network A (192.168.0.0) Guess I can turn DHCP of Network B off for the duration of the connection but something of a nuisance with the lengthy reconfig. Be nice to just plug it in and have it work.
 
Old 03-24-2015, 06:05 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
As long as router B is using DHCP for its WAN port, you can just plug it into one of the LAN ports on router A. Its public-facing (well, public to the B subnet) WAN port will be assigned a 192.168.0.x address on the A subnet, but the B subnet will be unaffected. If it's not using DHCP, then just reconfigure the WAN port to have a static IP on the A subnet with the necessary routing information.

If your A and B networks were using the same subnet this would be much more complicated, but since they're different it should just be a matter of plugging it in.

Last edited by suicidaleggroll; 03-24-2015 at 06:07 PM.
 
Old 03-26-2015, 09:26 PM   #6
keirvt
Member
 
Registered: Sep 2006
Location: Sydney Australia
Distribution: fedora/Ubuntu
Posts: 156

Original Poster
Rep: Reputation: 18
router to router

The suggestion has mostly worked at least to do what i want.
The problem with the Billion router was that it is just slow to write to flash. You just have to wait and eventually it returns a message indicating the flash was written but it can take 5 minutes. The Belkin range of routers has clear documentation on how to cascade routers but I wanted to get the in-house device working.

If you plug the WAN port into one of the LAN ports of router A and reboot router B seems to dissappear and it gives a network A IP address to hosted computers. Hosted computers can then see the outside world get their software update, disconnect the WAN port, reboot the router and restart the networking on the target machine

This isn't quite what I wanted but it will do.
 
Old 03-26-2015, 09:32 PM   #7
thegwer
Member
 
Registered: Jan 2012
Location: San Antonio. TX
Distribution: CentOS. Ubuntu
Posts: 48

Rep: Reputation: Disabled
If you really want to have fun and get the most out of your network I would suggest creating a Linux router from an old PC and three network cards. eth0 -- ISP, eth1 to net A and eth2 to net B.

This way you can use IPtables to perform your routing and security policies for the two networks. If you had a layer 3 switch around you could use a single nic as a trunk with VLANS and would get same benefit.
 
1 members found this post helpful.
Old 03-27-2015, 12:48 PM   #8
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Excellent suggestion from thegwer.

For customer installations we often build small boxes with this mainboard: https://xercestech.com/alix-single-board-computer.geek. Alix supplies boards, power supplies and cases. Prompt delivery world-wide. Alix has a price list on-line.

Although it should be possible to run any distro, my colleague prefers a pre-cooked Pfsense image based on BSD. Fully configurable, including thegwers suggestion. And as reliable as sunrise.

jlinkels
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up Linux box as IPv6 router to replace Netgear WNR1000 wireless router samcan Linux - Networking 1 06-19-2011 05:30 AM
How do I set up a laptop as a router to connect wirelessly to my ADSL router hairysocks Linux - Networking 12 12-20-2009 06:51 AM
Adding new Linux firewall/router on network with pre-existing gateway/router grittyminder Linux - Networking 4 08-13-2008 02:17 AM
LXer: Open source's Fast Ethernet router outperformed Cisco's Router LXer Syndicated Linux News 0 04-13-2007 01:31 PM
CentoOS router/firewall prob - local network works but router can't access Internet elementalvoid Linux - Networking 6 12-12-2006 03:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration