Recent Changes - Search:

Softwares

.

HowToConfigureLinuxNetwork

Determining Your IP Address

When Linux is installed, the ethernet device is called eth0

For wireless interface it will be called wlan0

The ifconfig command.

[root@ibm ~]# ifconfig -a

eth0 Link encap:Ethernet HWaddr 00:80:48:38:C6:14

          inet addr:192.168.0.11  Bcast:192.168.0.255  Mask:255.255.255.0

Finding the interrupts associated with /proc/interrupts

file to get a listing of all the interrupt IRQs used by the system.

[root@ibm ~]# cat /proc/interrupts

           CPU0
  0:  419048047          XT-PIC  timer
  1:     144347          XT-PIC  i8042
  2:          0          XT-PIC  cascade
  3:     443514          XT-PIC  Intel ICH
  5:          0          XT-PIC  i915@pci:0000:00:02.0
  8:          3          XT-PIC  rtc
  9:   12726117          XT-PIC  uhci_hcd
 10:          0          XT-PIC  acpi, uhci_hcd, eth0
 11:       3216          XT-PIC  ehci_hcd, uhci_hcd
 12:         66          XT-PIC  i8042
 14:    1320937          XT-PIC  libata
 15:         18          XT-PIC  ide1

NMI: 0 ERR: 0

Changing Your IP Address:

[root@ibm ~]# ifconfig eth0 10.0.0.1 netmask 255.255.255.0 up

[root@ibm sysconfig]# ll /etc/sysconfig/network

-rw-r--r-- 1 root root 48 Nov 27 05:12 /etc/sysconfig/network

The configuraton file can be found at /etc/sysconfig/network-scripts directory.

Interface eth0 has a file called ifcfg-eth0, eth1 uses ifcfg-eth1, and so on.

[root@ibm ~]# cd /etc/sysconfig/network-scripts

[root@ibm network-scripts]# ls -l

        total 316
       -rw-r--r--  3 root root   122 Nov 27 05:14 ifcfg-eth0
       -rw-r--r--  3 root root   162 Sep 26 10:45 ifcfg-eth0:1

Using the startup and stop script/commands the ifdown and ifup commands:

[root@ibm ~]# which ifdown /sbin/ifdown

[root@ibm ~]# which ifup /sbin/ifup

Using the command ifup and if down

[root@ibm ~]# ifdown eth0 [root@ibm ~]# ifup eth0

Configuring the DNS server to use:

/etc/resolve.conf

Creating multiple IP addresses associated with a single NIC.

IP aliasing is one of the most common ways of creating multiple IP addresses associated with a single NIC.

[root@ibm ~]# ifconfig eth0:0 192.168.1.99 netmask 255.255.255.0 up

We have to create a /etc/sysconfig/network-scripts/ifcfg-eth0:0 file

          DEVICE=eth0:0
          ONBOOT=yes
          BOOTPROTO=static
          IPADDR=192.168.1.11
          NETMASK=255.255.255.0

Configuring the default gateway:

[root@ibm ~]# route add default gw 192.168.1.1 eth0

Updating the /etc/sysconfig/network file to reflect the change.

        NETWORKING=yes
        HOSTNAME=ibm
        GATEWAY=192.168.0.1

Checking the current routing table

[trinity@ibm ~]$ netstat -nr

Adding Routes using the file /etc/sysconfig/network-scripts/route-eth0

File /etc/sysconfig/network-scripts/route-eth0

192.168.0.0/24 via 192.168.0.1

Checking network card status and speed etc..

mii-tool - view, manipulate media-independent interface status

[root@ibm ~]# mii-tool -v

eth0: negotiated 100baseTx-FD, link ok

  product info: vendor 00:00:00, model 0 rev 0
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

Another Tool.

The ethtool command

  ethtool - Display or change ethernet card settings

[root@ibm ~]# ethtool eth0

Settings for eth0:

        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: yes
Edit - History - Print - Recent Changes - Search
Page last modified on January 26, 2006, at 01:10 AM