Difference between revisions of "Install/Network/en"

From Funtoo
Jump to: navigation, search
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{InstallNavigation|num=15|prev=Bootloader|next=Finishing|title=Network}}
+
<includeonly>
 +
== Network ==
 +
</includeonly><noinclude><languages/>
 +
= Install Guide: Network =
 +
 
 +
{{InstallNavigation|num=15|prev=Bootloader|next=Finishing}}</noinclude>
  
 
It's important to ensure that you will be able to connect to your local-area network after you reboot into Funtoo Linux. There are three approaches you can use for configuring your network: NetworkManager, dhcpcd, and the [[Funtoo Linux Networking]] scripts. Here's how to choose which one to use based on the type of network you want to set up.
 
It's important to ensure that you will be able to connect to your local-area network after you reboot into Funtoo Linux. There are three approaches you can use for configuring your network: NetworkManager, dhcpcd, and the [[Funtoo Linux Networking]] scripts. Here's how to choose which one to use based on the type of network you want to set up.
Line 5: Line 10:
 
==== Wi-Fi ====  
 
==== Wi-Fi ====  
  
For laptop/mobile systems where you will be using Wi-Fi, roaming, and connecting to various networks NetworkManager is strongly recommended.
+
{{Note|If using the ''{{c|gnome}}'' install image, {{c|linux-firmware}} and NetworkManager are already installed and available. You can use {{c|nmtui}} to get Wi-Fi going if you need network connectivity prior to getting X and GNOME fully up and running. In addition, ZeroConf/Bonjour multicast DNS lookups are enabled by default. Both these things will ''not'' be set up yet if you are using the ''{{c|stage3}}'' image.}}
Since Wi-Fi cards require firmware to operate, it is also recommended that you emerge the linux-firmware ebuild:
 
  
{{console|body=(chroot) # ##i##emerge linux-firmware networkmanager
+
For laptop/mobile systems where you will be using Wi-Fi, roaming, and connecting to various networks, NetworkManager is strongly recommended. 
}}
+
Since Wi-Fi cards require firmware to operate, it is also recommended that you emerge the linux-firmware ebuild if you have not done so already:
  
Depending on your architecture, you might now see a message similar to the following:
+
{{console|body=%chroot% ##i##emerge linux-firmware networkmanager
 
+
%chroot% ##i##rc-update add NetworkManager default
{{console|body=
 
The following USE changes are necessary to proceed
 
...
 
}}
 
This means that your USE flags need to be updated to allow this installation. For now, you can let portage handle this for you by adding the flag <code>--autounmask-write</code>:
 
{{console|body=(chroot) # ##i##emerge linux-firmware networkmanager --autounmask-write
 
}}
 
After this, update the config:
 
{{console|body=(chroot) # ##i##dispatch-conf
 
}}
 
Accept the new config by pressing <code>u</code>. Then, you can proceed to install NetworkManager:
 
 
 
{{console|body=(chroot) # ##i##emerge linux-firmware networkmanager
 
(chroot) ###i## rc-update add NetworkManager default
 
 
}}
 
}}
 
The above command will ensure that NetworkManager starts after you boot into Funtoo Linux. Once you've completed these installation steps and have booted into Funtoo Linux, you can use the {{c|nmtui}} command (which has an easy-to-use console-based interface) to configure NetworkManager so that it will connect (and automatically reconnect, after reboot) to a Wi-Fi access point:
 
The above command will ensure that NetworkManager starts after you boot into Funtoo Linux. Once you've completed these installation steps and have booted into Funtoo Linux, you can use the {{c|nmtui}} command (which has an easy-to-use console-based interface) to configure NetworkManager so that it will connect (and automatically reconnect, after reboot) to a Wi-Fi access point:
{{console|body=# ##i##nmtui}}
+
{{console|body=%chroot% ##i##nmtui}}
 
For more information about NetworkManager, see the [[Package:NetworkManager|NetworkManager package page]].
 
For more information about NetworkManager, see the [[Package:NetworkManager|NetworkManager package page]].
 
{{Note|wpa_supplicant is also a good choice for wireless network connections. See the {{package|net-wireless/wpa_supplicant}} package for steps involved in setting up wpa_supplicant.}}
 
  
 
==== Desktop (Wired DHCP) ====  
 
==== Desktop (Wired DHCP) ====  
Line 39: Line 27:
  
 
{{console|body=
 
{{console|body=
(chroot) # ##i##rc-update add dhcpcd default}}
+
%chroot% ##i##rc-update add dhcpcd default}}
 
When you reboot, {{c|dhcpcd}} will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.
 
When you reboot, {{c|dhcpcd}} will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.
  
Line 46: Line 34:
 
==== Server (Static IP) ====  
 
==== Server (Static IP) ====  
  
For servers, the [[Funtoo Linux Networking]] scripts are recommended. They are optimized for static configurations and things like virtual ethernet bridging for virtualization setups. See [[Funtoo Linux Networking]] for information on how to use Funtoo Linux's template-based network configuration system.
+
For servers, the [[Funtoo Linux Networking]] scripts are the supported option for network configuration, and they [[Funtoo Linux Networking|have their own documentation]]. They are optimized for static configurations and things like virtual Ethernet bridging for virtualization setups. See [[Funtoo Linux Networking]] for information on how to use Funtoo Linux's template-based network configuration system.
  
 
==== Hostname ====
 
==== Hostname ====
Line 52: Line 40:
  
 
{{console|body=
 
{{console|body=
(chroot) # ##i##nano /etc/conf.d/hostname
+
%chroot% ##i##nano /etc/conf.d/hostname
 
}}
 
}}
  
Line 58: Line 46:
  
 
{{warning|Do not use special characters in the hostname, as the shell may interpret these, leading to unpredictable results. Use the Latin alphabet: a-z, A-Z, 0-9}}
 
{{warning|Do not use special characters in the hostname, as the shell may interpret these, leading to unpredictable results. Use the Latin alphabet: a-z, A-Z, 0-9}}
{{tip|Use short hostnames (up to 8 or 10 characters) to prevent the terminal screen being filled with the hostname, leaving little space for the command itself. This become particularly poignant when coding long command strings in various programming languages like Bash, Python, SQL and Perl}}
+
<noinclude>{{InstallNavigation|num=15|prev=Bootloader|next=Finishing|align=right}}</noinclude>

Latest revision as of 22:05, October 10, 2019

Other languages:

Install Guide: Network

Install Guide, Chapter 15 < Prev Next >

It's important to ensure that you will be able to connect to your local-area network after you reboot into Funtoo Linux. There are three approaches you can use for configuring your network: NetworkManager, dhcpcd, and the Funtoo Linux Networking scripts. Here's how to choose which one to use based on the type of network you want to set up.

Wi-Fi

   Note

If using the gnome install image, linux-firmware and NetworkManager are already installed and available. You can use nmtui to get Wi-Fi going if you need network connectivity prior to getting X and GNOME fully up and running. In addition, ZeroConf/Bonjour multicast DNS lookups are enabled by default. Both these things will not be set up yet if you are using the stage3 image.

For laptop/mobile systems where you will be using Wi-Fi, roaming, and connecting to various networks, NetworkManager is strongly recommended. Since Wi-Fi cards require firmware to operate, it is also recommended that you emerge the linux-firmware ebuild if you have not done so already:

chroot # emerge linux-firmware networkmanager
chroot # rc-update add NetworkManager default

The above command will ensure that NetworkManager starts after you boot into Funtoo Linux. Once you've completed these installation steps and have booted into Funtoo Linux, you can use the nmtui command (which has an easy-to-use console-based interface) to configure NetworkManager so that it will connect (and automatically reconnect, after reboot) to a Wi-Fi access point:

chroot # nmtui

For more information about NetworkManager, see the NetworkManager package page.

Desktop (Wired DHCP)

For a home desktop or workstation with wired Ethernet that will use DHCP, the simplest and most effective option to enable network connectivity is to simply add dhcpcd to the default runlevel:

chroot # rc-update add dhcpcd default

When you reboot, dhcpcd will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.

If your upstream DHCP server is dnsmasq, it can be configured to assign addresses via mac address to make servers on DHCP feasible.

Server (Static IP)

For servers, the Funtoo Linux Networking scripts are the supported option for network configuration, and they have their own documentation. They are optimized for static configurations and things like virtual Ethernet bridging for virtualization setups. See Funtoo Linux Networking for information on how to use Funtoo Linux's template-based network configuration system.

Hostname

By default Funtoo uses "localhost" as hostname. Although the system will work perfectly fine using this name, some ebuilds refuse to install when detecting localhost as hostname. It also may create confusion if several systems use the same hostname. Therefore, it is advised to change it to a more meaningful name. The hostname itself is arbitrary, meaning you can choose almost any combination of characters, as long as it makes sense to the system administrator. To change the hostname, edit

chroot # nano /etc/conf.d/hostname

Look for the line starting with hostname and change the entry between the quotes. Save the file, on the next boot Funtoo will use the new hostname.

   Warning

Do not use special characters in the hostname, as the shell may interpret these, leading to unpredictable results. Use the Latin alphabet: a-z, A-Z, 0-9

Install Guide, Chapter 15 < Prev Next >