commands on archlinux-5.6
ip netns add myspace
ip link add veth0 type veth peer name veth1
ip link set veth1 netns myspace
ifconfig veth0 192.168.42.1 netmask 255.255.255.0 up
ip netns exec myspace ifconfig veth1 192.168.42.2 netmask 255.255.255.0 up
ip netns exec myspace route add default gw 192.168.42.1
iptables -t nat -A POSTROUTING -s 192.168.42.0/24 -o eth0 -j MASQUERADE
and, I have WAN access inside the namespece, but DNS fails
it also has an isolated resolv.conf which uses google dns as it's upstream server.
ip netns exec myspace ping 8.8.8.8 // works
ip netns exec myspace dig +short @8.8.8.8 google.com // connection timeout
@ghnou and others, what can I do to debug this situation?
No idea tbh, I never used network namespaces so far
It's definitely caused by veth. IDK what's wrong with it. But, as a workaround for now. I swapped it with macvlan on bridge mode.
Обсуждают сегодня