# Network

### Overview

There are 4 network interfaces.  
Each interface bonds 2 physical network cards.

The 4 main vlans used are

- MDC RP Management
- NSP Client Network
- NSP Internal Network
- NSP Managed Network

Exact mappings and vlan information is in the spreadsheet:  
[Network Interfaces and Vlans](https://bookstack.archfox.org/attachments/2)

This sheet is for the RCPT hosts. The KCSW hosts are the exact same except the third IP field is +50.

<div data-coolorigin="https%3A%2F%2Fnextcloud.archfox.org%2Fcool%2Fclipboard%3FWOPISrc%3Dhttp%253A%252F%252Fnextcloud-aio-apache%253A23973%252Findex.php%252Fapps%252Frichdocuments%252Fwopi%252Ffiles%252F992129_ocxzs58wqm8a%26ServerId%3D7a57612c%26ViewId%3D4%26Tag%3De57d5edf9ed0bfaf" id="bkmrk-rcpt-vlan-vlan-172.1"><table border="1" cellspacing="0" style="width: 27.2619%; height: 59.3666px;"><colgroup><col style="width: 45.5738%;"></col><col style="width: 54.3751%;"></col></colgroup><thead><tr><td>RCPT Vlan</td><td></td></tr></thead><tbody><tr style="height: 29.6833px;"><td style="height: 29.6833px;">Vlan</td><td align="right" class="align-left" style="height: 29.6833px;">172.18.2.0/24

</td></tr><tr style="height: 29.6833px;"><td style="height: 29.6833px;">Vlan Tag</td><td class="align-left" style="height: 29.6833px;">2102

</td></tr></tbody></table>

</div><table border="1" cellspacing="0" id="bkmrk-kcsw-vlan-vlan-172.1" style="width: 27.2619%; height: 59.3666px;"><thead><tr><td style="width: 49.9781%;">KCSW Vlan

</td><td style="width: 49.9781%;">  
</td></tr></thead><tbody><tr style="height: 29.6833px;"><td style="height: 29.6833px; width: 49.9781%;">Vlan

</td><td align="right" class="align-left" style="height: 29.6833px; width: 49.9781%;">172.18.52.0/24</td></tr><tr style="height: 29.6833px;"><td style="height: 29.6833px; width: 49.9781%;">Vlan Tag</td><td class="align-left" style="height: 29.6833px; width: 49.9781%;">2152</td></tr></tbody></table>

### Bond configurations

This creates the bond interfaces

```
nmcli connection add ipv4.method disabled ipv6.method ignore type bond mode active-backup ifname bond1 con-name bond1
nmcli connection add type ethernet slave-type bond ifname ens6f0 master bond1 con-name bond1-slave0
nmcli connection add type ethernet slave-type bond ifname ens6f1 master bond1 con-name bond1-slave1

nmcli connection add ipv4.method disabled ipv6.method ignore type bond mode active-backup ifname bond2 con-name bond2
nmcli connection add type ethernet slave-type bond ifname eno12409np1 master bond2 con-name bond2-slave0
nmcli connection add type ethernet slave-type bond ifname eno12399np0 master bond2 con-name bond2-slave1

nmcli connection add ipv4.method disabled ipv6.method ignore type bond mode active-backup ifname bond3 con-name bond3
nmcli connection add type ethernet slave-type bond ifname eno12419np2 master bond3 con-name bond3-slave0
nmcli connection add type ethernet slave-type bond ifname eno12429np3 master bond3 con-name bond3-slave1

nmcli dev
```

### Bridge configurations

This creates the bridges and adds them as slaves to the respective bond

```
nmcli con add type bridge ifname br1 con-name br1
nmcli con modify br1 ipv4.method disabled ipv6.method disabled
nmcli con modify bond1 master br1 slave-type bridge
nmcli con up br1

nmcli con add type bridge ifname br2 con-name br2
nmcli con modify br2 ipv4.method disabled ipv6.method disabled
nmcli con modify bond2 master br2 slave-type bridge
nmcli con up br2

nmcli con add type bridge ifname br3 con-name br3
nmcli con modify br3 ipv4.method disabled ipv6.method disabled
nmcli con modify bond3 master br3 slave-type bridge
nmcli con up br3

nmcli dev
```

### VM ENV

This makes sure to use the system qemu instance instead of the userspace one when running virsh commands.

<p class="callout warning">Run this before using any VM commands otherwise you will not find any VMs!</p>

```
echo 'export LIBVIRT_DEFAULT_URI="qemu:///system"' >> ~/.bashrc
source ~/.bashrc
```

### VM Nets

Use this script to add the bridges to the VMs

[add\_br\_vm.sh](https://bookstack.archfox.org/attachments/1)

#### VM Bridge Assignments:

Client Bridge (br1) Vms:

- All Vms

NSP Internal Bridge (br2) Vms:

- All VMs excpet:   
    KCSW-WSNOC, KCSW-WSP, RCPT-WSNOC, RCPT-WSP

NSP Internal Bridge (br3) Vms:

- All VMs excpet:   
    KCSW-WSNOC, KCSW-WSP, RCPT-WSNOC, RCPT-WSP