User Tools

Site Tools


vpn-ssh-tap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
vpn-ssh-tap [2020/07/25 00:12]
robm created
vpn-ssh-tap [2020/07/25 12:28]
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:
  
-<code> +  * ''bridge monitor'' 
-bridge monitor +  * ''watch ip --brief address'' 
-</code>+  * ''watch ip --brief link'' 
 +  * ''watch bridge link'' 
  
 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:
  
 <code> <code>
-ip link add br0 type bridge up +ip link add br0 up type bridge             # Create a bridge 
-ip link add br0 up type bridge +ip address add 192.168.167.134/24 dev br0  # Copy the address and netmask of eth1 
-dhclient -r eth1 && ip link set eth1 master br0 && dhclient br0 +ip address flush dev eth1                  # Remove eth1's addresses completely 
-ip link set eth1 down +ip link set eth1 master br0                # Attach eth1 to the bridge
-ip link set eth1 up+
 </code> </code>
  
Line 20: Line 21:
  
 <code> <code>
-ip link add br0 type bridge +VM_HOST=192.168.167.237 
-ip link del br0 +sudo ip link add br0 up type bridge 
-ip link add br0 up type bridge +sudo ip link set eth0 up master br0 
-ssh -o PermitLocalCommand=yes -o "LocalCommand=ip link set tap5 up master br0" -o Tunnel=ethernet -w 5:5 -t root@192.168.167.237 "ip link set tap5 up master br0"+sudo ssh \ 
 +  -o PermitLocalCommand=yes 
 +  -o "LocalCommand=ip link set tap5 up master br0" 
 +  -o Tunnel=ethernet 
 +  -w 5:5 
 +  -t 
 +  root@${VM_HOST} \ 
 +  "ip link set tap5 up master br0"
 </code> </code>
 +
 +===== Debugging =====
 +
 +I found [[https://www.wireshark.org/docs/man-pages/tshark.html| tshark - Dump and analyze network traffic]] useful, as it can capture ethernet frames to a file (such as ''/vagrant/tshark'') which you can then load into the Wireshark GUI after the fact.
vpn-ssh-tap.txt · Last modified: 2020/08/06 11:48 by robm