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 11-23-2004, 11:40 AM   #1
tscman
LQ Newbie
 
Registered: Jan 2004
Distribution: RedHat 9
Posts: 9

Rep: Reputation: 0
Question Routing question on RH9, two gateways


Hi all,

Sorry this is a pretty long post, here goes...

I have a need to connect two adsl lines to a RedHat 9 box, via two ethernet cards (eth0 and eth1).

The thing that is confusing me is getting the routes setup properly - namely the issue of gateways. The two adsl connections are on different subnets and have different gateways.

I need to be able to access both connections, and have the linux box accessable from the web via both connections, but the routing table - as configured by the network scripts at boot time - looks like this:

IP1: 1.1.1.102
gateway: 1.1.1.101
subnet mask: 255.255.255.252
dev: eth0

IP2 - 2.2.2.102
gateway: 2.2.2.101
subnet mask: 255.255.255.252
dev: eth1

eth2 is LAN...

(both IP's made up)

Code:
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
1.1.1.102  	0.0.0.0         255.255.255.252 U      0      0        0 eth0
2.2.2.102 	0.0.0.0         255.255.255.252 U      0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U      0      0        0 eth2
192.168.0.0     0.0.0.0         255.255.255.0   U      0      0        0 eth2
127.0.0.0       0.0.0.0         255.0.0.0       U      0      0        0 lo
0.0.0.0         1.1.1.101     	0.0.0.0         UG     0      0        0 eth0
You may have noticed that the adsl connections are both bridged (RFC1483) and thus the subnets allow for only two nodes - the IPs I've got and the default gateways.

So, that's how the network scripts configure things for me at boot time, and I can access the internet and can access the box from the internet via either 1.1.1.102 or 2.2.2.102.

But what the routing table info here is telling me is: route all traffic to/from 2.2.2.102 to anywhere THROUGH 1.1.1.102 - ie. through the default gateway.

And everything breaks if I disconnect eth0 (1.1.1.102) - I can't get to the internet or access the box from the internet on 1.1.1.102 OR 2.2.2.102.

This is no good. I think what I need to do is have the ADSL IP addresses added with their unique gateways instead of 0.0.0.0 (ie. the default gateway). Is that right?

Does anyone know how I can multi-home this box and get around the problem of one default gateway?

Thanks in advance for reading such a long post
 
Old 11-24-2004, 11:15 AM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Time to read the Advanced Routing HOWTO, particularly Sections 4 & 5
 
Old 11-25-2004, 06:39 AM   #3
tscman
LQ Newbie
 
Registered: Jan 2004
Distribution: RedHat 9
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks Peter! Working my way through it...
 
  


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
Routing to multiple gateways The Jesus Linux - Networking 6 09-20-2012 01:58 AM
On-demand PPP, routing, gateways, and iptables godofpumpkins Linux - Networking 1 10-10-2005 10:46 AM
Advanced Networking - Multiple gateways, routing question/shorewall micaheli Linux - Networking 2 09-30-2004 12:05 AM
Question about server access and gateways maverick106 Mandriva 0 04-26-2004 01:25 PM
Possible to have 2 gateways at once in routing table? magnakuz Linux - Networking 1 03-04-2002 09:54 AM

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

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