LinuxQuestions.org
Help answer threads with 0 replies.
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-26-2005, 07:43 PM   #1
seer_tenedos
LQ Newbie
 
Registered: Mar 2005
Distribution: Mandrake 10.1
Posts: 5

Rep: Reputation: 0
Unhappy 2 networks and 2 internet connections on linux router


Guys,
I am not a linux expert. I will say that out front so you understand my level a little more i have a few friends that use linux every day and they help me and i have a basic understanding of linux and now to navigate it.

This is what i am trying to do. I have 2 internet connections. Bigpond and internode. Bigpond is extremely fast but is expensive and limited to 1gb a month. Internode is slower but is uncapped.

I also have 2 LAN's, one is my parents that will use the fast connection for everything at this stage. The second LAN is my own that will use a mixture of the fast and slower connecting. My lan will use the slow connection for most things but will use the fast connection for web traffic.

At the min i am just trying to get my parents LAn to use the fast connection and min to use the slow one but i can't get it to work. I have followed many different guides on this all over the net but they all seem to be missing something.

here is my network config
bigpond gateway ip 192.168.4.2
internode gateway ip 192.168.3.2

my 4 cards on mandrake 10.1 server
eth0 192.168.1.1 (my LAN)
eth1 192.168.2.1 (parents LAN)
eth2 192.168.3.1 (internode connection to gateway (192.168.3.2)
eth2 192.168.4.1 (internode connection to gateway (192.168.4.2)


Can anyone provide some info on how i should set this up? I have shorewall installed as well and i have enabled advance routing. i have almost everything working with shorewall apart from selecting a different routing table with a different gateway depending on the interface the connection is coming from (eth0 or eth1). I have tried everything but no matter what i do it fails.


Summary
eth0 uses eth2 and its gateway for most internet traffic
eth1 uses eth3 for ites gateway and most of its internet traffic
eth0 and eth1 need to be able to talk to each other as well.

While i would love for eth0 to use eth3 for some web and eth1 to use eth2 for some data i would be happy for now just to get the above summary working.

I hope someone can please help me I really can't find the info i need to do this.

thanks in advance

Chris
 
Old 03-26-2005, 09:03 PM   #2
Half_Elf
Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 45
you probably need to set up some iptables rules now. Your system probably dont know where to send traffic right now. So you have to nat connection from your parent subnet to the fast ISP and the one from you to the slow one. Something like :
iptables -t nat -A POSTROUTING -s 192.168.2.1 -o eth2 -j MASQUERADE
This will work as long as your parents gateway is bigpond gateway (you might want to ajust your DHCP server to send the correct address).
Or you could force their traffic to be routed to the ISP too, with something like
iptables -t nat -A PREROUTING -s 192.168.2.0/255.255.255.0 -j DNAT --to-destination 192.168.4.2
(but I really dont know how this will react with the masquerading, you will have to test).

With some time, you could really setup a nice router, with bandwidth throlling and dynamic routing
 
Old 03-26-2005, 11:20 PM   #3
seer_tenedos
LQ Newbie
 
Registered: Mar 2005
Distribution: Mandrake 10.1
Posts: 5

Original Poster
Rep: Reputation: 0
bit more detail please

i am about to try your commands but i suspect from what i have been reading that i need to do more than that.

i have been getting lost in the routing tables. may issue is that i have 2 different gateways and depending on which interface the request comes from eth0 or eth1 i need to use a different gateway.

What i really need is a step by step instructions for both connections almost or someone to point me to a set that is complete or comment on what is missing assuming a know nothing about routing etc i need to be able to just follow the steps and set request to the internet and back for say web requests

i am about to play around with the commands you gave me but if you could provide any more info it would be great.

Also the traffic shaping etc is planned but i am just trying to get the basic connection sharing working at the min. The main issue i have is everything refers to load balancing but that is not what i want. i need set data to go out set connections. ie i hope to send all web out the fast one and all p2p out the slower one

Chris
 
Old 03-26-2005, 11:22 PM   #4
seer_tenedos
LQ Newbie
 
Registered: Mar 2005
Distribution: Mandrake 10.1
Posts: 5

Original Poster
Rep: Reputation: 0
further info

also please note that the gateways for the 2 LANS will be 192.168.1.1 and 192.168.2.1 so my linux box will be the gateway for both.

Chris
 
Old 03-26-2005, 11:51 PM   #5
seer_tenedos
LQ Newbie
 
Registered: Mar 2005
Distribution: Mandrake 10.1
Posts: 5

Original Poster
Rep: Reputation: 0
both commands above failed

both commands had a similar effect where all traffic was redirect to the gateways. this seems good at first but then i found out it is redirected to the gateway in a way that the gateway responds to requests and does not send them onto the internet. My ping tests looked great becayse the gateway responed to all pings. If i type in a invalid ip the gateway still reponds. thats how i descoved what was happening.

Any other ideas?
 
Old 03-27-2005, 06:49 AM   #6
seer_tenedos
LQ Newbie
 
Registered: Mar 2005
Distribution: Mandrake 10.1
Posts: 5

Original Poster
Rep: Reputation: 0
done

Guys i manages to solve the proplem.

If anyone is interested in how to complete the what i was asking above just le me know and i will post how i did it.

I still have to implement directing soem ports to the other internect connection but i know how to do most of this. If anyone knows where i can get a web GUI for shorewall that will let me set the mark on rule or TOS entry?

regards chris
 
Old 03-27-2005, 07:24 AM   #7
Chimpus
LQ Newbie
 
Registered: Mar 2005
Location: Romania
Distribution: Suse 9.2
Posts: 3

Rep: Reputation: 0
I'm also interested in a similar matter. Can u post the solution that worked for u?

thanks
 
  


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
How do you bridge networks on linux? Or share a network's internet connection? pugsley1218 Linux - Networking 1 11-14-2005 04:36 AM
New to Linux/internet connections?? blckspder Linux - Newbie 2 02-05-2005 11:33 PM
2 internet connections w/ coyote linux jac0b Linux - Networking 0 04-14-2004 12:56 PM
Linux Router /w 2 DSL Connections adamantium Linux - Networking 1 01-14-2004 01:20 PM
Linux Mandrake 8.1 as Server now refusing connections to and from router lordsteven Linux - Networking 1 12-12-2003 04:16 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration