I spoke a bit too soon It seems I had some part of example 1 there and that overruled basically everything.
my gateway address is 10.0.0.1, vpn client computers local lan address is 10.0.0.5.
ifconfig:
eth0 Link encap:Ethernet HWaddr 00:18:f3:74:ae:53
inet addr:10.0.0.5 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::218:f3ff:fe74:ae53/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2671049 errors:0 dropped:0 overruns:0 frame:0
TX packets:2476494 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2033808500 (2.0 GB) TX bytes:1899189601 (1.8 GB)
Interrupt:28 Base address:0xc000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:258924 errors:0 dropped:0 overruns:0 frame:0
TX packets:258924 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1171605779 (1.1 GB) TX bytes:1171605779 (1.1 GB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.71.0.26 P-t-P:10.71.0.25 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:2235403 errors:0 dropped:0 overruns:0 frame:0
TX packets:1858319 errors:0 dropped:665 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1826588443 (1.8 GB) TX bytes:856502953 (856.5 MB)
My ip route show
vpnpublic ip via 10.0.0.1 dev eth0
10.71.0.25 dev tun0 proto kernel scope link src 10.71.0.26
10.71.0.1 via 10.71.0.25 dev tun0
10.0.0.0/24 dev eth0 proto kernel scope link src 10.0.0.5 metric 1
169.254.0.0/16 dev eth0 scope link metric 1000
0.0.0.0/1 via 10.71.0.25 dev tun0
128.0.0.0/1 via 10.71.0.25 dev tun0
default via 10.0.0.1 dev eth0 proto static
ip route show table 100:
default via 10.0.0.1 dev eth0
I'm marking incoming ssh traffic like this:
iptables -A PREROUTING -t mangle -i eth0 -p tcp --dport 22 -j MARK --set-mark 1
ip rule show:
0: from all lookup local
32764: from all fwmark 0x1 lookup sshtable
32766: from all lookup main
32767: from all lookup default
Somehow the vpn client must be pushing everything through tun0 but I'm failing to understand how to make this exception work. I can see with tcpdump port 22 that when I try to connect to my routers public ip with ssh (not in vpn) it gets forwarded correctly to my lan ip 10.0.0.5 but the ack is not visible and my vpn client computer is receiving but either not sending or sending in the wrong place just dunno how to see where it's trying to send it.
So somehow I need to create a route that does not end up in tun0 interface