You are on page 1of 4

Manually Setting up TCP/IP in Linux

Introduction

This document provides detailed instructions for completely setting up a TCP/IP connection. This
includes loading the device driver, configuring the IP address, subnet mask, and gateway, and using DNS. Also,
tips are provided on how to deal with slow connection speeds and submitting driver requests for the Linux Boot
CD. Linux users might find the steps below useful if they use Secure Platform’s maintenance mode, or their
Ethernet drivers are not included with the Portlock Boot CD. In the following steps, all commands that must be
issued by the user will start with the pound ‘#’ sign.

Setup using static IP addresses:

1. Boot your system.


2. Enter your root password.
3. The system will boot up and a root prompt will be displayed that will look similar to:
“root.portlock#”

4. At the root prompt enter the following:
#ifconfig

Note that there is no networking configuration displayed.
5. Now, enter the command:
#lspci

Look for a line with “Ethernet Controller” displayed. It will look something like this: “00:11.0 Ethernet
controller: Advanced Micro Devices [AMD] 79c70
[PCnet32 LANCE] (rev 10)”

6. You will need to know the device driver name for this Ethernet controller. For VMware this is
“pcnet32”. If you do not know the name of your device driver, a list of network driver modules may be found
using the command:
#ls /lib/modules/<kernel version>/kernel/drivers/net

The kernel version can be obtained by the command:
#uname -r

Install the driver name that resembles the output from your Ethernet Controller from the previous “#lspci”
command.

7. Now that we have identified the name of the driver, we will install it with the following command:
#modprobe pcnet32

The “modprobe” command will load the driver, along with any of its dependencies. If you receive an error
when loading the driver, it is either the wrong driver or has not been compiled correctly for your linux kernel.
Repeat steps 5 and 6 to verify you have the correct driver name. If you are loading a driver from a floppy, your
driver may have to be recompiled.

8. Now that you have loaded the Ethernet device driver, you can configure your TCP/IP settings. First, set the
IP address and subnet mask with the following command:
#ifconfig –a eth0 192.168.1.230 netmask 255.255.255.0

In the example above, the device eth0 (zero) was configured. If you have multiple Ethernet cards, you may
repeat the command for eth1, eth2, etc…

9. Now we need to add a default gateway for your device. A default gateway enables your computer to
access outside your internal network:
#route add default gw 192.168.1.1 eth0

Again, eth0 may be replaced by other Ethernet devices you wish to configure.

10. Now, verify that you can access your gateway and the TCP/IP stack is working:
#ping 192.168.1.1

The command should yield a response from the gateway.

11. You can also use the “ping” command to verify your Ethernet device can access the internet. Use the
same command on an external address:
#ping 130.57.5.70

12. In order to use setup and use DNS resolution, you will need to know the ip address of at least one DNS
Server. Once you know this address, the following steps can be taken:
a) Edit the /etc/resolv.conf file to resemble the following:
search <my-isp>.<com|net|org|edu>
nameserver <DNS Server IP Address 1>
nameserver <DNS Server IP Address 2>

You may only specify up to three DNS servers in /etc/resolv.conf

b) The following commands will verify that you are using DNS resolution:
#dig www.portlock.com or
#nslookup www.portlock.com

Either command should provide information about www.portlock.com. If the commands time out or
yield no results, double check the addresses in /etc/resolv.conf.

Setup using DHCP assigned IP addresses:

1. Boot up and load your Ethernet device driver using steps 1-7 in the above section “Setup Using Static IP
Addresses”

2. To configure your system to obtain an IP address via DHCP you must edit/create two files. The first is /etc/
sysconfig/network-scrtipts/ifcfg-eth0. The file will not always be named “ifcfg-eth0”, but will have a similar
name and reside in the /etc/sysconfig/network-scripts/ directory. The file contents should look similar to:

DEVICE=eth0
USERCTL=no
ONBOOT=yes
BOOTPROTO=dhcp
BROADCAST=
NETMASK=
IPADDR=

“eth0” is the name of your first Ethernet device. If you are editing the file “ifcfg-eth1”, your device name will
be eth1.

3. Edit/create the file /etc/sysconfig/network to resemble:

NETWORKING=yes
HOSTNAME=
FORWARD_IPV4=yes
GATEWAYDEV=
GATEWAY=

4. Restart your server’s network daemon to probe for DHCP with the following command:
# . /etc/rc.d/init.d/network start

Note: There is a space between the period and the forward slash.

5. Verify that your Ethernet device has received an IP address from the DHCP server:
#ifconfig

Information should be displayed about your Ethernet device(s). The information should include your IP
address and subnet mask.

6. After setting up your TCP/IP configuration, if you wish to use DNS, reference step 12 in the section:
“Setup Using Static IP Addresses”

Slow Connection Speeds.


Often, Portlock Boot CD users experience slow connection/transfer speeds when performing an image or
restore over a TCP/IP connection. The reason for a poor rate of transfer can be caused by a number of different
variables. The simplest TCP/IP connection includes two drive I/O controllers, two Ethernet adapters, and one
Ethernet cable. In this data transfer, the speed is only as fast as the slowest component. This component is
referred to as a bottleneck. Here are some common bottlenecks and their solutions to speed up transfer rates.

1. Ethernet Adapter.
Many times, the Ethernet adapter is not configured correctly. Settings to pay attention to are:
a) Duplex- the settings for duplex are either ‘half’ or ‘full’, always have duplex set to ‘full’.

b) Autonegotiation – ‘autoneg’ is either on or off. This setting is best left ‘on’ unless you know
exactly what you are doing.

c) Speed- speed settings include 10, 100, and 1000 Mbits/second, depending on the Ethernet
adapter. Some Ethernet adapters even have speeds of 10 Gbits/second. Both Ethernet
adapters on the TCP/IP connection should be set to the highest speed possible. However,
if one adapter has a maximum speed of 100Mb/s and the other has a maximum speed of
1000Mb/s, the maximum speed for the connection will only be 100Mb/s.
The linux tool used to configure these settings manually is “ethtool”. When ethtool is used all settings
must be provided in the following order:
#ethtool –s eth0 autoneg off duplex full speed 100

The “-s” option allows the user the change some or all the Ethernet adapter settings. “eth0” is the name
of the Ethernet adapter. The name might be eth1, eth2 etc… depending on your system configuration.
For more information on how to use ethtool, the following command will provide a detailed manual
description.
#man ethtool

The “man” command will also provide information for most other linux executables.

2. Network Switches.
Many internal networks have multiple switches that connect the various parts of the network together.
Like Ethernet adapters, network switches have speeds of 10, 100, and 1000Mb/s, depending on the
switch. An optimal connection will consist of adapters and switches that are designed for 1000Mb/s.

3. Network Traffic.
If the internal network is heavily used, data transfer speeds will lag. Optimal conditions call for a
network that is closed to all other traffic. The network may be connected to the internet, but should not
be connected to the rest of your business network if transfer speeds are important.

4. I/O Controller
The disk I/O controller is often the last piece of the connection that should be examined when
experiencing slow transfer speeds. This component can not be altered to gain more speed. However,
it is best to only have critical processes running while performing your transfer. The more processes
running, the longer Storage Manager has to wait to access the information it needs.

These are the four basic bottlenecks Portlock Technical Support witnesses on a weekly basis. Other bottlenecks
include firewalls, faulty Ethernet cable, poor Ethernet drivers and more.

Submitting a Portlock Boot CD Driver Request

New hardware models are released everyday from vendors such as Intel, Adaptec, 3COM and numerous others.
New driver versions are also released on a day to day basis. In the event that an I/O controller or Ethernet
adapter driver is not part of the Portlock Boot CD, the Portlock Boot CD developers may be able to add your
driver. Not all hardware has linux support, so there is a chance that no open source driver exists for newer
controllers. If you need a support for your controller, please email support@portlock.com with the following
information:
Hardware Vendor
Hardware description
Hardware model

If the driver is proprietary to the hardware vendor, please contact your hardware vendor and request the source
code for the controller or adapter. Once you obtain the source code, contact Portlock in order to identify the
best way transfer the source files.

You might also like