LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 07-27-2012, 08:51 AM   #1
manuel19
Member
 
Registered: May 2010
Distribution: Fedora Core 8 (Werewolf)
Posts: 40

Rep: Reputation: 0
Linux routing issue


Hello.

How to solve the case when you have 3 Same networks using different gateways?? I mean,... How Linux kernel will know to deliver the package to the origination network if 3 network are the same?

Ex:
192.168.1.0 netmask 255.255.255.0 gw 192.168.1.23
192.168.1.0 netmask 255.255.255.0 gw 10.0.2.13
192.168.1.0 netmask 255.255.255.0 gw 172.16.1.3

This is NOT fail-over or redundancy... What i want to know if... How Linux will know what gateway use to deliver the package if there are duplicates networks... ??


What i want to do is something like this.

I have 10 interfaces for example:

I want to create an individual routing table for this interface, something like: route -n via eth9

I want to setup individual routing tables without having issue in case duplicates network with others interfaces... is possible?
 
Old 07-27-2012, 09:31 AM   #2
roger_heslop
Member
 
Registered: Oct 2009
Location: Leander, TX
Distribution: Fedora 20
Posts: 97

Rep: Reputation: 35
If all of the systems are on the same networking segment, the gateway won't come into play at all. If they are on different networking segments, you wouldn't use a gateway, as much as adding a route: "ip route add 192.168.1.0/24 dev eth0".


You can have a host with many routes, but everyhost can only have one gateway. It's known as a default route.
Also, you cannot logically (in the networking sense) have two systems on the same layer two network, seperated by a layer three routing device. Hope this helps.
 
Old 07-27-2012, 11:40 AM   #3
manuel19
Member
 
Registered: May 2010
Distribution: Fedora Core 8 (Werewolf)
Posts: 40

Original Poster
Rep: Reputation: 0
Check this scenario:



VPN SERVER
VPN IP: 172.16.1.1/24


OFFICE#1 LAN
VPN IP: 172.16.1.2
LAN Network: 192.168.1.0/24


OFFICE#2 LAN
VPN IP: 172.16.1.3
LAN Network: 192.168.1.0/24




The VPN Server have this 2 routes

route add -net 192.168.1.0 netmask 255.255.255.0 gw 172.16.1.1
route add -net 192.168.1.0 netmask 255.255.255.0 gw 172.16.1.2

So... The VPN Server will get confused because the network is duplicated. So I imagine, the VPN server will send the package to Both gateways. In this case; 172.16.1.2 and 172.16.1.2.

How can i fix something like this?

Last edited by manuel19; 07-27-2012 at 11:45 AM.
 
Old 07-27-2012, 11:51 AM   #4
roger_heslop
Member
 
Registered: Oct 2009
Location: Leander, TX
Distribution: Fedora 20
Posts: 97

Rep: Reputation: 35
The simple answer is, you can't.

A more complex solution might be subnetting, but even then the systems would be on two different networks.
You can have one on the 192.168.1.0/26 network and another on the 192.168.1.64/26 subnet.

Another option would be NATing (Network address Translation), in which case the servers could have the exact same IP. I don't know much about setting NATing up, save grabbing a linksys router or two and throwing it in the mix, hopefully though that will give you some ideas.
 
Old 07-27-2012, 12:15 PM   #5
manuel19
Member
 
Registered: May 2010
Distribution: Fedora Core 8 (Werewolf)
Posts: 40

Original Poster
Rep: Reputation: 0
Exist a way to create routes using /sbin/route)

Then apply each route ONLY to specify address?
 
  


Reply



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
Linux policy routing issue (am I tripping over a kernel bug?) bjsilva1 Linux - Networking 1 08-28-2008 05:05 AM
Routing issue with two linux with firewall sajjad81 Linux - Networking 1 04-06-2007 05:41 PM
routing issue RyPingu Linux - Networking 1 08-15-2003 01:39 PM

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

All times are GMT -5. The time now is 12:29 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