LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-27-2005, 05:03 PM   #1
nukenstien
LQ Newbie
 
Registered: Aug 2004
Posts: 15

Rep: Reputation: 0
Multi homed gateway


I am trying to setup a dual homed system
my eth info is as follows

eth0 Link encap:Ethernet HWaddr 00:50:BA:CE:XX:XX
inet addr:65.87.225.171 Bcast:65.87.225.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1

eth1 Link encap:Ethernet HWaddr 00:50:BA:CC:XX:XX
inet addr:192.168.0.129 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth2 Link encap:Ethernet HWaddr 00:50:BA:56:XX:XX
inet addr:192.168.0.104 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1

I have a cable modem that is connect directly to my linux machine on eth0. This is the primary internet.
I have several computers that route through the linux box on eth1 and they are connected to the hub to eth1, ips 192.168.0.130-254, network A
I also have another cable modem the connects directly to a di-604 router.
The d-604 router is the the router for some computers ips 192.168.0.2-127, Network B.
I would like to set up eth2 on my linux box to be able to route the hosts
192.168.0.130-254, network A, through eth2 if eth0 goes down.

I would also like to share network resources, like printers on both network, back and forth.

http://freefilehosting.net/file.cfm?...B7FFB6C6AD4C4E

Thanks Nuke

Last edited by nukenstien; 02-10-2005 at 02:58 PM.
 
Old 01-27-2005, 06:51 PM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Nuke,

I'd be happy to help you, I recently did such a project, but I don't understand where you're heading.

The figure you drew is utterly incomprehensible....

I understand it so far:

Eth0 is your Internet connection
Eth1 is your internal interface to 192.168.0.130 - 254. That is network A
The computers on network A access the internet thru the Linux box

What does the second cable modem do? Between what and what does the DI-604 route?
How does network B connect to the Internet?

In your figure, the cable end of the cable modem is connected to your linux box....

If you have two subnets 130-254 and 2-128 with subnet mask 255.255.255.0, you will *never* be able to route between the two networks because these are on the same subnet. You have to use 255.255.255.128 OR use another subnet like 192.168.1.x

Do you run iptables?

jlinkels
 
Old 01-27-2005, 08:46 PM   #3
nukenstien
LQ Newbie
 
Registered: Aug 2004
Posts: 15

Original Poster
Rep: Reputation: 0
Sorry the diagram got al garbled when it was posted.

The second cable modem provides internet access for network B.
The second cable modem is plugged into the di-604 which is supplying ips and acts as a firewall for network B.

Please disregaurd the diagram.

so i was thinking of using 255.255.255.192 as the subnetmask

that will give me two networks with 62 computer in networks A and B

i am using iptables to filter a whole bunch of crap.
 
Old 01-28-2005, 06:54 PM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Ok,

You need to know the IP of your di-604 router. For now I assume that it is 192.168.0.1. All computers on network B will have the default gw set to 192.168.0.1.

If you want to use the di-604 router for the network A, you have to tell your Linux box that that is the default gateway. Currently the Linux box routes everything coming from network A through 65.87.225.171.

So you have to unset the default gw on interface 65.87.225.171, and set it to 192.168.0.1 on your interface eth2. Furthermore, iptables is now masquerading your traffic to the default gw of 65.87.225.171, and you should change that to 192.168.0.1. Also, make sure that any rules which restrict or allow traffic from/to eth0 should do that now to eth2. Also, make sure that the ip address of the di-604 and eth2 are on the same subnet.

When you want to communicate from network A to B, make sure you have the default gw on all machines in network A set to the linux box.

then, to get from B to A you must make sure that the machine on network B know how to get to A. You can add this route to the di-604 router:

net 192.168.0.128 mask: 255.255.255.128 gateway 192.168.0.104

Be sure you have ip forwarding enabled on the Linux box, and iptables allows forwarding (not masquerading) between the two networks.

Good luck
jlinkels
 
Old 02-10-2005, 10:07 AM   #5
nukenstien
LQ Newbie
 
Registered: Aug 2004
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks dude

after dhcpcd -t 10 -d eth2 to get my ip address for eth2
and deleting the default route that is made through 192.168.0.1
i added

route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.0.1 metric 2

so now all computers on network A know where to go to get to network B, but my firewall table is blocking the traffic

I have tried to add in the same rules for eth2 as I have for eth0 but the firewall is still blocking the icmp requests. Please note that at anything I can ping and get a reply from my linux box to
network B.

The only way that I can get network A to ping and recieve a reply from network B is to change my alias for external interface to eth2 instead of eth0.

My question is what is the commands for allowing all traffic in and out of eth2 no matter what is or where it is going.

A more specific question is how do I redirect all traffic between eth1 and eth2.

Nuke
 
  


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
multi hop gateway route thllgo Linux - Networking 4 04-06-2009 01:02 PM
Linux Routing to Multi-Homed Host MightyCranium Linux - Networking 0 03-16-2004 05:14 PM
Proper Solution for Multi-Homed IP ytene Mandriva 0 08-25-2003 06:14 AM
Problems running a multi-homed Solaris 8 host!!! Olusegun Solaris / OpenSolaris 2 06-08-2003 06:29 PM
multi-purpose Server/gateway redgore Linux - Networking 2 02-06-2003 04:24 AM

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

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