Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
| Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung | |||
|
lpi2:routing [2024/04/27 13:00] ingo_wichmann |
lpi2:routing [2024/04/28 09:52] (aktuell) |
||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== 5 Routen ====== | + | ====== Routen von a nach c ====== |
| {{ :lpi2:routing5.svg |}} | {{ :lpi2:routing5.svg |}} | ||
| ===== "Router" anlegen ===== | ===== "Router" anlegen ===== | ||
| Zeile 31: | Zeile 31: | ||
| export PS1="${debian_chroot:+($debian_chroot)}\u@ns-a-:\w\$ " | export PS1="${debian_chroot:+($debian_chroot)}\u@ns-a-:\w\$ " | ||
| sysctl -w 'net.ipv6.conf.all.forwarding=1' | sysctl -w 'net.ipv6.conf.all.forwarding=1' | ||
| + | ip link set up dev lo | ||
| ip link set up dev a0 | ip link set up dev a0 | ||
| ip link set up dev a-b1 | ip link set up dev a-b1 | ||
| Zeile 45: | Zeile 46: | ||
| export PS1="${debian_chroot:+($debian_chroot)}\u@ns-b1-:\w\$ " | export PS1="${debian_chroot:+($debian_chroot)}\u@ns-b1-:\w\$ " | ||
| sysctl -w 'net.ipv6.conf.all.forwarding=1' | sysctl -w 'net.ipv6.conf.all.forwarding=1' | ||
| + | ip link set up dev lo | ||
| ip link set up dev b1-a | ip link set up dev b1-a | ||
| ip link set up dev b1-b2 | ip link set up dev b1-b2 | ||
| Zeile 61: | Zeile 63: | ||
| export PS1="${debian_chroot:+($debian_chroot)}\u@ns-b2-:\w\$ " | export PS1="${debian_chroot:+($debian_chroot)}\u@ns-b2-:\w\$ " | ||
| sysctl -w 'net.ipv6.conf.all.forwarding=1' | sysctl -w 'net.ipv6.conf.all.forwarding=1' | ||
| + | ip link set up dev lo | ||
| ip link set up dev b2-a | ip link set up dev b2-a | ||
| ip link set up dev b2-b1 | ip link set up dev b2-b1 | ||
| Zeile 78: | Zeile 81: | ||
| export PS1="${debian_chroot:+($debian_chroot)}\u@ns-c-:\w\$ " | export PS1="${debian_chroot:+($debian_chroot)}\u@ns-c-:\w\$ " | ||
| sysctl -w 'net.ipv6.conf.all.forwarding=1' | sysctl -w 'net.ipv6.conf.all.forwarding=1' | ||
| + | ip link set up dev lo | ||
| ip link set up dev c-b1 | ip link set up dev c-b1 | ||
| ip link set up dev c-b2 | ip link set up dev c-b2 | ||
| Zeile 91: | Zeile 95: | ||
| ping -qc1 fc05::b2 | ping -qc1 fc05::b2 | ||
| - | ====== 8 Routen ====== | + | ====== Routen von a nach d ====== |
| {{:fortgeschrittene:pasted:20230818-145100.png}} | {{:fortgeschrittene:pasted:20230818-145100.png}} | ||
| - | ip netns add a | ||
| - | ip netns add b1 | ||
| - | ip netns add b2 | ||
| - | ip netns add c1 | ||
| - | ip netns add c2 | ||
| - | ip netns add d | ||
| - | ip link add a-b1 type veth peer name b1-a | ||
| - | ip link add a-b2 type veth peer name b2-a | ||
| - | ip link add b1-c1 type veth peer name c1-b1 | ||
| - | ip link add b1-c2 type veth peer name c2-b1 | ||
| - | ip link add b2-c1 type veth peer name c1-b2 | ||
| - | ip link add b2-c2 type veth peer name c2-b2 | ||
| - | ip link add c2-d type veth peer name d-c2 | ||
| - | ip link add c1-d type veth peer name d-c1 | ||
| - | ip link set dev a-b1 netns a | ||
| - | ip link set dev a-b2 netns a | ||
| - | ip link set dev b1-a netns b1 | ||
| - | ip link set dev b1-c1 netns b1 | ||
| - | ip link set dev b1-c2 netns b1 | ||
| - | ip link set dev b2-a netns b2 | ||
| - | ip link set dev b2-c1 netns b2 | ||
| - | ip link set dev b2-c2 netns b2 | ||
| - | ip link set dev c1-b1 netns c1 | ||
| - | ip link set dev c1-b2 netns c1 | ||
| - | ip link set dev c1-d netns c1 | ||
| - | ip link set dev c2-b1 netns c2 | ||
| - | ip link set dev c2-b2 netns c2 | ||
| - | ip link set dev c2-d netns c2 | ||
| - | ip link set dev d-c1 netns d | ||
| - | ip link set dev d-c2 netns d | ||
| - | |||
| - | Terminal a: | ||
| - | ip netns exec a /bin/bash | ||
| - | ip link set up dev a-b1 | ||
| - | ip addr add fc0a:b1::a/64 dev a-b1 | ||
| - | |||
| - | Terminal b1: | ||
| - | ip netns exec b1 /bin/bash | ||
| - | ip link set up dev b1-a | ||
| - | ip addr add fc0a:b1::b1/64 dev b1-a | ||
| - | ping fc0a:b1::a | ||
| - | |||