network_configuration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
network_configuration [2023/02/21 07:30] evienetwork_configuration [2023/08/11 22:55] (current) – Move to bootnote evie
Line 1: Line 1:
 +====== Network Configuration ======
 +
 ===== Checking the connection =====  ===== Checking the connection ===== 
-**A bug in the ''iproute2'' package causes the ''ping'' command to be marked as non-executable, this can be solved by running ''chmod +x /usr/bin/ping'' (which marks it as executable) as root.**+<bootnote warning> 
 +A bug in the ''iproute2'' package causes the ''ping'' command to be marked as non-executable, this can be solved by running ''chmod +x /usr/bin/ping'' (which marks it as executable) as root. 
 +</bootnote> 
  
 There's a chance you may already be connected to your network, you can test this by using the ''ping'' utility to try and reach a host.  There's a chance you may already be connected to your network, you can test this by using the ''ping'' utility to try and reach a host. 
Line 15: Line 20:
  
 ===== Wireless networking =====  ===== Wireless networking ===== 
-//yiffOS does not provide the legacy ''iwconfig'' package, as a result, ''iw'' is provided and will be used instead to connect to wireless networks./+<bootnote> 
 +yiffOS does not provide the legacy ''iwconfig'' package, as a result, ''iw'' is provided and will be used instead to connect to wireless networks. 
 +</bootnote> 
 + 
  
 ==== Device driver/firmware ====  ==== Device driver/firmware ==== 
Line 28: Line 36:
  
 ==== Connecting to a wireless network ====  ==== Connecting to a wireless network ==== 
-//These commands require you to run them with root permissions. Running them as a user might not throw errors, but they will also not produce the correct output either./+<bootnote> 
 +These commands require you to run them with root permissions. Running them as a user might not throw errors, but they will also not produce the correct output either. 
 +</bootnote> 
 + 
  
 === Get the interface name === === Get the interface name ===
Line 46: Line 57:
  
 === Activate the interface (if required) ===  === Activate the interface (if required) === 
-//If you get an error like ''Operation not possible due to RF-kill'', check to see if a hardware switch isn't mistakenly set to the off position./+<bootnote> 
 +If you get an error like ''Operation not possible due to RF-kill'', check to see if a hardware switch isn't mistakenly set to the off position. 
 +</bootnote> 
 + 
 Your card might require the kernel interface to be activated before it can be used in iw. ''ip link set <interface> up'' Your card might require the kernel interface to be activated before it can be used in iw. ''ip link set <interface> up''
  
Line 57: Line 71:
  
 === Search for access points ===  === Search for access points === 
-//If this command outputs ''Interface does not support scanning'', then you are most likely missing firmware. In some cases, this can also be caused by running iw as a regular user./+<bootnote> 
 +If this command outputs ''Interface does not support scanning'', then you are most likely missing firmware. In some cases, this can also be caused by running iw as a regular user. 
 +</bootnote> 
 + 
  
 Now that the interface is up, we can scan nearby access points with ''iw dev scan'' Now that the interface is up, we can scan nearby access points with ''iw dev scan''
Line 79: Line 96:
  
 === Connect to an access point ===  === Connect to an access point === 
-Depending on the type of encryption used by the access point, you'll need to provide a key to connect. * '''No Encryption''' ** {{bc|iw dev <interface> connect "<ssid>"}} * '''WEP''' ** Using a hexadecimal or ASCII key. *** {{bc|iw dev <interface> connect "<ssid>" key 0:<key>}} ** Using a hexadecimal or ASCII key, using a specific key. *** {{bc|iw dev <interface> connect "<ssid>" key d:<key number>:<key>}} * '''WPA''' ** You'll need the package {{Pkg|wpa_supplicant}} to connect to WPA/WPA2/WPA3 networks. This command must be run in an actual root shell ({{ic|sudo -i}}). You'll also need to reboot and then enable the wpa_supplicant systemd service {{ic|systemctl enable --now wpa_supplicant.service}} after installing. *** {{bc|wpa_supplicant -B -i <interface> -c <(wpa_passphrase "<ssid>" "<key>")}} You'll now be able to check if you have successfully connected by using {{ic|iw dev link}}{{bc|iw dev <interface> link}} +Depending on the type of encryption used by the access point, you'll need to provide a key to connect.  
 +  * **No Encryption** 
 +    * ''iw dev <interface> connect "<ssid>"'' 
 + 
 +  * **WEP**  
 +    * //Using a hexadecimal or ASCII key.//  
 +      ''iw dev <interface> connect "<ssid>" key 0:<key>''  
 +    //Using a hexadecimal or ASCII key, using a specific key.//  
 +      ''iw dev <interface> connect "<ssid>" key d:<key number>:<key>''  
 + 
 +  * **WPA**  
 +    * You'll need the package ''wpa_supplicant'' to connect to WPA/WPA2/WPA3 networks. This command must be run in an actual root shell (''sudo -i''). You'll also need to reboot and then enable the wpa_supplicant systemd service ''systemctl enable --now wpa_supplicant.service'' after installing. 
 +      ''wpa_supplicant -B -i <interface> -c <(wpa_passphrase "<ssid>" "<key>")'' 
 + 
 + 
 +You'll now be able to check if you have successfully connected by using ''iw dev link''.
  
 ===== Network Management =====  ===== Network Management ===== 
  
 ==== Comparison ====  ==== Comparison ==== 
-{{Note|Coming soon...}}+//Coming soon...//
  
 ==== NetworkManager ====  ==== NetworkManager ==== 
Line 90: Line 122:
  
 === Installation and Usage ===  === Installation and Usage === 
-{{Warning|If you're coming from systemd-networkd, make sure you delete the systemd-networkd configuration files and disable the service using {{ic|sudo systemctl disable --now systemd-networkd.service}} before starting NetworkManager.}} Install the {{Pkg|networkmanager}} package using {{ic|bulge i networkmanager}}. Once NetworkManager is installed, you can start the daemon by running {{ic|sudo systemctl enable --now NetworkManager.service}}. It should automatically connect to any "available connections" (like Ethernet) upon the service starting. Networks like WiFi networks will require configuration before NetworkManager will automatically connect to it. If NetworkManager fails to start due to a missing file called {{ic|libnss3.so}}, you will need to install {{Pkg|nss}}==== Configuration ==== ===== nmtui ===== If NetworkManager is running, you can use the NetworkManager TUI utility by running {{ic|nmtui}}. From {{ic|nmtui}} you'll be able to add new connections and edit existing connections, activate and deactivate connections (including connecting to WiFi networks), and edit the system's hostname. +<bootnote warning> 
 +If you're coming from systemd-networkd, make sure you delete the systemd-networkd configuration files and disable the service using ''systemctl disable --now systemd-networkd.service'' before starting NetworkManager. 
 +</bootnote> 
 + 
 + 
 +Install the ''networkmanager'' package using ''bulge i networkmanager''. Once NetworkManager is installed, you can start the daemon by running ''systemctl enable --now NetworkManager.service''. It should automatically connect to any "available connections" (like Ethernet) upon the service starting. Networks like WiFi networks will require configuration before NetworkManager will automatically connect to it.  
 + 
 +If NetworkManager fails to start due to a missing file called ''libnss3.so'', you will need to install ''nss''. 
 + 
 +=== Configuration === 
 +== nmtui ==  
 +If NetworkManager is running, you can use the NetworkManager TUI utility by running ''nmtui''. From ''nmtui'' you'll be able to add new connections and edit existing connections, activate and deactivate connections (including connecting to WiFi networks), and edit the system's hostname. 
  
 ==== systemd-networkd ====  ==== systemd-networkd ==== 
-{{Tip|If you aren't using any other DNS resolver (like {{Pkg|dnsmasq}}), you may want to also enable {{ic|systemd-resolved}}, you can do this by running {{ic|sudo systemctl enable --now systemd-resolved}}. If you ARE, you should disable it instead by running {{ic|sudo systemctl disable --now systemd-resolved}}.}} In order to get the network device interface name, you can run {{ic|ip a}} to get the information for all interfaces connected to your computer. Ethernet interfaces will commonly start with the letter "e" and wireless interfaces will commonly start with the letter "w"{{hc|$ ip a|2= 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 3c:97:0e:a9:27:e6 brd ff:ff:ff:ff:ff:ff inet 192.168.0.102/24 metric 1024 brd 192.168.0.255 scope global dynamic enp0s25 valid_lft 4292454283sec preferred_lft 4292454283sec inet6 fe80::3e97:eff:fea9:27e6/64 scope link valid_lft forever preferred_lft forever 3: wlp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000 link/ether 6c:88:14:b0:e0:b8 brd ff:ff:ff:ff:ff:ff }} ==== DHCP Configuration ==== In order to configure systemd-networkd as part of an IPv4 DHCP setup, you'll need to create a basic configuration file at {{ic|/etc/systemd/network/10-<interface type>-dhcp.network}}{{hc|/etc/systemd/network/10-<interface type>-dhcp.network|2= [Match] Name=<interface> [Network] DHCP=ipv4 [DHCP] UseDomains=true }} ==== Static IP Configuration ==== If you'd like to have a static IP configuration, you can create a basic configuration file at {{ic|/etc/systemd/network/10-<interface type>-static.network}}{{hc|/etc/systemd/network/10-<interface type>-static.network|2= [Match] Name=<interface> [Network] Address=<preferred ip address> Gateway=<router gateway> DNS=<DNS server ip> Domains=<FQDN hostname> }}After creating one of two configuration files, reboot your system.+<bootnote warning> 
 +If you aren't using any other DNS resolver (like ''dnsmasq''), you may want to also enable ''systemd-resolved'', you can do this by running ''systemctl enable --now systemd-resolved''. If you ARE, you should disable it instead by running ''systemctl disable --now systemd-resolved''. 
 +</bootnote> 
 +  
 + 
 +In order to get the network device interface name, you can run ''ip a'' to get the information for all interfaces connected to your computer. Ethernet interfaces will commonly start with the letter "e" and wireless interfaces will commonly start with the letter "w" 
 + 
 +<code> 
 +$ ip a 
 +1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 
 +    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00  
 +    inet 127.0.0.1/8 scope host lo  
 +        valid_lft forever preferred_lft forever  
 +    inet6 ::1/128 scope host  
 +        valid_lft forever preferred_lft forever  
 +2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000  
 +    link/ether 3c:97:0e:a9:27:e6 brd ff:ff:ff:ff:ff:ff  
 +    inet 192.168.0.102/24 metric 1024 brd 192.168.0.255 scope global dynamic enp0s25 
 +        valid_lft 4292454283sec preferred_lft 4292454283sec  
 +    inet6 fe80::3e97:eff:fea9:27e6/64 scope link 
 +        valid_lft forever preferred_lft forever  
 +3: wlp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000  
 +    link/ether 6c:88:14:b0:e0:b8 brd ff:ff:ff:ff:ff:ff 
 +</code> 
 + 
 +== DHCP Configuration == 
 +In order to configure systemd-networkd as part of an IPv4 DHCP setup, you'll need to create a basic configuration file at ''/etc/systemd/network/10-<interface type>-dhcp.network'' 
 +<code> 
 +/etc/systemd/network/10-<interface type>-dhcp.network 
 + 
 +[Match]  
 +Name=<interface>  
 + 
 +[Network]  
 +DHCP=ipv4  
 + 
 +[DHCP]  
 +UseDomains=true 
 +</code> 
 + 
 +== Static IP Configuration == 
 +If you'd like to have a static IP configuration, you can create a basic configuration file at ''/etc/systemd/network/10-<interface type>-static.network'' 
 +<code> 
 +/etc/systemd/network/10-<interface type>-static.network 
 + 
 +[Match] 
 +Name=<interface> 
 + 
 +[Network] 
 +Address=<preferred ip address> 
 +Gateway=<router gateway> 
 +DNS=<DNS server ip> 
 +Domains=<FQDN hostname> 
 +</code> 
 + 
 +After creating one of two configuration files, reboot your system.
  • network_configuration.1676964655.txt.gz
  • Last modified: 2023/02/21 07:30
  • by evie