LinuxQuestions.org
Review your favorite Linux distribution.
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 10-24-2002, 01:49 PM   #1
def1014
Member
 
Registered: Apr 2002
Distribution: Red Hat 6.1,7.2,7.3 Mandrake 8.1,8.2
Posts: 48

Rep: Reputation: 15
Question 2 Gateways


How can I add a different gateway for a secondary NIC. I think I have set ip, but shouldn't it be showing when I do a netstat -rn? Would it be listed on there like the primary one is? What file is this Kernel routing information generated from? Thanks in advance.
 
Old 10-24-2002, 02:59 PM   #2
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
Re: 2 Gateways

Quote:
How can I add a different gateway for a secondary NIC.
In /etc/sysconfig/network-scripts/ifcfg-eth0 you have a layout that is like
Code:
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.2
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
So just add GATEWAY=<IP> there, for instance
Code:
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.2
GATEWAY=192.168.0.1
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
 
Old 10-24-2002, 03:30 PM   #3
def1014
Member
 
Registered: Apr 2002
Distribution: Red Hat 6.1,7.2,7.3 Mandrake 8.1,8.2
Posts: 48

Original Poster
Rep: Reputation: 15
yes the information is correct in those files. But shouldn't it be listed w/ netstat -rn?
[root@intranet network-scripts]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.1.31.0 0.0.0.0 255.255.255.0 U 40 0 0 eth1
10.1.31.0 0.0.0.0 255.255.255.0 U 40 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo
0.0.0.0 10.1.31.253 0.0.0.0 UG 40 0 0 eth0
 
Old 10-24-2002, 06:21 PM   #4
nonamenobody
Member
 
Registered: Oct 2002
Posts: 138

Rep: Reputation: 22
You should be able to have two gateways, boot I imagine they would need to be on different subnets (i.e. 192.168.0.x and 192.168.1.x with some kind of routing between the two subnets).
 
  


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
Two gateways? candyman123 Linux - Networking 1 09-08-2005 01:36 PM
multiple gateways efm Linux - Newbie 4 06-10-2005 09:50 AM
Multiple Gateways Jon Doe Linux - Networking 9 03-07-2005 04:26 PM
Gateways Esmo2000 Linux - Networking 1 01-03-2005 03:49 PM
2 Gateways Equis Linux - Networking 1 11-15-2003 04:58 AM


All times are GMT -5. The time now is 09:50 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration