[Raspberry Pi Q&A, Help & Troubleshooting] rmystique:
So I have a wireguard server running on my pi and i can connect and get internet access just fine through the tunnel with my android, But when i start the openvpn client on the same pi (my goal is to use the openvpn vpn connection remotely and take advantage of the faster wireguard protocol and better battery life) i loose my connection, if i kill the openvpn client it comes right back. I know i must be missing something in the routing or firewal????????????

Also I have tried to get a connection to my actual modem ip at home and the ip of the openvpn connection, neither works when the client is up, which should i be using?

Here is the files that are related to my several week head scratching:

Ifconfig:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

inet 192.168.0.20 netmask 255.255.255.0 broadcast 192.168.0.255

inet6 fe80::6b31:9beb:583f:1ec5 prefixlen 64 scopeid 0x20<link>

ether b8:27:eb:00:a1:64 txqueuelen 1000 (Ethernet)

RX packets 14485 bytes 3150166 (3.0 MiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 7908 bytes 1530567 (1.4 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 2 bytes 78 (78.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 2 bytes 78 (78.0 B)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500

inet 10.200.0.118 netmask 255.255.255.255 destination 10.200.0.117

inet6 fe80::98fe:dd62:a12e:2694 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 10 bytes 840 (840.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 99 bytes 12253 (11.9 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wg0: flags=209<UP,POINTOPOINT,RUNNING,NOARP> mtu 1420

inet 10.6.0.1 netmask 255.255.255.0 destination 10.6.0.1

unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)

RX packets 869 bytes 130331 (127.2 KiB)

RX errors 40 dropped 1 overruns 0 frame 40

TX packets 847 bytes 557996 (544.9 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

iptables:

# Generated by iptables-save v1.8.2 on Mon Apr 6 20:53:16 2020

*filter

:INPUT ACCEPT [8014:1547896]

:FORWARD ACCEPT [0:0]

:eek:UTPUT ACCEPT [6373:567831]

-A FORWARD -i wg0 -j ACCEPT

-A FORWARD -o wg0 -j ACCEPT

-A FORWARD -i tun0 -o wg0 -j ACCEPT

-A FORWARD -i wg0 -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT

-A FORWARD -i tun0 -o wg0 -j ACCEPT

COMMIT

# Completed on Mon Apr 6 20:53:16 2020

# Generated by iptables-save v1.8.2 on Mon Apr 6 20:53:16 2020

*nat

:PREROUTING ACCEPT [5088:1190922]

:INPUT ACCEPT [2529:325397]

:eek:UTPUT ACCEPT [25:1850]

:POSTROUTING ACCEPT [25:1850]

-A POSTROUTING -s 10.6.0.0/24 -o tun0 -m comment --comment wireguard-nat-rule -j MASQUERADE

-A POSTROUTING -o tun0 -j MASQUERADE

-A POSTROUTING -o wg0 -j MASQUERADE

COMMIT

# Completed on Mon Apr 6 20:53:16 2020

wg0.conf:

[Interface]

PrivateKey = xxxx

Address = 10.6.0.1/24

ListenPort = 51820

PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o tun0 -j MASQUERADE

# begin rm

[Peer]

PublicKey = xxxx

PresharedKey = xxxx

AllowedIPs = 10.6.0.2/32

# end rm

Somebody must know hwat iswrong with this thing, please help end my suffering!