https://rancher.com/ logo
Title
f

future-pharmacist-1236

06/16/2022, 12:32 AM
Anyone try to use
nerdctl
with a
-p <port>:<port>/udp
and not get UDP port exposed. I’m not sure why? I’m trying to figure that out if anyone knows?
f

fast-garage-66093

06/16/2022, 3:08 AM
What platform are you on? I think this should work on macOS over the bridged interface. It will not work on the forwarded ports on localhost because SSH port forwarding doesn't support UDP. It will not work right now on Linux, and I'm not sure about Windows, but I suspect it won't work there either
f

future-pharmacist-1236

06/16/2022, 3:34 AM
I'm on macOS, how do I use this bridged interface you speak of?
-
f

fast-garage-66093

06/16/2022, 3:38 AM
You better change this password now 😄
👍 1
Check the IP address of the
rd0
interface
$ rdctl shell ip a show rd0
4: rd0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:55:55:e4:bb:a3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.18.119/16 scope global rd0
       valid_lft forever preferred_lft forever
    inet6 fe80::5055:55ff:fee4:bba3/64 scope link
       valid_lft forever preferred_lft forever
Then bind the port on that IP address, e.g.
$ nerdctl run -d -p 192.168.18.119:80:80 nginx
This interface connects directly to the local network, so is externally routable as well, and it should support UDP as well, as there is no port forwarding involved
f

future-pharmacist-1236

06/16/2022, 3:40 AM
I'll give it a try soon
f

fast-garage-66093

06/16/2022, 3:40 AM
f

future-pharmacist-1236

06/16/2022, 3:40 AM
thanks
f

fast-garage-66093

06/16/2022, 3:41 AM
This is a Lima diagram, but it applies here too. The internal network is
eth0
, the bridged network is
rd0
and the shared network is
rd1
.
There are some situation when the bridged network cannot be created because the local network doesn't allow you to expose 2 IP addresses on the same MAC address. In that case you will have to try
rd1
, but as you can see, it is NATed inside the host, so not accessible from outside your machine.
f

future-pharmacist-1236

06/16/2022, 3:48 AM
Thanks for the detail, I did a fair amount of analysis before asking for help and the diagram and your comments really pulled together all the work I did to figure it out on my own. I almost got to the point of tunneling UDP over TCP to get my setup to work, but I'm glad I asked a question instead.
f

fast-garage-66093

06/16/2022, 3:49 AM
Great, I hope this works for you!
f

future-pharmacist-1236

06/16/2022, 4:11 AM
It did. It works.
👍 1