多路桥接网络不接受来自互联网的连接

多路桥接网络不接受来自互联网的连接

Ubuntu 20.04.3 LTS在 Multipass 中运行了一个虚拟机,我想通过路由器端口转发将其暴露给互联网。虚拟机正在使用桥接网络模式。如果我nc -l -p 8080在虚拟机中运行并监听端口,我可以看到从桥接网络内部发起的连接。但是从我的路由器转发的请求没有到达。

ubuntu@microk8s-vm:~$ ip a
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 55:54:00:ad:68:aa brd ff:ff:ff:ff:ff:ff
    inet 192.168.86.123/24 brd 192.168.86.255 scope global dynamic enp0s8
       valid_lft 81708sec preferred_lft 81708sec
    inet6 fd46:2d25:460a:436e:5054:ff:fead:68cb/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 1786sec preferred_lft 1786sec
    inet6 fe80::5054:ff:fead:68cb/64 scope link 
       valid_lft forever preferred_lft forever

我已经通过在主机上托管 Web 服务器并成功转发到其地址来测试端口转发。

如何允许外部连接虚拟机?

编辑:

tcpdump主机上发出请求时可能相关的行YouGetSignal 端口转发测试器

15:56:36.643672 IP 198.199.98.246.50138 > microk8s-vm.lan.http: Flags [S], seq 304495333, win 14600, options [mss 1460,sackOK,TS val 979766022 ecr 0,nop,wscale 8], length 0
15:56:36.643680 IP 198.199.98.246.50145 > microk8s-vm.lan.http: Flags [S], seq 2904338462, win 14600, options [mss 1460,sackOK,TS val 979766022 ecr 0,nop,wscale 8], length 0
15:56:37.644183 IP 198.199.98.246.50145 > microk8s-vm.lan.http: Flags [S], seq 2904338462, win 14600, options [mss 1460,sackOK,TS val 979766272 ecr 0,nop,wscale 8], length 0
15:56:37.649490 IP 198.199.98.246.50150 > microk8s-vm.lan.http: Flags [S], seq 3462120669, win 14600, options [mss 1460,sackOK,TS val 979766272 ecr 0,nop,wscale 8], length 0
15:56:38.643138 IP 198.199.98.246.50150 > microk8s-vm.lan.http: Flags [S], seq 3462120669, win 14600, options [mss 1460,sackOK,TS val 979766522 ecr 0,nop,wscale 8], length 0
15:56:40.652553 ARP, Request who-has microk8s-vm.lan tell 192.168.86.1, length 46
15:56:40.652670 ARP, Reply microk8s-vm.lan is-at xx:xx:xx:xx:xx:xx (oui Unknown), length 28

相关内容