Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP port forwarding not working, always falls back to TCP #8965

Closed
kivoli opened this issue Sep 12, 2017 · 3 comments
Closed

UDP port forwarding not working, always falls back to TCP #8965

kivoli opened this issue Sep 12, 2017 · 3 comments

Comments

@kivoli
Copy link

kivoli commented Sep 12, 2017

Vagrant version

~ % vagrant -v
Vagrant 2.0.0

Host operating system

Debian Stretch

Guest operating system

Debian Stretch — doesn’t really matter

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :
# vim: ft=ruby:sw=2:ts=2:ss=2:expandtab

Vagrant.configure("2") do |config|
  config.vm.synced_folder ".", "/vagrant", disabled: true
  config.vm.box = "debian/stretch64"
  config.vm.network 'forwarded_port', host: 6666, guest: 6666, protocol: 'udp'
end

Debug output

https://gist.github.com/kivoli/fae9019c8612e9e50e9f697da94e2983
Note: Remove VAGRANT_OLD_* and identifying information from output.

Expected behavior

Port 6666 should be forwarded for protocol UDP.

Actual behavior

Port 666 is forwarded for protocol TCP.

% netstat -lnp | grep 666
tcp        0      0 127.0.0.1:6666          0.0.0.0:*               LISTEN      12186/ssh           
tcp6       0      0 ::1:6666                :::*                    LISTEN      12186/ssh  

Steps to reproduce

  1. Create new Vagrant environment
cd $(mktemp -d) && cat >Vagrantfile <<EOF
# -*- mode: ruby -*-
# vi: set ft=ruby :
# vim: ft=ruby:sw=2:ts=2:ss=2:expandtab

Vagrant.configure("2") do |config|
  config.vm.synced_folder ".", "/vagrant", disabled: true
  config.vm.box = "debian/stretch64"
  config.vm.network 'forwarded_port', host: 6666, guest: 6666, protocol: 'udp'
end
EOF
  1. Run vagrant up
  2. Check port forwardings netstat -lnp | grep 6666

References

Example from the documentation doesn’t work either.

@kivoli
Copy link
Author

kivoli commented Sep 12, 2017

A colleague pointed out that this may be up to the provider (libvirt) - checking this now; I though Vagrant is always using SSH to forward ports and that it is provider independent.

@kivoli
Copy link
Author

kivoli commented Sep 12, 2017

Working with VirtualBox provider, seems to be a libvirt issue. Opened vagrant-libvirt#812.

@kivoli kivoli closed this as completed Sep 12, 2017
@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@hashicorp hashicorp locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant