I have launched a EC2 instance having OS Ubuntu 22.04 which has a primary interface ens5
I have attached a secondary Interface ens6.
This is the output of ifconfig -a
root@ip-172-31-7-213:/home/ubuntu# ifconfig -a
ens5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001
inet 172.31.7.213 netmask 255.255.240.0 broadcast 172.31.15.255
inet6 fe80::879:bdff:fe2d:2a5e prefixlen 64 scopeid 0x20<link>
ether 0a:79:bd:2d:2a:5e txqueuelen 1000 (Ethernet)
RX packets 19401 bytes 27879459 (27.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4460 bytes 419785 (419.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens6: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 0a:12:bc:bf:55:7c txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
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 142 bytes 15766 (15.7 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 142 bytes 15766 (15.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Output of /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
ens5:
dhcp4: true
dhcp6: false
match:
macaddress: 0a:79:bd:2d:2a:5e
set-name: ens5
version: 2
I tried to make changes in the above config as:
network:
version: 2
ethernets:
ens5:
dhcp4: true
dhcp6: false
match:
macaddress: 0a:79:bd:2d:2a:5e
set-name: ens5
ens6:
dhcp4: true
dhcp6: false
match:
macaddress: 0a:12:bc:bf:55:7c
set-name: ens6
But I lost my SSH connection & later after rebooting it never worked. Can someone please help me how can I configure this.
T.I.A