aboutsummaryrefslogtreecommitdiffstats
path: root/ipv6
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-09-13 17:32:12 +0000
committerterminaldweller <thabogre@gmail.com>2022-09-13 17:32:12 +0000
commit68e3be1f591e40925b4c5c3f57aee8d4e260ebbf (patch)
treef07a55bbb82c23c688d104ff24d61084f5f5b72b /ipv6
parentupdates (diff)
downloadscripts-68e3be1f591e40925b4c5c3f57aee8d4e260ebbf.tar.gz
scripts-68e3be1f591e40925b4c5c3f57aee8d4e260ebbf.zip
update
Diffstat (limited to 'ipv6')
-rwxr-xr-xipv6/home_ns_bind.sh16
-rwxr-xr-xipv6/ns_bind.sh6
2 files changed, 19 insertions, 3 deletions
diff --git a/ipv6/home_ns_bind.sh b/ipv6/home_ns_bind.sh
new file mode 100755
index 0000000..3b52e11
--- /dev/null
+++ b/ipv6/home_ns_bind.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env sh
+
+NS=home_ns
+IF=wlp0s20f3
+PHY=phy0
+
+sudo ip netns add ${NS} || true
+sudo iw phy ${PHY} set netns "$(sudo ip netns exec home_ns sh -c 'sleep 1 >&- & echo "$!"')"
+# sudo ip link set ${IF} netns ${NS}
+sudo ip netns exec ${NS} ip link set ${IF} up
+sudo ip netns exec ${NS} ip link set dev lo up
+sudo ip netns exec ${NS} dhclient ${IF}
+
+ip netns exec ${NS} ping -4 9.9.9.9
+ip netns exec ${NS} ping -4 google.com
+ip netns exec ${NS} curl -4 icanhazip.com
diff --git a/ipv6/ns_bind.sh b/ipv6/ns_bind.sh
index 32b529d..9848ef4 100755
--- a/ipv6/ns_bind.sh
+++ b/ipv6/ns_bind.sh
@@ -10,10 +10,10 @@
# example: sudo ip netns exec phone_ns bash
PHONE_NS=phone_ns
-IF=enp0s20f0u3u1u3
+IF=enp0s20f0u3u3
-sudo ip netns add ${PHONE_NS}
-sudo ip link set ${IF} netns ${PHONE_NS}
+# sudo ip netns add ${PHONE_NS}
+# sudo ip link set ${IF} netns ${PHONE_NS}
sudo ip netns exec ${PHONE_NS} ip link set ${IF} up
sudo ip netns exec ${PHONE_NS} ip link set dev lo up
# will need to install dhclient before runnning this dummy