I want to find the gateway of interface bondeth4. From ifconfig o/p i can see that the ip is showing "10.217.49.23", & from /etc/sysconfig/network-scripts/ifcfg-bondeth4 the gateway is 10.217.202.1. But from route o/p the gateway is showing default gateway i.e 10.217.198.1. if u can help me to find out the current gateway of bondeth4
You cannot find the gateway from looking at a tcp/ip address and network mask. It is usually the IP address of your router. Your IP and netmask defines a usable IP range of 10.217.48.1 to 10.217.63.254. Your default gateway will have to be within that range to be usable.
Now what else require.Another thing, how i will add the gateway with this bondeth4. Because the new gw what i will mention in the ifcfg-bondeth4 will be effective when i will reboot the server or service network restart ..
Restarting the network service will not disrupt existing connections that use the same network settings. If you need to work with only a particular interface for experimenting without changing permanent settings, use the ifconfig and route command. For instance:
ifconfig bondeth4 down
ifconfig bondeth4 10.217.202.18 netmask 255.255.255.0 up
route add default gw 10.217.202.1 bondeth4