[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
slackbook:network [2012/09/16 20:21 (UTC)] – [Manual Configuration] Added original text and formatting mfillpotslackbook:network [2012/11/21 02:20 (UTC)] (current) – [Manual Configuration] removed unnecessary tags gerardo.zamudio
Line 201: Line 201:
 nameserver 192.168.1.254</code> nameserver 192.168.1.254</code>
  
-Many users won't need the <parameter>search</parameter> line. This is used to map hostnames+Many users won't need the search line. This is used to map hostnames
 to domain names. Basically, if I attempt to connect to "//barnowl"//, the to domain names. Basically, if I attempt to connect to "//barnowl"//, the
 computer knows to look for //"barnowl.lizella.net"// thanks to this search computer knows to look for //"barnowl.lizella.net"// thanks to this search
-line. We're mainly interested in the <parameter>nameserver</parameter> line. This tells+line. We're mainly interested in the nameserver line. This tells
 Slackware what domain name servers (DNS) to connect to. Generally Slackware what domain name servers (DNS) to connect to. Generally
 speaking, these should always be specified by IP address. If you know speaking, these should always be specified by IP address. If you know
Line 270: Line 270:
 =====  Automatic Configuration with rc.inet1.conf ===== =====  Automatic Configuration with rc.inet1.conf =====
  
-Manually configuring interfaces is an important skill to have, but it can become tedious. No one wants to manually setup their Internet connection every time the system boots. More importantly, you may not always have physical access to the machine when it boots. Slackware makes it easy to automatically configure ethernet (and wireless) cards at system startup with /etc/rc.d/rc.inet1.conf. For now, we're going to focus on traditional wired ethernet networking; the next chapter will discuss various wireless options.+Manually configuring interfaces is an important skill to have, but it 
 +can become tedious.  No one wants to manually setup their Internet 
 +connection every time the system boots.  More importantly, you may not 
 +always have physical access to the machine when it boots.  Slackware 
 +makes it easy to automatically configure ethernet (and wireless) cards 
 +at system startup with ''/etc/rc.d/rc.inet1.conf''. 
 +For now, we're going to focus on traditional wired ethernet networking; 
 +the next chapter will discuss various wireless options.
  
-rc.inet1.conf is an incredibly powerful configuration file, capable of configuring most of your network cards automatically when Slackware is started. The file is filled with useful comments, but there is also a man page that more thoroughly discusses its use. To begin, we're going to look at some of the options used on one of my personal machines. 
  
-  # Config information for eth0: +''rc.inet1.conf'' is an incredibly powerful 
-  IPADDR[0]="192.168.1.250" +configuration file, capable of configuring most of your network cards 
-  NETMASK[=]"255.255.255.0" +automatically when Slackware is startedThe file is filled with useful 
-  USE_DHCP[0]="" +comments, but there is also a man page that more thoroughly discusses 
-  DHCP_HOSTNAME[0]="" +its use.  To begin, we're going to look at some of the options used on 
-  # Some lines ommitted. +one of my personal machines.
-  GATEWAY="192.168.1.254"+
  
-This represents most of the information necessary to configure a static IP address on a single ethernet controller. netconfig will usually fill in these values for a single ethernet device for you. If you have multiple network cards in your machine and need all of them activated automatically at boot time, then you'll need to edit or add additional entries into this file in the same manner as above. First, let me go over some of the basics. 
  
-As you may have already guessed, IPADDR[nis the Internet Protocol Address for the n network interface cardTypically, n corresponds to eth0, eth1, and so on, but this isn't always the caseYou can specify these values to pertain to a different network controller with the IFNAME[nvariable, but we will reserve that for [[slackbook:wifi | wireless networking]], as it more commonly pertains to wireless network controllers.+<code> 
 +# Config information for eth0: 
 +IPADDR[0]="192.168.1.250" 
 +NETMASK[=]"255.255.255.0" 
 +USE_DHCP[0]="" 
 +DHCP_HOSTNAME[0]="" 
 +# Some lines ommitted. 
 +GATEWAY="192.168.1.254" 
 +</code>
  
-Likewise, NETMASK[n] is the subnet mask to use for the network controller. If these lines are left empty, then static IP addresses will not be automatically assigned to this network controller. The USE_DHCP[n] variable tells Slackware (naturally) to use DHCP to configure the interface. DHCP_HOSTNAME[n] is rarely used, but some DHCP servers may require it. In that case, it must be set to a valid hostname. Finally, we come to the GATEWAY variable. It is actually set lower in the file than it appears in my example, and it controls the default gateway to use. You may be wondering why there is no GATEWAY[n] variable. The answer to that lies in how Internet Protocol works. I won't go into an in-depth discussion on that subject, but suffice it to say that there is only ever one default route that a computer can use no matter how many interfaces are attached to it. 
  
-If you need to use static IP addressing, you will have to obtain unique static IP address and the subnet mask for the interface, as well as the default gateway address, and enter those hereThere is no place to enter DNS information in rc.inet1.confso DNS servers will have to be manually placed into resolv.conf as discussed in the section called “Manual Configuration”Of courseif you use netconfig, this will be handled for you by that program. Now let's take a look at another interface on my computer.+This represents most of the information necessary to configure a static 
 +IP address on a single ethernet controller. 
 +**//netconfig//** will usually fill in these values  
 +for a single ethernet device for you If you have multiple network 
 +cards in your machine and need all of them activated automatically at 
 +boot timethen you'll need to edit or add additional entries into this 
 +file in the same manner as above First, let me go over some of the 
 +basics.
  
-  # Config information for eth1: 
-  IPADDR[1]="" 
-  NETMASK[1]="" 
-  USE_DHCP[1]="yes" 
-  DHCP_HOSTNAME[1]="" 
  
-Here I am telling Slackware to configure eth1 using DHCPI do not need to set the IPADDR[1or NETMASK[1variables when using DHCP (in fact, if they are setthey will be ignored). Slackware will happily contact a DHCP server as soon as the machine begins to boot+As you may have already guessed, IPADDR[n] is the Internet 
 +Protocol Address for the **n** network interface card. 
 +Typically, **n** corrosponds to 
 +//eth0//, //eth1//, and so on, 
 +but this isn't always the case You can specify these values to 
 +pertain to a different network controller with the IFNAME[n] 
 +variable, but we will reserve that for [[slackbook:wifi | wireless networking]], 
 +as it more commonly pertains to wireless network controllers.
  
 +
 +Likewise, NETMASK[n] is the subnet mask to use for the network
 +controller.  If these lines are left empty, then static IP addresses
 +will not be automatically assigned to this network controller.  The
 +**USE_DHCP[n]** variable tells Slackware
 +(naturally) to use DHCP to configure the interface.
 +**DHCP_HOSTNAME[n]** is rarely used, but some
 +DHCP servers may require it.  In that case, it must be set to a valid
 +hostname. Finally, we come to the GATEWAY variable.  It is actually
 +set lower in the file than it appears in my example, and it controls
 +the default gateway to use. You may be wondering why there is no
 +**GATEWAY[n]** variable. The answer to that
 +lies in how Internet Protocol works. I won't go into an in-depth
 +discussion on that subject, but suffice it to say that there is only
 +ever one default route that a computer can use no matter how many
 +interfaces are attached to it.
 +
 +
 +If you need to use static IP addressing, you will have to obtain a
 +unique static IP address and the subnet mask for the interface, as
 +well as the default gateway address, and enter those here. There is no
 +place to enter DNS information in ''rc.inet1.conf'',
 +so DNS servers will have to be manually placed into
 +''resolv.conf'' as discussed in [[#manual:configuration | Manual Configuration]]. Of course, if you use
 +**//netconfig//**, this will be handled for you by
 +that program.  Now let's take a look at another interface on my
 +computer.
 +
 +
 +<code>
 +# Config information for eth1:
 +IPADDR[1]=""
 +NETMASK[1]=""
 +USE_DHCP[1]="yes"
 +DHCP_HOSTNAME[1]=""
 +</code>
 +
 +
 +Here I am telling Slackware to configure eth1 using DHCP. I do not
 +need to set the **IPADDR[1]** or
 +**NETMASK[1]** variables when using DHCP (in
 +fact, if they are set, they will be ignored). Slackware will happily
 +contact a DHCP server as soon as the machine begins to boot.
 ====== Chapter Navigation ====== ====== Chapter Navigation ======
  
Line 303: Line 366:
  
 **Next Chapter: [[slackbook:wifi|Wireless Networking]]** **Next Chapter: [[slackbook:wifi|Wireless Networking]]**
-======Sources====== +====== Sources ====== 
- +<!-- If you copy information from another source, then specify that source --> 
-  * Original source: http://slackbook.org/beta/#ch_network (authors: Alan Hicks, Chris Lumens, David Cantrell, Logan Johnson)+  * Original source: [[http://www.slackbook.org/beta]] \\ 
 +<!-- Authors are allowed to give credit to themselves! --> 
 +  * Originally written by Alan Hicks, Chris Lumens, David Cantrell, Logan Johnson 
 +<!-- * Contrbutions by [[wiki:user:yyy | User Y]] -->
  
 +<!-- Please do not modify anything below, except adding new tags.-->
 +<!-- You must also remove the tag-word "template" below. Otherwise your page will not show up in the Table of Contents -->
 +{{tag>slackbook networking netconfig dhcpcd}}
 slackbook:network ()