Originally Published: Thursday, 30 November 2000 Author: Travis Tilley
Published to: learn_articles_firststep/General Page: 1/1 - [Printable]

Setting Up Networking in Slackware Linux

Do you need to set up networking for your machine running Slackware Linux? Let Travis Tilley take you through the steps of the netconfig tool in his latest piece for Linux.com. You should be up on the network in no time!

   Page 1 of 1  

The program that sets up your networking scripts under Slackware is called netconfig. In order to use this program, you must be logged in under the user root. The command that allows you to switch to a superuser (a common name for the root user) is called su. If you're in console, type su and hit enter. If you're in X, open up your favorite terminal emulator first. The su program will now ask for a password. Enter the root password, hit enter, and you should now see a # instead of a $ at the prompt. Now that we're root, we can get to work, so type in netconfig and hit enter.

First, netconfig will ask you for a hostname and a domain name. Your hostname is the name by which your network sees your individual computer, and the domain name is the name you want to give your network. Anything will do, and I encourage you to have fun with it.

After setting up a hostname and domain name, you will be asked whether you want to configure a loopback only system, a DHCP system, or a static IP. You want to choose only static IP if you have been assigned one by your systems administrator or internet service provider or if you are setting up a network yourself. Static ip means the ip associated with your computer never changes. If your network uses DHCP to assign computers dynamic IPs, you will want to choose that option. A dynamic IP means that you get a new IP every time you sign on to the network. Dial-up access to the Internet works this way, but for dial-up only networking you don't want to choose DHCP. For modem-only networks you want to choose to have a loopback-only system, and if that is your choice, you have set up your networking and should now set up your PPPD of choice (which is beyond the scope of this how-to).

Since most of you will have either a loopback system or a static IP system, I will go into the configuration of a static IP system first. If this was your choice at the menu, you will next be asked for an IP and netmask for your machine. Your IP is like the address for your machine. No two machines on a network can have the same IP. There are IP ranges reserved for internal networks (meaning they can't be used by machines on the Internet) so that you can make sure your machines don't have the same IP as another machine connected to the Internet. These reserved IPs are: to, to, and to . In ipv4 the numbers 0 and 255 have special importance, so you really shouldn't use them in your IP. The netmask decides what type of network you will have and what size it will be. For most purposes, a class C network will do, so just hit return for the default netmask of . With a netmask of, the first 3 numbers are for the network and the last number is for the individual machine. So if you decided to have two computers networked in a class C network, they would have to have the first 3 numbers of their IPs the same, so as to be on the same network, and the last number different, so as to be considered different machines. If you're setting up a box on somebody else's network, ask the systems administrator what IP and netmask to use.

After entering your netmask you should be asked for a gateway IP. A gateway connects two networks. For example, if you wanted to have every box on your network access the Internet as if they were directly connected to the Internet, you would set up the box with the Internet connection as a gateway and then you could access the Internet from all computers on the network through the gateway. If you don't have a machine on your network set up as a gateway box, just keep this blank. Once again, ask your systems administrator if you are setting up a box on somebody else's network. Most networks use the first ip number for their gateway to keep things from getting confusing (like

The next step is to specify a nameserver IP. A nameserver, or DNS server, is for resolving hostnames into IPs. If you are going to be connecting this box to the Internet, you need to get the DNS server IP from your ISP, otherwise you will be confused when you can't connect to www.linux.com even though you know you're on the Internet . There are a lot of open DNS servers around, or you might want to call your ISP to find out what theirs is (SNET hands out their IPs and netmasks with their installation disks). Congratulations, you have configured your network!

If your network uses DHCP to configure IPs, choose that option on the menu. This will bring up the option to probe for your network card and have your machine load the device driver module for your card at boot if it finds it. There is a small chance the probe will cause problems, but I suggest you have it probe anyway. Keep in mind that you will need to compile support for your network card as a module. Kernel configuration and compiling is way beyond the scope of this document. If you need help with that, try the howtos in Linux.com's HOWTO section. Congrats, you have now configured your network.

If you've misconfigured your network, didn't configure it at all, or want to change those settings you can always run netconfig again. Have fun!

   Page 1 of 1