桥接Amazon EC2 Netplan(20.04)

I've been trying to create a bridge on my EC2 instance (Ubuntu 20.04) with netplan but I keep losing access to my machine. Currently attempting to disable ENA, but not sure if I'm simply missing something obvious. This seems similar to this issue.

我的“库存”配置如下:

network:
    ethernets:
        ens5:
            dhcp4: true
            dhcp6: false
            match:
                macaddress: **:**:**:**:**:**
            set-name: ens5
    version: 2

with ifconfig and ip a returning:

root@ip-*******:/etc/netplan# ifconfig
ens5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
        inet *******  netmask *******  broadcast *******
        inet6 *******  prefixlen 64  scopeid 0x20<link>
        ether *******  txqueuelen 1000  (Ethernet)
        RX packets 2711  bytes 531407 (531.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1934  bytes 306406 (306.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 277  bytes 22634 (22.6 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 277  bytes 22634 (22.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@ip-*******:/etc/netplan# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP group default qlen 1000
    link/ether ******* brd ff:ff:ff:ff:ff:ff
    inet *******/20 brd ******* scope global dynamic ens5
       valid_lft 3447sec preferred_lft 3447sec
    inet6 *******/64 scope link
       valid_lft forever preferred_lft forever

I tried bridging just by adding br0 and copying the macaddress over like they did here, but wasn't able to reconnect to the EC2 instance afterwards. Would really appreciate any advice, since I don't have much experience configuring networks at all. Thanks!

评论