From eb05188160bed1a8605cb61230d9cf244e4fdb4d Mon Sep 17 00:00:00 2001 From: Robert Jeutter Date: Sun, 24 Oct 2021 12:52:54 +0200 Subject: [PATCH] test namespaces configuration --- test/namespace-alice.sh | 16 ++++++++++++++++ test/namespace-bob.sh | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/namespace-alice.sh create mode 100755 test/namespace-bob.sh diff --git a/test/namespace-alice.sh b/test/namespace-alice.sh new file mode 100644 index 0000000..00c6fbf --- /dev/null +++ b/test/namespace-alice.sh @@ -0,0 +1,16 @@ +# create network namespace aegisns +ip netns add AEGISNS +# assing interface enp4s0f0 to aegisns +ip link set enp5s0f0 netns AEGISNS +# assing ip to interface +ip netns exec AEGISNS ip add add dev enp5s0f0 10.0.0.1/24 +# bring the link up +ip netns exec AEGISNS ip link set dev enp5s0f0 up +# add the standard route for the interface +ip netns exec AEGISNS route add default gw 10.0.0.2 enp5s0f0 +# show wether the project has been successful +ip netns exec AEGISNS ifconfig +ip netns exec AEGISNS route + + + diff --git a/test/namespace-bob.sh b/test/namespace-bob.sh new file mode 100755 index 0000000..d1fbe65 --- /dev/null +++ b/test/namespace-bob.sh @@ -0,0 +1,14 @@ +# create network namespace aegisns +ip netns add AEGISNS +# assing interface enp4s0f0 to aegisns +ip link set enp4s0f0 netns AEGISNS +# assing ip to interface +ip netns exec AEGISNS ip add add dev enp4s0f0 10.0.0.2/24 +# bring the link up +ip netns exec AEGISNS ip link set dev enp4s0f0 up +# add the standard route for the interface +ip netns exec AEGISNS route add default gw 10.0.0.1 enp4s0f0 +# show wether the project has been successful +ip netns exec AEGISNS ifconfig +ip netns exec AEGISNS route +