Linux CentOS multiple default gateway for Virtual NIC interface
If your server needs to have multiple IP addresses on the same physical NIC, you need to create multiple Virtual Interfaces. For example, the default eth0 configuration will have an IP address from one network IP block, but you need to add another IP address, from a different IP block, with a different gateway.
Here are the steps to add multiple IP addresses with multiple default gateways on the same physical NIC:
Create a separate file in /etc/sysconfig/network-scripts called eth0:1 or eth0:2, etc. Increment for each new IP address. File location may be different depending on your OS version and environment. This path works for CentOS 5.5.
Paste the following information into the file; use your own MAC address, IP address and gateway information:
BOOTPROTO=none NAME="" GATEWAY=188.8.131.52 MACADDR="" DEVICE=eth0:1 NETMASK=255.255.255.0 MTU="" BROADCAST=184.108.40.206 ONPARENT=yes IPADDR=220.127.116.11 NETWORK=18.104.22.168 ONBOOT=yes
Save the file, and apply the new network config.