From 9f3900add724b0123549251a42f5cf86cb08016d Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 4 Dec 2018 10:29:28 -0600 Subject: Admin: ch05: fill in more networking stuff --- src/admin/5_networking.xml | 86 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 82 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/admin/5_networking.xml b/src/admin/5_networking.xml index a658ffb..8419fac 100644 --- a/src/admin/5_networking.xml +++ b/src/admin/5_networking.xml @@ -20,13 +20,26 @@
Wired connections For the purposes of this handbook, a wired connection is a connection to a network that utilises Ethernet. While the Adélie Linux system supports ATM, CAN bus, IEEE 1394, and Token Ring networking, these connection types are exceedingly rare and out of the scope of this handbook. -
+
Dynamic addressing - + To explicitly configure an interface to use dynamic addressing via DHCP, set config_IFACE="dhcp", where IFACE is the interface you wish to use dynamic addressing.
-
+
Static addressing +
+ Configuring DNS resolution + When you use static addressing, you additionally need to configure DNS resolution. To do this, you must add one or more nameservers (DNS resolution systems) in /etc/resolv.conf. (Note that there is no 'e' at the end of resolv.conf.) Adding more than one server will allow your system to have a fallback if one nameserver is down or not responding. + There are a few nameservers on the Internet that respect user privacy, including Quad9 and DNS.WATCH. In this example, we will configure our system to use Quad9 over IPv6, with Quad9 and DNS.WATCH over IPv4 as fallbacks: + + <filename>/etc/resolv.conf</filename> file using Quad9 and DNS.WATCH + +nameserver 2620:fe::fe +nameserver 9.9.9.9 +nameserver 84.200.69.80 + + +
@@ -66,7 +79,47 @@
Sharing a host network with guests - + The Adélie Linux system can be configured to provide bridged networking to a QEMU virtual machine or KVM guest using TAP networking. You will need the iproute2 package installed. + First, we will need to add a bridge to netifrc. A bridge allows multiple network adaptors to combine multiple network segments into a single aggregate. For our purposes, we will be combining the physical network adaptor on the host with the virtual network adaptors on each guest. The bridge will have your physical network adaptor as its first member. This way, no network reconfiguration will be required when you start or stop virtual machines. You will need to move the configuration for your physical network adaptor to the bridge, so that all members of the bridge may share that connection. In the following example, the interface eth0 is the physical adaptor and the bridge is set to use a static IPv6 address, which will then be used by the physical adaptor as well. + + Configuring <filename>/etc/conf.d/net</filename> to use bridged networking + +config_eth0="null" + +bridge_br0="eth0" +config_br0="2001:db8::2/32" +routes_br0="default via 2001:db8::1" + + + Note that the physical adaptor must still be specified with a "null" configuration. This ensures that the link will still be activated and network traffic will still flow. If you are using DHCP, you may simply use config_br0="dhcp". + You will then need to replace your net.IFACE file with a net.br0 file in /etc/init.d. For example: + + Replacing a physical adaptor with bridged adaptor in OpenRC + +computer ~ # rc-update del net.eth0 +computer ~ # service net.eth0 stop +computer ~ # mv /etc/init.d/net.eth0 /etc/init.d/net.br0 +computer ~ # rc-update add net.br0 default +computer ~ # service net.br0 start + + + WarningYou will momentarily lose network connectivity after stopping net.IFACE. Do not perform these steps while connected to the machine over the network. + Now we need to create scripts for QEMU (or KVM) to use. The /etc/qemu-ifup script should be created as follows: + +#!/bin/sh +ip tuntap add mode tap name $1 +ip link set dev $1 master br0 +ifconfig $1 up + + The /etc/qemu-ifdown script should be created as follows: + +#!/bin/sh +ifconfig $1 down +ip tuntap del name $1 + + You may now start your QEMU or KVM virtual machines with network access by adding -net tap to the command line. Note that if you have more than one guest that needs network access, you will need to set a custom MAC address for each NIC. Otherwise there will be MAC collisions and networking may not work correctly. For example: + qemu-system-ppc64 -accel kvm -m 768 -drive file=/dev/gwyn/testvm,format=raw -net nic,model=virtio,macaddr=02:00:00:00:00:01 -net tap -machine pseries-2.12 + This will start a machine with network access and a MAC address of 02:00:00:00:00:01.
@@ -89,5 +142,30 @@ Advanced: 802.1X authentication
+
+ Advanced: Customising dynamic addressing + You may use the dhcp_IFACE variable to control how DHCP is used. Valid options include: + + <varname>dhcp_<replaceable>IFACE</replaceable></varname> options + + + + Option + Meaning + + + + + nodns + Setting this option will cause the /etc/resolv.conf to remain unmodified. This allows for static DNS and nameserver configuration even with dynamic addressing. + + + nontp + Setting this option will cause the /etc/ntp.conf to remain unmodified, even if the DHCP server sends NTP configuration information. + + + +
+
-- cgit v1.2.3-70-g09d2