DistributedNetworks DistributedNetworks


Network Computing   «Prev  Next»
Lesson 4 Troubleshooting TCP/IP with ifconfig
Objective Use ifconfig Command to resolve Problems

Use ifconfig Command to resolve TCP/IP Problems and Linux Networking

loopback ifconfig Output
ifconfig's default action displays data on each active interface. If /sbin is not in your PATH variable, you must type the command's entire path, /sbin/ifconfig to display the data. To see the status of just the eth0 interface, tell ifconfig to display this interface by typing ifconfig eth0 at a command prompt. ifconfig's -a option shows all interfaces, whether they are active or not. Click the View SlideShow button to view a typical output from ifconfig -a.

Correcting network parameters

If ifconfig indicates that some parameter is configured incorrectly, you can fix the problem by editing the interface's network script. Network scripts are located in the /etc/sysconfig/network-scripts directory. The first Ethernet interface's script is called ifcfg-eth0, and the second is called ifcfg-eth1. The following image shows an ifcfg-eth0 file that has the same IP address and netmask as the interface in the Slide Show.

Device, USERCTL, ONBOOT, BOOTPROTO, NETWORK, NETMASK
Device, USERCTL, ONBOOT, BOOTPROTO, NETWORK, NETMASK

To make a change, edit the file to update, or correct the network information;, executing ifup eth0 will bring up the eth0 interface, and load the new parameters. If the interface is already activated, then precede this command with "ifdown eth0".

In the next lesson, you will learn how to troubleshoot TCP/IP with arp.