Configuring Network Features

πŸ“š Hoofdstuk 7.1: Netwerkfuncties Configureren in Linux

──────────────────────────────
🌐 Vereiste Netwerkgegevens
──────────────────────────────
Voor een werkende verbinding zijn nodig:
β€’ Hostadres (IP-adres)
β€’ Netwerksubnetadres
β€’ Standaardgateway
β€’ Systeemhostnaam
β€’ DNS-serveradres

──────────────────────────────
πŸ›  Wijzigingsmethoden
──────────────────────────────
β€’ Handmatig via config-bestanden
β€’ Grafische netwerkbeheertools
β€’ CLI-tools

──────────────────────────────
πŸ—‚ Configuratiebestanden per Distro
──────────────────────────────
Distributie | Pad
────────────|─────────────────────────────────────
Debian | /etc/network/interfaces
Red Hat | /etc/sysconfig/network-scripts/
openSUSE | /etc/sysconfig/network/

βœ” Debian-voorbeeld:
auto eth0
iface eth0 inet static
address 192.168.1.77
netmask 255.255.255.0
gateway 192.168.1.254

βœ” Red Hat-voorbeeld:
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.77
NETMASK=255.255.255.0
GATEWAY=192.168.1.254
ONBOOT=yes

──────────────────────────────
πŸ–₯ Hostname Instellen
──────────────────────────────
β€’ Bestand: /etc/hostname
β€’ Systemd:
hostnamectl set-hostname myserver

──────────────────────────────
πŸ“‘ NetworkManager Tools
──────────────────────────────
β€’ nmtui – Menu-interface (tekst)
β€’ nmcli – Volledige CLI-tool

──────────────────────────────
🧰 IPRoute2 Tools (moderne methode)
──────────────────────────────
Commando | Beschrijving
──────────────|─────────────────────────────────
ip address | Toon/stel IP-adres(sen) in
ip link | Beheer interfaces
ip route | Bekijk/aanpas routetabel
ip neighbor | ARP/NDisc beheer
ip tunnel | Configuratie van tunnels

βœ” IP instellen:
ip addr add 192.168.1.100/24 dev eth0

βœ” Gateway instellen:
ip route add default via 192.168.1.1

──────────────────────────────
πŸ“¦ Net-Tools (verouderd)
──────────────────────────────
Commando | Beschrijving
─────────────|─────────────────────────────
ifconfig | IP's/netmask instellen
ethtool | Ethernet-instellingen
iwconfig | WiFi-instellingen
route | Gateway/router instellen

βœ” IP instellen:
ifconfig enp0s3 10.0.2.10 netmask 255.255.255.0 up

βœ” Gateway instellen:
route add default gw 192.168.1.1

──────────────────────────────
πŸ“₯ DHCP – Dynamische IP
──────────────────────────────
DHCP Clients:
β€’ dhcpcd
β€’ dhclient
β€’ pump

DHCP Serverconfig:
β€’ /etc/dhcp/dhcpd.conf

──────────────────────────────
πŸ”— NIC Bonding (interface-combinatie)
──────────────────────────────
Modus | Naam | Beschrijving
──────|────────────────|──────────────────────────────────────
0 | balance-rr | Afwisselend zenden, fouttolerantie
1 | active-backup | EΓ©n actief, andere standby
2 | balance-xor | Gebaseerd op MAC/hash
3 | broadcast | Alles op beide interfaces
4 | 802.3ad (LACP) | Link aggregatie
5 | balance-tlb | Afhankelijk van zendlast
6 | balance-alb | Zendlast + ontvanglast balanceren

βœ” Voorbeeldconfig:
modprobe bonding
ip link set eth0 down
ip link set eth1 down
ip link add bond0 type bond
ip link set eth0 master bond0
ip link set eth1 master bond0
ip link set bond0 up