1. TCP/IP network configuration file
2. Use commands to configure the network
3. Network Diagnostic Tools
TCP/IP network configuration file
IP configuration file:/etc/sysconfig/network-scripts/ifcfg-eth0
Network Management Configuration File:/etc/sysconfig/network
Domain name resolution:/etc/host. conf
Host Configuration:/etc/hosts
Route configuration:/etc/resolv. conf
Service port configuration:/etc/services
Network Interface STARTUP script:
[Root @ asm ~] # More/etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE = eth0
BOOTPROTO = static
BROADCAST = 192.168.8.255
HWADDR = 00: 0C: 29: 8B: 86: 65
IPADDR = 192.168.8.160
NETMASK = 255.255.255.0
NETWORK = 192.168.8.0
ONBOOT = yes
[Root @ asm ~] # More/etc/sysconfig/network
NETWORKING = yes
NETWORKING_IPV6 = no
HOSTNAME = asm.Oracle.com
GATEWAY = 192.168.8.1
/Etc/hosts
This file is the local host name resolution database of the system.
[Root @ asm ~] # More/etc/hosts
# Do not remove the following line, or various programs
# That require network functionality will fail.
127.0.0.1 localhost. localdomain localhost
: 1 localhost6.localdomain6 localhost6
192.168.8.160 asm.oracle.com asm
The/etc/host. conf file is used to specify how to resolve the host name. Available options:
Order: Set the available methods and sequence for host name resolution. Available methods include hosts (using the/etc/hosts file for resolution), bind
(Using DNS resolution), nis (using Network Information Service NIS resolution)
Multi: sets whether to return multiple IP addresses of the host from the/etc/hosts file. The value is on/off.
The/etc/resolv. conf file is DNS (the client configuration file of DNS Domain Name Service ):
[Root @ asm ~] # More/etc/resolv. conf
Nameserver 192.168.8.11
Search oracle.com
Domain oracle.com
/Etc/services: Set the default TCP or UDP port used by the Network Service
Use the command line tool or GUI tool to configure the Linux Network:
[Root @ asm ~] # Ifconfig
Eth0 Link encap: Ethernet HWaddr 00: 0C: 29: 8B: 86: 65
Inet addr: 192.168.8.160 Bcast: 192.168.8.255 Mask: 255.255.255.0
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 23894 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 1864 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 1708719 (1.6 MiB) TX bytes: 309503 (302.2 KiB)
Interrupt: 75 Base address: 0x2000
Lo Link encap: Local Loopback
Inet addr: 127.0.0.1 Mask: 255.0.0.0
Up loopback running mtu: 16436 Metric: 1
RX packets: 18747 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 18747 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 1215290 (1.1 MiB) TX bytes: 1215290 (1.1 MiB)
[Root @ asm ~] # Ifconfig eth0 192.168.8.161 netnask 255.255.255.0 up
[Root @ asm ~] # Ifconfig eth0 192.168.8.160 netnask 255.255.255.0 up
[Root @ asm ~] # Ifconfig eth0
Eth0 Link encap: Ethernet HWaddr 00: 0C: 29: 8B: 86: 65
Inet addr: 192.168.8.160 Bcast: 192.168.8.255 Mask: 255.255.255.0
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 24260 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2001 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 1736070 (1.6 MiB) TX bytes: 327830 (320.1 KiB)
Interrupt: 75 Base address: 0x2000
Modify the configuration file to restart the NIC. You can also modify the IP Address:
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Service network restart
Vi/etc/sysconfig/network
Vi/etc/resolv. conf