Home network: Difference between revisions
Jump to navigation
Jump to search
Created page with "=Béziers= SFR's IPv4 is currently being unreliable due to congestion. We are routing all traffic via IPv6 and SSH on a SOCKS5 proxy to Psiren. * Configure [https://launchp..." |
|||
| Line 19: | Line 19: | ||
* badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:8080 --udpgw-remote-server-addr 127.0.0.1:7300 | * badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:8080 --udpgw-remote-server-addr 127.0.0.1:7300 | ||
* route add default gw 10.0.0.2 metric 6 # 6 is a lower metric than the regular default gateway | * route add default gw 10.0.0.2 metric 6 # 6 is a lower metric than the regular default gateway | ||
However, create the file ''/etc/network/if-up.d/ipv6'' with the contents: | |||
<pre> | |||
#!/bin/bash | |||
# Route all traffic to Psiren | |||
date >> /var/log/upwahoo | |||
echo $IFACE >> /var/log/upwahoo | |||
echo $MODE >> /var/log/upwahoo | |||
echo $ADDRFAM >> /var/log/upwahoo | |||
echo Blah >> /var/log/upwahoo | |||
echo Moose >> /var/log/upwahoo | |||
# Don't bother to restart sshd when lo is configured. | |||
if [ "$IFACE" = lo ]; then | |||
exit 0 | |||
fi | |||
# Only run from ifup. | |||
if [ "$MODE" != start ]; then | |||
exit 0 | |||
fi | |||
# Don't do anything if we've already configured tun0 | |||
FOUND=`grep "tun0" /proc/net/dev` | |||
if [ -n "$FOUND" ] ; then | |||
exit 0 | |||
fi | |||
echo DoStuff >> /var/log/upwahoo | |||
# Set up tun2socks info | |||
ip tuntap add dev tun0 mode tun user tun2socks | |||
ifconfig tun0 10.0.0.1 netmask 255.255.255.0 | |||
route add default gw 10.0.0.2 metric 6 # 6 is a lower metric than the regular default gateway | |||
echo 1 > /proc/sys/net/ipv4/ip_forward | |||
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE | |||
iptables -P FORWARD ACCEPT | |||
# This is Psiren over IPv6 | |||
(su marc -c "ssh -f -N -v marc@2a03:9da0:4:3c::2 -D 0.0.0.0:8080") | |||
(su tun2socks -c "badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:8080 --udpgw-remote-server-addr 127.0.0.1:7300 > /var/log/tun2socks.log") & | |||
exit 0 | |||
</pre> | |||
And on Psiren: | And on Psiren: | ||
* /home/marc/badvpn-master/udpgw --listen-addr 127.0.0.1:7300 | * /home/marc/badvpn-master/udpgw --listen-addr 127.0.0.1:7300 | ||
Latest revision as of 16:12, 17 August 2019
Béziers
SFR's IPv4 is currently being unreliable due to congestion.
We are routing all traffic via IPv6 and SSH on a SOCKS5 proxy to Psiren.
- Configure Tun2socks PPA on Ubuntu
- Setup Tun2socks
- Build the full badvpn-master on Psiren for UDP proxying
The commands we are using on our home router are:
- echo 1 > /proc/sys/net/ipv4/ip_forward
- iptables -t nat -A POSTROUTING -o eno1 -j MASQUERADE
- iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
- iptables -P FORWARD ACCEPT
- sudo ip tuntap add dev tun0 mode tun user marc
- sudo ifconfig tun0 10.0.0.1 netmask 255.255.255.0
- badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:8080 --udpgw-remote-server-addr 127.0.0.1:7300
- route add default gw 10.0.0.2 metric 6 # 6 is a lower metric than the regular default gateway
However, create the file /etc/network/if-up.d/ipv6 with the contents:
#!/bin/bash # Route all traffic to Psiren date >> /var/log/upwahoo echo $IFACE >> /var/log/upwahoo echo $MODE >> /var/log/upwahoo echo $ADDRFAM >> /var/log/upwahoo echo Blah >> /var/log/upwahoo echo Moose >> /var/log/upwahoo # Don't bother to restart sshd when lo is configured. if [ "$IFACE" = lo ]; then exit 0 fi # Only run from ifup. if [ "$MODE" != start ]; then exit 0 fi # Don't do anything if we've already configured tun0 FOUND=`grep "tun0" /proc/net/dev` if [ -n "$FOUND" ] ; then exit 0 fi echo DoStuff >> /var/log/upwahoo # Set up tun2socks info ip tuntap add dev tun0 mode tun user tun2socks ifconfig tun0 10.0.0.1 netmask 255.255.255.0 route add default gw 10.0.0.2 metric 6 # 6 is a lower metric than the regular default gateway echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE iptables -P FORWARD ACCEPT # This is Psiren over IPv6 (su marc -c "ssh -f -N -v marc@2a03:9da0:4:3c::2 -D 0.0.0.0:8080") (su tun2socks -c "badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:8080 --udpgw-remote-server-addr 127.0.0.1:7300 > /var/log/tun2socks.log") & exit 0
And on Psiren:
- /home/marc/badvpn-master/udpgw --listen-addr 127.0.0.1:7300