Physical Device == eth0
Virtual Device == eth0:1
Edit "/etc/network/interfaces" File
# vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0 eth0:1
iface eth0 inet dhcp
iface eth0:1 inet static
address 200.0.0.200
netmask 255.255.255.0
###To restore Iptable Rules After reboot ###
pre-up iptables-restore < /etc/iptables.rules
#
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# iptables -A FORWARD -i eth0:1 -j ACCEPT
# iptables-save > /etc/iptables.rules
# vi /etc/sysctl.conf
net.ipv4.ip_forward=1
#
# sysctl -p
# reboot
On Client Machine set gateway as ipaddress of eth0:1 i.e, 200.0.0.200
Virtual Device == eth0:1
Edit "/etc/network/interfaces" File
# vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0 eth0:1
iface eth0 inet dhcp
iface eth0:1 inet static
address 200.0.0.200
netmask 255.255.255.0
###To restore Iptable Rules After reboot ###
pre-up iptables-restore < /etc/iptables.rules
#
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# iptables -A FORWARD -i eth0:1 -j ACCEPT
# iptables-save > /etc/iptables.rules
# vi /etc/sysctl.conf
net.ipv4.ip_forward=1
#
# sysctl -p
# reboot
On Client Machine set gateway as ipaddress of eth0:1 i.e, 200.0.0.200