Details depicted here. But I see people still having trouble, so hope the screenshots here help a little more.
Check the details for limitations, each NIC must fall in a dedicated VPC
Now you good to go, this could be slightly different.
I have created my VPCs only in one region, so I simply create the VM in the same region too.
Here the VM's network configuration
remember to give it a network tag so we can use to configure firewalls. Keep adding network interfaces, you can assign both internal and external IPs as dynamic or static here.
You have to do this for all of your VPCs. Very important to specify the network tags for the VMs. Others simply set them according to your business needs.
This also could be various, here I launched a Ubuntu 18.04 LTS as an example
ens4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1430
inet 10.0.1.2 netmask 255.255.255.255 broadcast 10.0.1.2
inet6 fe80::4001:aff:fe00:102 prefixlen 64 scopeid 0x20<link>
ether 42:01:0a:00:01:02 txqueuelen 1000 (Ethernet)
RX packets 78524 bytes 9473601 (9.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 47349 bytes 3479093 (3.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1430
inet 10.0.2.2 netmask 255.255.255.255 broadcast 10.0.2.2
inet6 fe80::4001:aff:fe00:202 prefixlen 64 scopeid 0x20<link>
ether 42:01:0a:00:02:02 txqueuelen 1000 (Ethernet)
RX packets 14164 bytes 1466875 (1.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10606 bytes 1305289 (1.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1430
inet 10.0.3.2 netmask 255.255.255.255 broadcast 10.0.3.2
inet6 fe80::4001:aff:fe00:302 prefixlen 64 scopeid 0x20<link>
ether 42:01:0a:00:03:02 txqueuelen 1000 (Ethernet)
RX packets 7167 bytes 474351 (474.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5468 bytes 388269 (388.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens7: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1430
inet 10.0.4.2 netmask 255.255.255.255 broadcast 10.0.4.2
inet6 fe80::4001:aff:fe00:402 prefixlen 64 scopeid 0x20<link>
ether 42:01:0a:00:04:02 txqueuelen 1000 (Ethernet)
RX packets 6648 bytes 420457 (420.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5053 bytes 315408 (315.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 25528 bytes 3854468 (3.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 25528 bytes 3854468 (3.8 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Script to get the job done, leave primary NIC untouched.
#!/bin/bash -ex
#sudo ifconfig ens4 10.0.1.2 netmask 255.255.255.255 broadcast 10.0.1.2 mtu 1430
#echo "1 rt1" | sudo tee -a /etc/iproute2/rt_tables
#sudo ip route add 10.0.1.1 src 10.0.1.2 dev ens4 table rt1
#sudo ip route add default via 10.0.1.1 dev ens4 table rt1
#sudo ip rule add from 10.0.1.2/32 table rt1
#sudo ip rule add to 10.0.1.2/32 table rt1
sudo ifconfig ens5 10.0.2.2 netmask 255.255.255.255 broadcast 10.0.2.2 mtu 1430
echo "2 rt2" | sudo tee -a /etc/iproute2/rt_tables
sudo ip route add 10.0.2.1 src 10.0.2.2 dev ens5 table rt2
sudo ip route add default via 10.0.2.1 dev ens5 table rt2
sudo ip rule add from 10.0.2.2/32 table rt2
sudo ip rule add to 10.0.2.2/32 table rt2
sudo ifconfig ens6 10.0.3.2 netmask 255.255.255.255 broadcast 10.0.3.2 mtu 1430
echo "3 rt3" | sudo tee -a /etc/iproute2/rt_tables
sudo ip route add 10.0.3.1 src 10.0.3.2 dev ens6 table rt3
sudo ip route add default via 10.0.3.1 dev ens6 table rt3
sudo ip rule add from 10.0.3.2/32 table rt3
sudo ip rule add to 10.0.3.2/32 table rt3
sudo ifconfig ens7 10.0.4.2 netmask 255.255.255.255 broadcast 10.0.4.2 mtu 1430
echo "4 rt4" | sudo tee -a /etc/iproute2/rt_tables
sudo ip route add 10.0.4.1 src 10.0.4.2 dev ens7 table rt4
sudo ip route add default via 10.0.4.1 dev ens7 table rt4
sudo ip rule add from 10.0.4.2/32 table rt4
sudo ip rule add to 10.0.4.2/32 table rt4
Adjust this accordingly.
You done :) It's the time to check the connectivity.







