LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-04-2010, 04:41 PM   #1
SuperAnden
LQ Newbie
 
Registered: Sep 2010
Posts: 1

Rep: Reputation: 0
Question Static routes between two LANS each with their own ADSL line out


HELLO

Hi Y'all. GNU/Linux gods, guides and superbrains.
Don't be moddest. I'ts YOU i'm taking about !!

I'll be your humble problem-describer-pixie / solution-testing-smerf :


Andreas Vinther, 1977, from Denmark


SIMPLE NETWORK PROBLEM

I'm trying to establish a connection between two seperate ADSL LANs (coming into the house, but from separate ISPs) to a situation where all hosts on either LAN will be able to reach any host on eiher LAN WITHOUT having to use an excess of plastic routers around the house, and please no Wireless bridges. WiFi will only be available as Access Points.

.... so i thought to myself... hey I've heard that Debian does this kind of static routintg / RIP stuff quite well.

And I just happen to have one lined up in the right place, that haven't got at snowballs chance in hell of running WINXP or above.
But it kills at textbased datamanipulation/forwarding/rerouting/dropping/scanning ... so I'vew made up my mind.
That is what I want to do... Now how do io get around doing stuff like that.



FIRST SOME INFO

The Debian box is connected to both networks: Hostname: AsusAnd
(192.168.1.0/24 - TDC network)
and to
(192.168.15.0/24 - Profiber network)

Needless to say, but both netmasks are 255.25.255.0 hence the /24


The respective router's LAN addresses are 192.168.1.1 and 192.168.15.1


My Debian are locked to the following IP's (reserved DHCP):


eth0:192.158.1.56 via DHCP from 192.168.1.1

eth1:192.168.15.177 via DHCP from 192.168.15.1

So far so good - Now here we go !!



LET ME BE CLEAR FROM THE START

This is not a scenario where i'd like to always want all network-packages to travel the shortest path, nor NESSESARILY use the other ISPs gateway if the first is down or slow, although that'll be super nice.
I suspect that'll involve router-protocols like RIP.
I'll be super pleased to get some guidelines there as well, as i suspect it'll be quite easy to implement once everything else is in place.

Although RIP isn't our main goal, it probably comes as a close second. I think we all would like as stable and fast a connection as possible.



I was actually so naive that i thought if i added two static routes to the two routers x.x.1.1 and x.x.15.1, that my problems would automatically be solved by my Debian box, and that it would automatically act as a gateway when the routers send their packages for the other net. As long as i was connected to both LANs at the same time.


Note: I haven't changed or tweaked the Debian kernel to do routing. this is a simple stable install from the net-inst.iso of Debian 5.

I'd like to keep it that way unless there's no way around it.


So, my routers have static routes to each other (WITH PROPER CABLING), configured as follows:



(On router with LAN 192.168.1.1)

[static route] to 192.168.15.0 with nmask 255.255.255.0 going throuhg gateway 192.158.1.56 ( Taken from above info ) - metric around 2

Similary on my other NIC directly cabled to another switch ---and-then-to-another---> Router


(On router with LAN 192.168.15.1)

[static route] to 192.168.1.0 with subnetmask 255.255.255.0 goling throuhg gateway 192.158.15.177 ( Taken from above info ) - metric around 2


This is clearly not enough for the two subnets to see each other and address each other without further actions.

Except, (and this pisses me off) when i substitute my Debian box for a Windows, it works right out of the box.
Then again, Windows is famous for running all sorts of services if you don't trim/tweak your box.

Thaths a bit taunting. I don't want a giant unreliable M$ machine with most of it's RAM beeing tied up for completely unusable graphics, services and a supersize kernel, when I'll hardly ever watch the screen (except maybe to tweak/update through remote connections like: PuTTY, XWin32; etc.)


but hey ... come on .... who the hell wants pricy Windows box there when an old Pentium 166 from a nearby dumbster can do the trick with Linux, ??? Right !!



A DOLLAR FOR YOUR THOUGHTS

Soooooo

I CAN solve this with two additional routers, but that seems to be so confusing, hiddeous and overkill.

  1. What is the EASIEST way to solve this?
  2. What is the BEST way to solve trhis?
  3. Can RIP or another router protocol be easily implemented for the connection to have some redundands in case someone cuts a cable or one of my ISPs malfuntions?

Will I be best served with re-compiling my kernel with some much needed router modules. (Sort of how it just worked with the windows kernel straight from the get-go)
Can I simply add the correct static routes to my router-table?
Can I invite RIP inside and let that handle the router-table internally as well as externally see point 3 above.
Which routes do i need to add to my Debian box and/or which modules in my kernel.

Are there any problems somewhere that i missed or opportunities for things to be running smoother, more self correcting, with more redundands or easier to manage and monitor ???



SIMPLY PUT


I need my debian box to handle packages that is receives on eth1 but destined for eth2 to be forwarded to eth2

and the other way around, so that printers and AccessPoints, etc. can be shared throughout the house.



HELP WANTED

Please help me u superhuman linux wondersd around the world. I'll buy coffee to everyone with a clue to guide me in the correct direction.

THANKS a lot in advance.....You guys are SO COOL (and i'm getting a bit chilled myself)



Also if you need root passwords for either of my machines.... please refer to the yellow pages between screw~up and tool


If you need more info on routers, router-tables, hardware specs or other info related to the hosts in my simple network architecture..

Please write me @ my email below:

superanden(7*(5+6))@gmail.com


Just to ward off spammers. There are no parenthesis in my emailaddress. So you do the nath ..... litterally




Seriously any/all help will be very graciously appreciated...


And from the bottom of my heart:
THANKS TO THE LOT OF U.
U know who you are. You who help all of us clueless persons to get further and further into the jungle-SuperHighway.



WHY DO IT ALL

I prey that i some day will be able to help some of your with on of your problems (we can't know it all, but we can aspire to do so)- And if I can't help you or your relatives; then maybe just help another fellow not unlike myself to go and do GRAND things in life.

Don't forget why we help each other out, and why we, the people, must hold on to our freely available sourcecode and licenses like GPL and even better.


IT'S ABOUT BEEING IN CONTROL OF SOME OF THE KNOWLEDGE BY SHARING IT WITH THE WORLD !!!

Just look at "OUR" ooperating system GNU/LINUX- It may have started as a simple Minix look-a-like OS for familiarity by Linus and brought to heaven by so many volunteers....Let the best minds come together and play without the omnipresent alternate agenda



/SuperAnden
 
Old 09-04-2010, 10:30 PM   #2
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
wow, nice post, first off, did you turn on forwarding on the debian box? (cat /proc/sys/net/ipv4/ip_forwarding to see the current state; echo 1 > /proc/sys/net/ipv4/ip_forwarding to turn it on, you'll also want to set it up in your sysctl.conf)

second you can set up two default routes just use iproute2 (which you might have to install)

add a table for each in /etc/iproute2/rt_tables
10 isp1
11 isp2

then add some routing info
ip route add default via 192.168.1.1 table isp1
ip route add default via 192.168.15.1 table isp2

ip rule add from 192.168.1.56 table isp1
ip rule add from 192.168.15.177 table isp2


and third if routing still isn't working going from one network to the other you could always mask the packets when they transition (though I wouldn't do this unless you really had to, since those routes you added to the adsl routers should work just fine)

iptables -t nat -A POSTROUTING -o eth1 -s 192.168.1.0/24 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.15.0/24 -j MASQUERADE
 
  


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
static routes fdelval Linux - Newbie 1 08-03-2010 07:03 PM
Static routes using routes/ifroutes-eth-id.. files and default gateway disabled TimtheEagle Linux - Networking 0 05-31-2008 07:08 PM
static routes and ifconfig yiux Linux - Networking 4 06-11-2007 06:24 PM
How do I config static routes? mikezang Linux - Networking 4 10-31-2005 10:29 AM
static-routes in Mandrake 10.0 tallthom Mandriva 1 09-27-2004 12:51 AM

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

All times are GMT -5. The time now is 07:38 PM.

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