How to give 2 different gateway IP addresses for 2
different interfaces in same system ?

Answers were Sorted based on User's Feedback



How to give 2 different gateway IP addresses for 2 different interfaces in same system ?..

Answer / none

route add -net 192.168.2.0 netmask 255.255.255.0 gw
192.168.0.2 dev eth0


route add -net 192.168.1.0 netmask 255.255.255.0 gw
192.168.0.3 dev eth1

Is This Answer Correct ?    17 Yes 2 No

How to give 2 different gateway IP addresses for 2 different interfaces in same system ?..

Answer / fuzail usmani

Run ifconfig command.u got 2 interface with eth0 & eth1 name.


#ifconfig eth0 172.16.68.2 netmask 255.255.0.0 gw 172.16.68.1 up

#ifconfig eth1 192.168.0.2 netmask 255.255.255.0 gw
192.168.0.1 up

Is This Answer Correct ?    14 Yes 0 No

How to give 2 different gateway IP addresses for 2 different interfaces in same system ?..

Answer / ayyappan .m

route add -net 192.168.2.0 netmask 255.255.255.0 gw
192.168.0.2 dev eth0


route add -net 192.168.1.0 netmask 255.255.255.0 gw
192.168.0.3 dev eth1

This will work temporary, if you want to make as a permanent.
Create the file route-eth0 in
/etc/sysconfig/network-scripts/ make the entry
Or
Make the entry on /etc/rc.local

#cat /etc/sysconfig/network-scripts/ifcfg-eth0
#cat /etc/sysconfig/network-scripts/ifcfg-eth1

This two files ONBOOT=yes

#service network restart

Is This Answer Correct ?    13 Yes 1 No

How to give 2 different gateway IP addresses for 2 different interfaces in same system ?..

Answer / raj

In terminal----> "neat"----->Network
configuration------>display two ethernets cards (Eth0, Eth1)
select the cards and assign the ip-address,
netmask,gateway.----->save and exit restart the service

Is This Answer Correct ?    3 Yes 0 No

How to give 2 different gateway IP addresses for 2 different interfaces in same system ?..

Answer / mcmarc

open each device file in
/etc/sysconfig/network-scripts/ifcfg-eth0(1)

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Linux AllOther Interview Questions

tell me some of the Linux HotKeys do you know?

3 Answers  


How to load the old kernel without rebooting server

1 Answers  


Through ssh whole directory structure from / is shared regardless the user we have connected with ....... how do i prevent sharing ??

4 Answers   Tech Mahindra,


what is difference between inetd and xinetd

2 Answers  


Give a Linux shell command to find all files in a directory which contain ip addresses.

1 Answers   Amazon,


will u plz send me the complete steps of installation of red hat linux on intel's core 2 duo processor?

1 Answers  


In how many ways linux can be installed n explain th steps involved in installation in any of the method..?

1 Answers   IBM,


What text filter can you use to display a binary file in octal numbers?

1 Answers  


How to recover a deleted file in linux ?

5 Answers  


what is kernel panic error ? how will you fix it if you have face it after rebooting without the the help of rescue disk ?

2 Answers   Oracle,


What is the name and path of the main system log?

3 Answers  


My root password has been changed, how can i enter into the system without root password?

6 Answers  


Categories