LinuxQuestions.org
Visit Jeremy's Blog.
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-07-2004, 03:11 PM   #1
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Rep: Reputation: 35
Dual Homed DSL/Cable setup problem


Help. See my dual-homed setup below.

Code:
  
   DSL Modem                 Cable Modem
       |                          |
 Netgear Router              DLINK Router
 (192.168.0.1)               (10.0.0.1)
       |                       |   |
eth1 (192.168.0.10)            |   |
    RH8 Server                 |   |
eth0 (10.0.0.10)               |   |
       |_______________________|   Windoze Boxes
Netgear Router: IP address 192.168.0.1, subnet mask 255.255.255.0
Eth1: IP address 192.168.0.10, subnet mask 255.255.255.0, gateway 192.168.0.1
Eth0: IP address 10.0.0.10, subnet mask 255.0.0.0, no gateway set.
Dlink Router: IP address 10.0.0.1, subnet mask 255.0.0.0

The RH8 Server always accesses the WAN via DSL. The windoze boxes always access the WAN via cable. The purpose of linking the two networks is to allow local access to the RH8 server from the windoze boxes. Also, I wish to access the server from a remote location through either DSL or cable. DSL works fine for this, but I prefer cable because it's superfast (5M).

The problem: The server ignores me when I try to connect remotely through the cable connection. I can forward ports from the DLINK router and remotely access the Windoze boxes without any problem, but when I forward a port to 10.0.0.10 there is no response. IPTABLES is not running. The RH8 Server is not set up as a router. I can access the RH8 Server (10.0.0.10) just fine locally from the windoze boxes. I can access 192.168.0.10 just fine externally via DSL. It's when I try to access 10.0.0.10 from outside (via cable) that I have this problem. I cannot seem to find anything in the logs to help.

What's wrong? How do I fix this? I suspect it's got something to do with subnet mask and/or ip forwarding (not currently on) and/or static routes, but I do not understand any of these topics well. Please help.

Thanks,
Apollo
 
Old 07-07-2004, 03:17 PM   #2
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
One more nugget of information: If I shut down eth1 (192.168.0.10) then the problem vanishes and I can get into the server at 10.0.0.10 externally via cable with no problem.
 
Old 07-08-2004, 10:17 AM   #3
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
Still have not solved this one, but I have one more clue. The Netgear router is dropping packets due to "IP Spoofing" and it's indicating the LAN address (10.0.0.x) and the WAN cable ip address. I don't quite understand why these packets would even be hitting the Netgear router.

Does that trigger any thoughts?
 
Old 07-08-2004, 11:28 AM   #4
member57
Member
 
Registered: Jul 2003
Location: Texas
Distribution: Mandrake
Posts: 65

Rep: Reputation: 15
How or what program are you using to connect remotely? Sounds to me like there is a binding issue on the RH server and what ever method you are using to connect.
 
Old 07-08-2004, 11:48 AM   #5
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
I have tried 2 different ways ...
- to a webpage on the server (port 80 and 443 and a non-standard port).
- SSH on various different ports (22 and others).

Same result. It works from the LAN (windoze boxes), but not from the WAN (and yes ports on the router were open and directed to the server).
 
Old 07-08-2004, 11:50 AM   #6
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
... ssh connection was from putty (windoze box) and terminal from a linux box -- same problem from both boxes.
 
Old 07-08-2004, 01:32 PM   #7
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
That is definitely the problem ... for some reason packets coming in through 10.0.0.10 are hitting the Netgear router and being dropped because it thinks they are "ip spoofing".

Now I just need to figure out why they are even hitting the Netgear at all. I don't think they should.
 
Old 07-09-2004, 09:42 AM   #8
member57
Member
 
Registered: Jul 2003
Location: Texas
Distribution: Mandrake
Posts: 65

Rep: Reputation: 15
I think you may need a routing table. To route all 10.x.x.x traffic thru your 10.x.x.x interface. I think we are on the same page in thinking that the server is accepting connections but routing to the wrong interface and bouncing off the Netgear. It's been a while since I altered a router table. Basically route all 10.0.0.0/255.255.255.0 thru 10.0.0.x (eth1).
 
Old 07-09-2004, 09:52 PM   #9
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
Thanks for hanging in there member57 -- I appreciate the help.

Ok, I do not have a full grasp of this stuff, but I'm starting to make progress. The problem seems to be related to gateways. I need 2 active gateways (10.0.0.1 for eth0 and 192.168.0.1 for eth1), but I can only have one active at a time, it seems. Here's what I mean ...
Code:
[root@cool1 root]# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1
10.0.0.0        0.0.0.0         255.0.0.0       U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 eth1

[root@cool1 root]# ifdown eth0
[root@cool1 root]# ifup eth0
[root@cool1 root]# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1
10.0.0.0        0.0.0.0         255.0.0.0       U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         10.0.0.1        0.0.0.0         UG        0 0          0 eth0
The eth1 gateway is active by default. However, if I shut down eth0 and restart it, then eth0's gateway takes over (and that interface starts behaving normally -- no bouncing off the Netgear -- but now eth1 doesn't function correctly). Likewise, if I then stop and start eth1, I am back to eth1's gateway. I need both gateways, I think. How do I do that? A static route?
 
Old 07-10-2004, 07:37 AM   #10
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
... which leads to another question:

If I get 2 gateways working, how do I control which gateway gets used by the server by default (when the server send email out on port 25, for example)?
 
Old 07-12-2004, 09:01 AM   #11
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
One last try on this. I've probably written so much that everything is getting ignored.

Cable line comes into the server on eth0 (via a router). DSL line comes into the server on eth1 (via a router). Locally, I have the access I need. That is, I can access 10.0.0.10 (eth1's ip address) from boxes on my LAN. However, if I try to access 10.0.0.10 from the WAN (ie. from a remote location), the packets flow right through 10.0.0.10 without being recognized as being destined for eth1. Presumably, because I do not have a gateway set on eth1, the interface does not recognize the packets as being for it because they are labelled as being destined for the external cable WAN ip address. If I add a gateway (10.0.0.1) for eth1 then that solves the problem. However, then the gateway for eth0 is gone and the same problem is created at eth0. I want to be able to get into the server from both sides (cable and dsl) from the WAN (not just the LAN). What to do?
 
Old 07-12-2004, 09:03 AM   #12
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
Whoops, I mixed up eth1 and eth0 in some of that last post. Arrgggh. Ignore it. Here is the correct post:

Cable line comes into the server on eth0 (via a router). DSL line comes into the server on eth1 (via a router). Locally, I have the access I need. That is, I can access 10.0.0.10 (eth0's ip address) from boxes on my LAN. However, if I try to access 10.0.0.10 from the WAN (ie. from a remote location), the packets flow right through 10.0.0.10 without being recognized as being destined for eth0. Presumably, because I do not have a gateway set on eth0, the interface does not recognize the packets as being for it because they are labelled as being destined for the external cable WAN ip address. If I add a gateway (10.0.0.1) for eth0 then that solves the problem. However, then the gateway for eth1 is gone and the same problem is created at eth1. I want to be able to get into the server from both sides (cable and dsl) from the WAN (not just the LAN). What to do?
 
Old 07-12-2004, 10:50 PM   #13
member57
Member
 
Registered: Jul 2003
Location: Texas
Distribution: Mandrake
Posts: 65

Rep: Reputation: 15
Sorry, been away for a few days, I am still processing your situation...

Basically route all traffic going to network 10.0.0.0 thru eth0 (10.0.0.10) gateway being 10.0.0.1
Route all traffic going to 0.0.0.0 and 192.168.0.0 thru eth1 (192.168.0.10) gateway being 192.168.0.1.

Let me look at the route man pages tomorrow, I think we can get this beat... I am a little bit rusty on routing, been about 3 years since I messed with routing.
 
Old 07-12-2004, 10:53 PM   #14
member57
Member
 
Registered: Jul 2003
Location: Texas
Distribution: Mandrake
Posts: 65

Rep: Reputation: 15
You will need to add manual routing tables to make sure the routing stays correct. Default routing tables will adapt if a link goes down, but not correct if it comes back up, or alteast until the roting table is reset. If I am not mistaken anyway..
 
Old 07-16-2004, 11:45 AM   #15
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
Well, I have sort of found a workaround for this. It's not ideal, but pretty good. I'm coming in through the cable line by ssh into another linux box on my LAN (which has one nic ... with one gateway of 10.0.0.1). The ssh connection includes a tunnel to the server at 10.0.0.10 . I do not really like being dependent on that 2nd linux box, but it works fine and gets me into the server.
 
  


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
dual homed network cards hrmwinn Linux - Networking 1 08-17-2005 01:51 PM
Linux routing on a dual homed pc friendklay Linux - Networking 4 06-08-2005 09:01 AM
Dual-homed machine gubak Linux - Newbie 4 07-28-2004 01:53 AM
Dual Homed server / Two ISPs GuitsBoy Linux - Networking 3 01-13-2004 03:37 PM
Linux DSL/Cable Modem setup zodmaner Linux - Networking 3 02-11-2003 09:30 AM

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

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