X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=newns;h=22906299aacf78adedca9c18c0f4ef3c86923a8a;hb=f397eab9a7782f2505ace92eba60b9db0323a9d0;hp=a3a932511a5b326967208bcd8f8f3b707d7beb0e;hpb=8e4cd767defea2b4bc5466978643e6f1bbaf7578;p=newns diff --git a/newns b/newns index a3a9325..2290629 100755 --- a/newns +++ b/newns @@ -176,25 +176,12 @@ dexec() { ip netns exec default "$@"; } mexec() { /usr/bin/nsenter --mount=/root/mount_namespaces/$nn "$@"; } -# background: head -n1 is defensive. Not sure if there is some weird feature -# for 2 routes to be 0/0. -gateway_ifs=($(ipd route list exact 0/0 | head -n1| sed -r 's/.*dev\s+(\S+).*/\1/')) - -if [[ ! $gateway_ifs ]]; then - cat >&2 </dev/null + echo 1 | dexec dd of=/proc/sys/net/ipv4/ip_forward status=none # docker helpfully changes the default FORWARD to drop... diptables-add FORWARD -i $v0 -j ACCEPT