Score:0

OpenVPN iptables forwading

us flag

Following setup:

openvpn server with public ip, mobile clients and at home a raspberry that act as vpn gateway. All mobile clients get a route from the openvpn server so that they I can connect into my homenetwork via openvpn, thats works fine.

But the openvpn server cant.

I think its a configuration problem with openvpn-server, but actually I have no idea what to do. The problem will be the entry in iptables, that replaces the vpn ip with the public ip when routing into my homenetwork.

server.conf:

local 217.X.X.X
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify crl.pem
explicit-exit-notify

client-config-dir ccd
client-to-client

route 192.168.82.0 255.255.255.0
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 8.8.8.8"

ccd/vpn-gw:

ifconfig-push 10.8.0.2 255.255.255.0
iroute 192.168.82.0 255.255.255.0
root@localhost:~# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
SNAT       all  --  10.8.0.0/24         !10.8.0.0/24          to:217.X.X.X

Tshark capture on vpn-gw

Capturing on 'eth0'
   31 5.133587788 192.168.82.3 → 217.X.X.X ICMP 98 Echo (ping) reply    id=0x0338, seq=1/256, ttl=64

Kindly suggest.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.