openSUSE Forums > Archives > SF Archives > ARCHIVES - Network/Internet » 2 Nics Need To Operate 2 Gateways

Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Network/Internet
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Network/Internet Questions regarding network or Internet configuration and use in SUSE Linux

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 30-May-2008, 09:28
onejdev
Guest
 
Posts: n/a
Default

Having a little trouble figuring this out. Maybe its lack of experience, maybe its lack of coffee, maybe I just need a second set of eyes to help me out with this. Here is the information I have and that I can give you.

I have 2 NIC cards in a SUSE machine running 10.2.

NIC 1 is assigned the IP address 10.220.0.205. Subnet is 255.255.252.0, gateway is 10.220.0.2
NIC 2 is assigned the IP address 10.70.6.10. Subnet is 255.255.0.0, gateway is 10.70.0.1

NIC 1 is identified as ifcfg-eth-id-00:17:a4:3b:0e:cb, here is what that file contains.

Quote:
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR='10.220.0.205'
MTU=''
NAME='Compaq NC7782 Gigabit Server Adapter (PCI-X, 10,100,1000-T)'
NETMASK='255.255.252.0'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='hotplug'
UNIQUE='JNkJ.RfYI5sfd_88'
USERCONTROL='no'
_nm_name='bus-pci-0000:02:02.1'
PREFIXLEN=''
[/b]
NIC 2 is identified as ifcfg-eth-bus-pci-0000:02:02.0 and here is what that file contains.

Quote:
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR='10.70.6.10'
MTU=''
NAME='Compaq NC7782 Gigabit Server Adapter (PCI-X, 10,100,1000-T)'
NETMASK='255.255.0.0'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='hotplug'
UNIQUE='LHB6.RfYI5sfd_88'
USERCONTROL='no'
_nm_name='bus-pci-0000:02:02.0'
PREFIXLEN=''
[/b]
my /etc/sysconfig/network/routes file is as follows:

Quote:
0.0.0.0 10.70.0.1 255.255.0.0 eth-bus-pci-0000:02:02.0
default 10.220.0.2 - -
[/b]
I need NIC 2 to have its gateway set to 10.70.0.1 so I can get access to the outside world for updates and remote access. Problem is, I know I am doing something wrong but feel that the easy solution is right infront of me but I just cant see it.

Any help or push in the right direction here would be greatly appreciated.

Thanks
  #2 (permalink)  
Old 30-May-2008, 09:47
ken_yap
Guest
 
Posts: n/a
Default

There is only one default gateway. What is the 10.70 network? An internal network? Is the 10.220 network the one with a route to the outside world? If so, then just set the default gateway to 10.220.0.2. You actually don't need the first line in /etc/sysconfig/routes. If you do

route -n

you will see that the route to the 10.70 network goes through that device and for the 10.220 network through the other device. That's implied when you set up a network interface with a netmask.

Of course you are asking, or should be, what is the meaning of the gateway 10.70.0.1. I would ask you then: gateway to what? If not another internal network, but also to the outside world and works equally well, then you have to make a choice of gateway.
  #3 (permalink)  
Old 30-May-2008, 10:11
onejdev
Guest
 
Posts: n/a
Default

the 10.220 network is internal to the organization
the 10.70 network is for me to VPN into the machine from my office.

A little background is that I am a vendor in a hospital. My server sits at 10.220.0.205, which is internal to the hospital. The hospital used to have a firewall on 10.220.0.1 (which was the old gateway) that had access to the outside world (this way I could pull down updates and access certain sites on the internet I needed for information on my server).

One of the network admins here at the hospital set the second nic on the server to 10.70.6.11 so I can access it via their VPN from my office.

So, I guess my question would be that if I set my default gateway to 10.70.0.1 (which gives me access to the outside world) would that disrupt any traffic internally on the 10.220.x network? If it won't interrupt traffic on the internal (220) network then I don't see a problem setting the default gateway to the 10.70.0.1 IP address.
  #4 (permalink)  
Old 30-May-2008, 10:17
ken_yap
Guest
 
Posts: n/a
Default

The way IP routing works is that specific routes take precedence over the default route. So if there is a rule (implied by the netmask, or explicit, in the routing config file) that says: for traffic going to the 10.220 network do this (use this device, or this gateway), you're fine.

Of course the gateway at 10.70.0.1 has to be instructed to do the right thing also.

The default route is, as you realise, the route of last resort, for any IP address not covered by a specific rule.
 

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2