This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
vpn-ssh-tap [2020/07/25 00:12] robm created |
vpn-ssh-tap [2020/08/06 11:48] (current) robm [VPN via SSH TAP interfaces] |
||
---|---|---|---|
Line 3: | Line 3: | ||
Useful to run the following on both local and remote, to get a sense of what's happening: | Useful to run the following on both local and remote, to get a sense of what's happening: | ||
- | < | + | * '' |
- | bridge monitor | + | * '' |
- | </ | + | * '' |
+ | * '' | ||
VM, where eth1 is connected to the network I want to make my RPi appear in: | VM, where eth1 is connected to the network I want to make my RPi appear in: | ||
+ | |||
+ | Vagrantfile (based on using [[https:// | ||
< | < | ||
- | ip link add br0 type bridge up | + | # -*- mode: ruby -*- |
- | ip link add br0 up type bridge | + | # vi: set ft=ruby : |
- | dhclient | + | |
- | ip link set eth1 down | + | |
- | ip link set eth1 up | + | |
- | </ | + | |
- | Raspberry Pi: | + | BRIDGE_ADAPTORS=[ |
+ | "en0: Wi-Fi (AirPort)", | ||
+ | " | ||
+ | " | ||
+ | # Add your OS's default here | ||
+ | ] | ||
- | <code> | + | Vagrant.configure(" |
- | ip link add br0 type bridge | + | config.vm.box = " |
- | ip link del br0 | + | config.vm.network " |
- | ip link add br0 up type bridge | + | |
- | ssh -o PermitLocalCommand=yes -o " | + | config.vm.provider " |
+ | # Cf. http:// | ||
+ | prl.customize [" | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | prl.customize [" | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | end | ||
+ | |||
+ | config.vm.provision " | ||
+ | privileged: true, | ||
+ | inline: | ||
+ | # Secure Shell daemon configuration changes | ||
+ | echo " | ||
+ | echo " | ||
+ | systemctl reload sshd | ||
+ | |||
+ | # Root account is disabled by default (password begins with literal ' | ||
+ | # so we'll change the password to re-enable the account | ||
+ | usermod -p ' | ||
+ | |||
+ | # Install GadgetPi' | ||
+ | # requiring an operator | ||
+ | umask 0077 | ||
+ | mkdir / | ||
+ | echo " | ||
+ | " >> / | ||
+ | |||
+ | # Enable acting as a router (forwarding packets) | ||
+ | echo "" | ||
+ | echo " | ||
+ | sysctl --load / | ||
+ | SHELL | ||
+ | |||
+ | config.vm.post_up_message = << | ||
+ | Run the following on this VM: | ||
+ | |||
+ | ETH1_IP=192.168.167.100/ | ||
+ | sudo ip link add br0 up type bridge | ||
+ | sudo ip address add ${ETH1_IP} dev br0 # Copy the address and netmask of eth1 | ||
+ | sudo ip address flush dev eth1 # Remove eth1's addresses completely | ||
+ | sudo ip link set eth1 master | ||
+ | |||
+ | Run the following on the GadgetPi: | ||
+ | |||
+ | REMOTE_HOST=192.168.167.237 | ||
+ | | ||
+ | sudo ip link set eth0 up master br0 | ||
+ | sudo ssh \\ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | EOF | ||
+ | end | ||
</ | </ | ||
+ | ===== Debugging ===== | ||
+ | |||
+ | I found [[https:// |