Files
IPv6-Lab/README.md
2026-03-01 08:03:33 +01:00

148 lines
4.8 KiB
Markdown

# IPv6-Lab
## Initial situation
In this project, a laboratory for IPv6 will be set up using a desktop computer with a current Debian system. To use the computer furthermore for its actual purpose, this should be done as far as possible without stirring up a lot of dust (e.g. using various outdated network backends).
OS: Debian GNU/Linux _Trixie_ (testing)
Kernel: 6.17.13-1 amd64
Network backend: NetworkManager
Hypervisor: KVM
Virtual switch: Open vSwitch 3.6.0
## Required packages
- openvswitch-switch
- gvncviewer
- qemu-system
- libvirt-daemon-system
- libvirt-daemon-system
- virt-manager
## Network topology
![Network topology](img/lab2.png)
### Configuring Systems
## Bridge br0
The bridge is part of the host system. Thus, it is configured using the network manager command line tool. These settings will be permanent.
> [!CAUTION]
> I was not able to get this working with wifi interfaces. The reason is probably, that the access point is not accepting packets from other MAC adresses than the wifi interface. There is a way using ```ebtables``` to mask all MAC adresses, but this seems pretty buggy to me. Consider using ULA in an offline lab if you don't have ethernet interfaces on your Laptop.
Info about current connetions
# nmcli con show
Add bridge
# nmcli con add ifname br0 type bridge con-name br0
Add interface to the bridge
# nmcli con add type bridge-slave ifname <interface_name> master br0
Turn on the bridge (and turn off bridge-slave)
# nmcli con down "Wired connection 1"
# nmcli con up br0
Wait a few seconds
$ nmcli con show
## Hypervisor
KVM is used as a hypervisor in this project. You may use virsh on the cli or virt-manager as a graphical tool.
### Create virtual networks on hypervisor
Here we create two networks on the hypervisor. The first is used by the edge router impala to connect to the host network, the second is needed by the hosts in the lab network. Create a file named ```bridged-network.xml``` with the following content
<network>
<name>bridged-network</name>
<forward mode="bridge" />
<bridge name="br0" />
</network>
Then we need the network for the virtual switch served by openvswitch. Create a file named ```ovs-network.xml``` with this content
<network>
<name>vSwitch0</name>
<forward mode="bridge"/>
<bridge name="labbr1"/>
<virtualport type='openvswitch'/>
</network>
In case you use virsh, you need to run the following commands to create the network on the hypervisor:
$ virsh net-define bridged-network.xml
$ virsh net-define ovs-network.xml
Then start it
$ virsh net-start bridged-network
$ virsh net-start vSwitch0
$ virsh net-autostart bridged-network
$ virsh net-autostart vSwitch0
$ virsh net-list
Name Status Automatischer Start Bleibend
------------------------------------------------------------
bridged-network Aktiv ja ja
vSwitch0 Aktiv ja ja
## impala
```impala``` is the WAN router of the lab. On the external interface, the router acts as a DHCPv6 client in order to receive a Prefix Delegation from the DSL-Router (Fritz!Box in this case). On the internal interface ```impala``` will serve Router Advertisements which is necessary for SLAAC. The hosts in the lab environment connectetd to the vSwitch will receive a prefix via SLAAC this way. Thus, we need two network interfaces on this virtual host system:
The external interface ist connexted to the bridge on the host system.
<interface type="network">
<mac address="52:54:00:62:85:19"/>
<source network="bridged-network"/>
<model type="virtio"/>
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>
The internal interface has to be connected to the ```vSwitch0```.
<interface type="bridge">
<source network="vSwitch0" portid="672dad49-ab32-4369-81d3-4a1e7e69b0de" bridge="labbr1"/>
<virtualport type="openvswitch"/>
<model type="virtio"/>
</interface>
### DHCP Client
The dhcpcd package has to be installed on the OpenBSD system.
# pkg_add dhcpcd
# rcctl enable dhcpcd
Edit the config file /etc/dhcpcd.conf
ipv6only
noipv6rs
script ""
allowinterfaces vio0 vio1
interface vio0
ipv6rs
ia_pd 1 vio1/1
## gto
```gto``` has one interface on ```vSwitch0```
<interface type="bridge">
<mac address="52:54:00:26:9b:f0"/>
<source bridge="labbr1"/>
<virtualport type="openvswitch">
<parameters interfaceid="d9935aa6-952e-4f7b-8d55-9e8c2d2bc6a5"/>
</virtualport>
<model type="virtio"/>
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>