so today I got 3 Access Servers, and downloaded the config for all 3 of them. Then on my raspberry I ran 3 instances of openvpn (even with a different subnet configured in the Access Servers) with each of the config files.
My goal is to be able to route incoming traffic to individual devices, e.g. IP_of_Access_Server_1 leads to Client_1 in my network, IP_of_Access_Server_2 leads to Client_2 etc. That's why I have individual instances. For the rest I have 3 entries in my iptables:
The instances seem to start fine, but only 1 instance is really active, so e.g. I can only open the service on Client_1, the others will time out. And it's always the last instance I start, that works.sudo iptables -t nat -A PREROUTING -p tcp -d 172.27.232.0/20 --dport 44000 -j DNAT --to-destination 192.168.4.3:44000
sudo iptables -t nat -A PREROUTING -p tcp -d 172.27.248.0/20 --dport 44000 -j DNAT --to-destination 192.168.4.4:44000
sudo iptables -t nat -A PREROUTING -p tcp -d 172.27.200.0/20 --dport 44000 -j DNAT --to-destination 192.168.4.16:44000
So, my guess here is, that the route entries get overwritten by the LZ0 commands that the Access Server pushes on start, to something that makes the other 2 not work anymore.
Here is the output of route, when only Device_2 over Access Server 2 is reachable:
Code: Select all
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.27.248.1 128.0.0.0 UG 0 0 0 tun1
default fritz.box 0.0.0.0 UG 202 0 0 eth0
46.101.139.3 fritz.box 255.255.255.255 UGH 0 0 0 eth0
128.0.0.0 172.27.248.1 128.0.0.0 UG 0 0 0 tun1
159.65.121.31 fritz.box 255.255.255.255 UGH 0 0 0 eth0
159.89.109.12 fritz.box 255.255.255.255 UGH 0 0 0 eth0
172.27.200.0 0.0.0.0 255.255.248.0 U 0 0 0 tun2
172.27.232.0 0.0.0.0 255.255.248.0 U 0 0 0 tun0
172.27.248.0 0.0.0.0 255.255.248.0 U 0 0 0 tun1
192.168.1.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
192.168.4.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0
Code: Select all
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.27.232.1 128.0.0.0 UG 0 0 0 tun0
default fritz.box 0.0.0.0 UG 202 0 0 eth0
46.101.139.3 fritz.box 255.255.255.255 UGH 0 0 0 eth0
128.0.0.0 172.27.232.1 128.0.0.0 UG 0 0 0 tun0
159.65.121.31 fritz.box 255.255.255.255 UGH 0 0 0 eth0
159.89.109.12 fritz.box 255.255.255.255 UGH 0 0 0 eth0
172.27.200.0 0.0.0.0 255.255.248.0 U 0 0 0 tun2
172.27.232.0 0.0.0.0 255.255.248.0 U 0 0 0 tun0
172.27.248.0 0.0.0.0 255.255.248.0 U 0 0 0 tun1
192.168.1.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
192.168.4.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0