I have a Ubuntu 20.04.3 LTS
VM in Multipass running which I want to expose to the internet via router port forwarding. The VM is using bridged network mode. If I run nc -l -p 8080
in the VM and listen to the port I can see connections initiated from within the bridged network. However requests which are forwarded from my router are not arriving.
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
I've tested the port-forwarding by hosting a web server on the host machine and forwarding to its address with success.
How can allow external connections through to the VM?
Edit:
Potentially relevant line from tcpdump
on the host machine when making a request from YouGetSignal Port Forwarding Tester
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