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 07-11-2009, 08:13 PM   #1
lothario
Member
 
Registered: Apr 2004
Posts: 340

Rep: Reputation: 30
using eth0, eth1


On this Ubuntu system, there are 2 network cards:

eth0
192.168.2.15 = ip address
192.168.2.1 = gateway
a.b.c.d = WAN ip address


eth1
192.168.5.25 = ip address
192.168.5.1 = gateway
e.f.g.h = WAN ip address


In the past, when I ssh into one of our remote systems, I would
ssh me@ourRemoteSystem1.com
and there it would show that I was logging in from our a.b.c.d = WAN ip address

But now, when I ssh into one of our remote systems, I still
ssh me@ourRemoteSystem1.com
and now it shows that I was logging in from our e.f.g.h = WAN ip address


Both eth0 and eth1 have been around for a while...
Now it is using eth1 as the gateway/route.

I need to ssh me@ourRemoteSystem1.com
from our a.b.c.d = WAN ip address
How can I do that?
 
Old 07-11-2009, 08:26 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Did your default route setting change? What are the two gateway addresses for? You could add a route or even a host route so that the correct gateway is used.
 
Old 07-11-2009, 08:55 PM   #3
lothario
Member
 
Registered: Apr 2004
Posts: 340

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jschiwal View Post
Did your default route setting change? What are the two gateway addresses for? You could add a route or even a host route so that the correct gateway is used.
No, the default route setting did not change.

This is the "/etc/network/interfaces" file:

Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 192.168.5.25
netmask 255.255.255.0
gateway 192.168.5.1
There are 15 hosts are on the 192.168.2.* network

Recently, one host was added on the 192.168.5.* network

So now there are 2 hosts on the 192.168.5.* network.
Which means now there is some network traffic on the 192.168.5.* side and
with the above explicit "gateway 192.168.5.1" statement - could that be the cause of the different default gateway?
 
Old 07-12-2009, 12:52 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Enter the /sbin/route command. What is the default gateway? The one for the 0.0.0.0 network?
 
Old 07-12-2009, 01:19 AM   #5
lothario
Member
 
Registered: Apr 2004
Posts: 340

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jschiwal View Post
Enter the /sbin/route command. What is the default gateway? The one for the 0.0.0.0 network?
There are 2 default gateways.

Code:
default         192.168.5.1     0.0.0.0         UG    100    0        0 eth1
default         192.168.2.1     0.0.0.0         UG    100    0        0 eth0
 
Old 07-13-2009, 04:44 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If you want the gateway to be 192.168.2.1 on eth0, then I think you want to remove the "gateway 192.168.5.1" line from the interfaces file. I believe you will still have a route for the 192.168.5.0 network.
The 192.168.2.1 default gateway is being set by the DHCP client.
 
  


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
Eth0 using DHCP and eth1 using static ip: eth0 receive internal ip not the router ip geraldomanaus Linux - Networking 3 04-23-2008 03:00 PM
howto acess intrnet thru eth1(wireless card)in winXP via briging in linux(eth0-eth1) labhesh_popli Linux - Wireless Networking 1 09-21-2006 01:11 AM
Firewall WAN eth0 LAN eth1 self-bridges, eth0 does all routeing. Nichole_knc Linux - Networking 5 07-29-2004 02:33 PM
eth1 added, mysql connections FROM this machine are from eth1. Need bound to eth0??? kreese Linux - Networking 9 03-31-2004 12:12 PM
Kernel 2.4.22 finds eth0 and eth1 but 2.6.0 does not find eth1 coollink Linux - Networking 3 01-13-2004 07:32 PM

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

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