Hi,
firstoff, I know this question has been asked at least once, but I just cant figure out what to do.
I am trying to setup openVPN client and server on the same machine(Rpi), I want all traffic from the raspberry (Downloads etc) go through the paid VPN, but I want to connect to the VPN server using my Providers static IP.
I read something about policy based routing and tried some commands, but I have no clue what I am actually doing, so before I lock myself out of my system I wanted to ask whats the right way to do it.
ifconfig -a:
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:96ff:fe71:7e23 prefixlen 64 scopeid 0x20<link>
ether 02:42:96:71:7e:23 txqueuelen 0 (Ethernet)
RX packets 842 bytes 99137 (96.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 742 bytes 182623 (178.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.116.5.111 netmask 255.255.255.0 broadcast 10.116.5.255
inet6 fe80::dea6:32ff:fe2d:1ed4 prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:2d:1e:d4 txqueuelen 1000 (Ethernet)
RX packets 4668 bytes 1086180 (1.0 MiB)
RX errors 0 dropped 302 overruns 0 frame 0
TX packets 8420 bytes 9679973 (9.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 365 bytes 139153 (135.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 365 bytes 139153 (135.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.8.0.1 netmask 255.255.255.0 destination 10.8.0.1
inet6 fe80::cd4a:266c:ba31:841e prefixlen 64 scopeid 0x20<link>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9 bytes 606 (606.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
tun1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.8.3.5 netmask 255.255.255.0 destination 10.8.3.5
inet6 fe80::a1b0:2b44:561d:e480 prefixlen 64 scopeid 0x20<link>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 351 bytes 75354 (73.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 458 bytes 53418 (52.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth1e7c2d3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::cc7:aeff:fed8:9e44 prefixlen 64 scopeid 0x20<link>
ether 0e:c7:ae:d8:9e:44 txqueuelen 0 (Ethernet)
RX packets 344 bytes 42249 (41.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 343 bytes 77767 (75.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth7d84996: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::fc22:edff:fe6d:b78e prefixlen 64 scopeid 0x20<link>
ether fe:22:ed:6d:b7:8e txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 103 bytes 21175 (20.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth854671b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::9442:c8ff:fe82:6f59 prefixlen 64 scopeid 0x20<link>
ether 96:42:c8:82:6f:59 txqueuelen 0 (Ethernet)
RX packets 498 bytes 68676 (67.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 502 bytes 129193 (126.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Iptables:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION-STAGE-1 all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain DOCKER (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 172.17.0.2 tcp dpt:9000
ACCEPT tcp -- anywhere 172.17.0.2 tcp dpt:8000
ACCEPT tcp -- anywhere 172.17.0.3 tcp dpt:http-alt
ACCEPT tcp -- anywhere 172.17.0.4 tcp dpt:3129
ACCEPT tcp -- anywhere 172.17.0.3 tcp dpt:6881
ACCEPT udp -- anywhere 172.17.0.3 udp dpt:6881
Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target prot opt source destination
DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-ISOLATION-STAGE-2 (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
thanks,
Donnerbraten