AWS Lab 11 : EC2 Linux & RHEL 6.x multiple ENI (NIC) & different subnet

AWS Lab 11 : EC2 Linux & RHEL 6.x multiple ENI (NIC) & different subnet

Step:1 Create AMI Backup of your instance
Step:2 Created 3 x ENI’s on three different subnets with IP’s
Step:3 Attached 3 x ENI’s to your instance
Step:4 Configured network configuration file.
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1 –> vi ifcfg-eth1 and updated Device=eth1
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth2 –> vi ifcfg-eth2 and updated Device=eth2
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth3 –> vi ifcfg-eth3 and updated Device=eth3

Step:5 Configured default gateway for primary interface “eth0″
vi /etc/sysconfig/network
GATEWAYDEV=eth0 —> added this line *** (important)

Step:6 Restart network service
service network restart

Step:7 Create route tables:
cat /etc/iproute2/rt_tables
echo “# dual nic-gateway below” >> /etc/iproute2/rt_tables
echo “10 eth0table” >> /etc/iproute2/rt_tables
echo “20 eth1table” >> /etc/iproute2/rt_tables
echo “30 eth2table” >> /etc/iproute2/rt_tables
echo “40 eth3table” >> /etc/iproute2/rt_tables

Step: 8 Create static route tables entry and routing rules: (this takes care your configuration during reboot)
cd /etc/sysconfig/network-scripts

vi route-eth0
192.168.10.0 dev eth0 src 192.168.10.155 table eth0table
default via 192.168.10.1 dev eth0 table eth0table

vi route-eth1
192.168.20.0 dev eth1 src 192.168.20.155 table eth1table
default via 192.168.20.1 dev eth1 table eth1table

vi route-eth2
192.168.30.0 dev eth2 src 192.168.30.155 table eth2table
default via 192.168.30.1 dev eth2 table eth2table

vi route-eth3
192.168.20.0 dev eth3 src 192.168.20.155 table eth3table
default via 192.168.40.1 dev eth3 table eth3table

##RULE file
vi rule-eth0
from 192.168.10.0/24 table eth0table
to 192.168.10.1 table eth0table

vi rule-eth1
from 192.168.20.0/24 table eth1table
to 192.168.20.1 table eth1table

vi rule-eth2
from 192.168.30.0/24 table eth2table
to 192.168.30.1 table eth2table

vi rule-eth3
from 192.168.40.0/24 table eth3table
to 192.168.40.1 table eth3table

Step:9 Restart the network service (or) you can reboot and check
service network restart

Step:10 Verify from other system on network.
ping 192.168.10.155
ping 192.168.20.155
ping 192.168.30.155
ping 192.168.40.155

 

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>