Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-13-2013, 01:58 AM
|
#1
|
LQ Newbie
Registered: Mar 2004
Location: LinuxCountry
Distribution: CentOS/RHEL
Posts: 2
Rep:
|
Routing question
Hi all,
We have 2 LAN connected via OpenVPN tunnel (mode p2p).
On LAN-2, there is a 3rd LAN connected to 2nd via Linux box (192.168.53.206 in attached image).
From LAN-1 (192.168.43.0/24) I can ping any host of LAN-2 (192.168.53.0/24).
From LAN-2, I can ping any host of LAN-3 (192.168.63.0/24).
So my question how to route traffic from LAN-1 to LAN-3? I would like to reach LAN-3's hosts from LAN-1.
Thanks,
|
|
|
12-13-2013, 08:04 AM
|
#2
|
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350
Rep: 
|
On firewall/router in LAN-1 add a static route to LAN-2
Taken from memory, you'll want to check the syntax:
route add -net 192.168.60.0 netmask 255.255.255.0 192.168.43.2 (I assume that's the ip of router on LAN-2)
|
|
|
12-13-2013, 08:58 PM
|
#3
|
Member
Registered: Sep 2003
Location: ky
Distribution: gentoo
Posts: 409
Rep:
|
google quagga it is very cool. Would help more but just learning linux dynamic routing
|
|
|
12-15-2013, 03:51 PM
|
#4
|
Member
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891
Rep: 
|
Any device acting as router must have routing information by which to route. There are different types of route in the route table. Connected routes (aka local or direct routes) are implied by the configuration of the interface. i.e. Host 192.168.43.1 knows it has a route 192.168.43.0/24 available via its ethernet port because you have literally told it by configuring it.
Indirect routes are those in which the host does not personally belong. So 192.168.43.1 cannot infer knowledge about 192.168.63.0/24 from its local network memberships. It somehow has to learn about where this network is located and how to get to it.
This can be done by a adding a Static route, which is put into the config of the host to tell it how to reach this indirect route e.e 192.168.63.0/24 gw 192.168.53.x. Alternatively you can tell it how to reach all indirect routes, if there is only one path out of the local network, by adding a default-route 0.0.0.0/0. In most desktop operating systems this is basically the default gateway.
Remember that routes are unidirectional. 192.168.43.1 needs a route to reach 192.168.63.x but likewise 192.168.63.1 needs a route configured to get to 192.168.43.x. Each node only knows about the networks it is a member of unless you tell it about others.
The alternative to static routes, which I'm sure you will have guessed by now don't really scale very well (the internet is running at around 475,000 routes at the moment) is to use a dynamic routing protocol such as RIP, OSPF or BGP. These protocols allow to "talk" to each other and thus exchange information about the networks they can reach.
This is where quagga comes in as it provides the routing deamons that allow these routing protocols to function.
That being said, each of these protocols has its own peculiarities and learning curve and I'm not sure its really justified by the small size of your network.
SO you really just need to ensure that each host has a default route to their respective "router" (which any device that is forwarding packets between networks) and each router has either connected or static routes to all networks.
You would add static routes, these days on modern kernels, by using route add -net 192.168.63.0/24 gw <next hop>
Next hop will either be the exit interface in the case of the vpn tunnel as its point-to-point it only has one end point, or for a LAN because there are many hosts available the IP address of the next hop router.
Last edited by baldy3105; 12-15-2013 at 03:56 PM.
|
|
|
12-17-2013, 08:08 PM
|
#5
|
LQ Newbie
Registered: Dec 2013
Location: Oregon
Distribution: Debian, RHEL, SLES, Mint
Posts: 7
Rep: 
|
In cisco speak it would be a route statement of "ip route 192.168.63.0 255.255.255.0 192.168.53.206" on the 192.168.53.1 box. Assuming .1 is also the 43 network's default gateway.
I would design the network differently to avoid this kind of issue. Hub and spoke connecting each class C as example. Then each /24 is a local connected and routing decisions are trivial.
Last edited by xplorn; 12-17-2013 at 08:09 PM.
|
|
|
All times are GMT -5. The time now is 08:42 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|