I just switched from Leap 15.1 to Tumbleweed. Until now I used following procedure to create a vpn tunnel for a single application:
ip netns add dvpn
ip netns exec dvpn ip addr add 127.0.0.1/8 dev lo
ip netns exec dvpn ip link set lo up
ip link add vpn0 type veth peer name vpn1
ip link set vpn0 up
ip link set vpn1 netns dvpn up
ip addr add 10.200.200.1/24 dev vpn0
ip netns exec dvpn ip addr add 10.200.200.2/24 dev vpn1
ip netns exec dvpn ip route add default via 10.200.200.1 dev vpn1
iptables -A INPUT \! -i vpn0 -s 10.200.200.0/24 -j DROP
iptables -t nat -A POSTROUTING -s 10.200.200.0/24 -o e+ -j MASQUERADE
sysctl -q net.ipv4.ip_forward=1
mkdir -p /etc/netns/dvpn
echo 'nameserver 8.8.8.8' > /etc/netns/dvpn/resolv.conf
ip netns exec dvpn openvpn --config test.conf
This worked fine in Leap 15.1. I tried it now in Leap 15.2 and under Tumbleweed and I get a “No route to host” error message. A ping however works fine
ip netns exec dvpn ping -c 3 www.google.com
PING www.google.com (172.217.12.4) 56(84) bytes of data.
64 bytes from den02s02-in-f4.1e100.net (172.217.12.4): icmp_seq=1 ttl=111 time=262 ms
64 bytes from den02s02-in-f4.1e100.net (172.217.12.4): icmp_seq=2 ttl=111 time=261 ms
64 bytes from den02s02-in-f4.1e100.net (172.217.12.4): icmp_seq=3 ttl=111 time=262 ms
--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 261.769/262.076/262.371/0.484 ms
Does anyone know what has changed that within the namespace the routing is not working anymore?
Any help is appreciated.
Starting firewalld most likely removes all your rules (including masquerading) added before, stopping firewalld is not going to add them back. Did you actually check what rules are present?
You are right. When I start the firewall I lose all my masquerading rules. When I stop the firewall remove the namespace with
ip netns delete dvpn
and set it up again, it works again.
But what firewall rules do I have to add to let the namespace traffic go through the firewall?
How can I see if the outgoing or the incoming traffic is blocked?