Network Configuration

From LinuxFanBoy
Jump to: navigation, search

If you are new to Linux are you are looking for how to configure your Linux Network go to http://www.linuxhomenetworking.com

That said, there are some Linux network configurations you don't often use.

Network Control Files

/etc/sysconfig/network - Turn on/off networking and set the hostname.
/etc/sysconfig/network-scripts  - This directory contains scripts to control networking.

NETWORK CONFIGURATION

The fast method for making all the changed needed for IP configuration is to use system-config-network.

CentOS 5-2009-06-20-22-50-59.png

CentOS 5-2009-06-20-22-54-34.png

The files starting with ifcfg- like ifcfg-eth0 control the device configuration. This is an example of ifcfg-eth0 for network interface eth0. BOOTPROTO (dhcp or eth0) control how the port is used. ONBOOT (yes or no) control if the port is started at boot time.

The HWADDR value makes sure the correct card is assigned the correct values. (Linux does not always start the devices in the same order if new devices are added.)

DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:50:56:BB:0F:14
ONBOOT=yes

With the configuration files setup you can restart the network with the command:

  service network restart

or by hand

  ifdown eth0

then

 ifup eth0

Check the default gateway with:

  route -r

The command arp can be used to display the ARP table, delete a table entry and save a new entry.

  arp
  arp -d workstation
  arp -s workstation 00:00:c0:ff:aa:bb

Check the netmask and other settings with:

 ifconfig eth0
 eth0 Link encap:Ethernet HWaddr 00:08:C7:10:74:A8
 BROADCAST MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:100
 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
 Interrupt:11 Base address:0x1820

Who do you set a card to 100-Full or 10-half> -Mark 7/29/07 3:12 PM

lsof
Personal tools