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

add kitchen test case with IPv6 addresses #158

Open
nusenu opened this issue Apr 10, 2018 · 3 comments
Open

add kitchen test case with IPv6 addresses #158

nusenu opened this issue Apr 10, 2018 · 3 comments

Comments

@nusenu
Copy link
Owner

nusenu commented Apr 10, 2018

Lets add a test case with IPv6 addresses by copying and extending t-guard-2publicIPs
IPv6 documentation IP range
https://tools.ietf.org/html/rfc3849

@nusenu
Copy link
Owner Author

nusenu commented Apr 10, 2018

+  - name: t-guard-IPv6
+    driver:
+      network:
+      - ["private_network", {ip: "192.0.2.10"}]
+      - ["private_network", {ip: "198.51.100.10"}]
+      - ["private_network", {ip: "2001:db8::1"}]
+      - ["private_network", {ip: "2001:db8::2"}]
+    provisioner:
+      playbook: "test/integration/default/2publicIPs-guard-node.yml"
/usr/share/ruby/resolv-replace.rb:42:in `connect': Invalid argument - connect(2) for "fe80::ffff:ffff:ffff:ffff" port 80 (Errno::EINVAL)
	from /usr/share/ruby/resolv-replace.rb:42:in `connect'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/network_fix_ipv6.rb:56:in `block in call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/network_fix_ipv6.rb:46:in `each'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/network_fix_ipv6.rb:46:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/network.rb:123:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/clear_network_interfaces.rb:26:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/prepare_nfs_settings.rb:19:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/synced_folders.rb:87:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/synced_folder_cleanup.rb:28:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/synced_folders/nfs/action_cleanup.rb:25:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/prepare_nfs_valid_ids.rb:12:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb:49:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb:30:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/env_set.rb:19:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/provision.rb:80:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:15:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/set_name.rb:50:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `block in run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in `busy'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/call.rb:53:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `block in run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in `busy'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/call.rb:53:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `block in run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in `busy'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/call.rb:53:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/box_check_outdated.rb:79:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/match_mac_address.rb:19:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/discard_state.rb:15:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/import.rb:74:in `import'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/import.rb:13:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb:17:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/prepare_clone.rb:15:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/customize.rb:40:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `block in run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in `busy'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/call.rb:53:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `block in run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in `busy'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/call.rb:53:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `block in run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in `busy'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in `run'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:227:in `action_raw'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:202:in `block in action'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/environment.rb:592:in `lock'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:in `call'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:in `action'
	from /usr/share/vagrant/gems/gems/vagrant-2.0.2/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

VirtualBox 5.2.8

maybe this:
hashicorp/vagrant#6748
https://www.virtualbox.org/ticket/14855

@Lirt
Copy link
Contributor

Lirt commented Jun 9, 2018

I am afraid we can only try to work around this, since the issue is opened for 3 years in virtualbox.

I was thinking about easy workaround by disabling IPv6 autoconfiguration, but since the process fails before shell provisioning is started, I cannot do it like that:

sudo sysctl -w net.ipv6.conf.all.autoconf=0
sudo sysctl -w net.ipv6.conf.all.accept_ra=0

Another attempt with disabling IPv6 autoconfiguration I made was using VirtualBox customizations but I couldn't find something useful there.

This leads me worst possible workaround with provisioner and shell script which will assign IPv6 addresses to 2 already defined interfaces:

  - name: t-guard-IPv6
    driver:
      network:
      - ["private_network", {ip: "192.0.2.10"}]
      - ["private_network", {ip: "198.51.100.10"}]
    provisioner:
      playbook: "test/integration/default/2publicIPs-guard-node.yml"
Vagrant.configure("2") do |config|
  config.vm.provision "shell", inline: <<-SHELL
    netif_list=$(ls -1 /sys/class/net)
    for interf in ${netif_list}; do
        if ip address show dev "${interf}" | grep '192.0.2.10'; then
            ip address add "2001:db8::1/32" dev "${interf}"
        elif ip address show dev "${interf}" | grep '198.51.100.10'; then
            ip address add "2001:db8::2/32" dev "${interf}"
        fi
    done
  SHELL
end

@nusenu
Copy link
Owner Author

nusenu commented Jun 24, 2018

thanks for this! did you test it? for which platforms?

nusenu referenced this issue Jul 1, 2018
before this commit we used a single IP address for all tor instances
on a server for exiting if tor_dedicatedExitIP was enabled, with this
commit multiple exit IP addresses are used. By distributing the
traffic across multiple source IP addresses this should help reduce
the negative effects of bad traffic spoiling the source IP for many
tor users.

There are two cases to consider:
- user runs one tor instance per IP (tor_ports has one entry):
"loop_idx" can be directly used as an index to the tor_available_public_ipv4/6 arrays
- user runs two tor instances per IP (tor_ports has two entries):
in this case we need to mangle "loop_idx" before we used it as an index
to the IP address arrays

This change includes also the kitchen test suites for this feature:
t-exit-6publicIPs-dedicatedExitIP-2instPerIP
t-exit-6publicIPs-dedicatedExitIP-singleInstPerIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants