Skip to content

Instantly share code, notes, and snippets.

@varvaruc
Created November 14, 2013 11:42
Show Gist options
  • Save varvaruc/7465440 to your computer and use it in GitHub Desktop.
Save varvaruc/7465440 to your computer and use it in GitHub Desktop.
--VLT1
--ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.0.0.1
GATEWAY=10.0.0.254
NETMASK=255.255.255.0
NETWORK=10.0.0.0
DNS1=81.180.223.1
DNS2=81.180.222.254
HWADDR=
--ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.1.0.254
NETMASK=255.255.255.0
NETWORK=10.1.0.0
DNS1=81.180.223.1
DNS2=81.180.222.254
HWADDR=
--ifcfg-eth2
DEVICE=eth2
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.2.0.254
NETMASK=255.255.255.0
NETWORK=10.2.0.0
DNS1=81.180.223.1
DNS2=81.180.222.254
HWADDR=
--VLT2
--ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.1.0.1
GATEWAY=10.1.0.254
NETMASK=255.255.255.0
NETWORK=10.1.0.0
DNS1=81.180.223.1
DNS2=81.180.222.254
HWADDR=
--VLG1
--ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.2.0.1
GATEWAY=10.2.0.254
NETMASK=255.255.255.0
NETWORK=10.2.0.0
DNS1=81.180.223.1
DNS2=81.180.222.254
HWADDR=
--iptables VLT1
vi /etc/sysctl.conf forward -> 1
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth2 -o eth0 -j ACCEPT
iptables-save > /etc/sysconfig/iptables
service iptables restart
--host machine
--debian/ubuntu /etc/network/interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth0.2
iface eth0.2 inet static
vlan-raw-device eth0
address 10.0.0.254
netmask 255.255.255.0
hwaddress 00:23:42:AF:12:67
@varvaruc
Copy link
Author

ping to eth0 on host machine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment