This is an old revision of the document!
Network Namespaces
setup
install netns helper
wget https://raw.githubusercontent.com/Lekensteyn/netns/master/netns -O /bin/netns chmod +x /bin/nets
uncomment βnet.ipv4.ip_forward=1β in /etc/sysctl.d/99-sysctl.conf
enable NAT
iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE iptables-save > /etc/firewall
bash prompt, add to .bashrc
_ns_name=$(ip netns identify 2>/dev/null) PS1=${_ns_name:+(${_ns_name})}${PS1} unset _ns_name
use
create namespace β0β
netns 0 start
run bach inside
netns 0 exec
permit routing
ip netns exec netns0 sysctl -w net.ipv4.ip_forward=1