2

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
Justin Oroz
  • 121
  • 5
  • The VM driver is Virtual Box using bridged network mode. – Justin Oroz Mar 01 '22 at 05:13
  • If this comment is more info for the question please edit the question and put the info there not as a comment. – David Mar 02 '22 at 06:05
  • Hi Justin, what's your host? It would be interesting to know if the external packets arrive at your host at all. `tcpdump` would be a good choice on macOS, there's likely a similar tool for Windows. – Saviq Mar 03 '22 at 13:56
  • The host machine is macOS. I'm not familiar with `tcpdump` so I'm not sure what I'm looking for. greping for my VM and an in network machine I can see activity when requesting from in the network. There is so much activity from the VM it is hard to determine what is happening when attempting to look for external connections. – Justin Oroz Mar 05 '22 at 23:55
  • @Saviq I've edited the question to add some potentially relevant lines – Justin Oroz Mar 06 '22 at 23:04
  • I ended up just dropping multipass and microk8s in favor of Docker Desktop's built-in Kubernetes which didn't have this problem. The switch to the qemu driver as default was causing the VMs to crash. – Justin Oroz Sep 08 '22 at 21:08

0 Answers0