Linux network configuration basis
2001-04-18 14:16:41
Set the hostname and domain name 1. Modify the file / etc / hostname file contains the host name of the system, for example: www.xxx.com II, modify file / etc / sysconfig / network, for example: networking = yeshostname = "www.xxx.com" domainname = "xxx.com" forward_IPv4 = false Sets IP address, subnet mask, and broadcast address 1, temporary configuration uses ifconfig commands, for example: ifconfig eth0 xxx.xx.xx.xx netmask xxx.xxx.xxx.xxx Broadcast xxx.xxx. XXX.XXX II. Using the Network Configuration Tool Use the Network Configuration Tool to use the command / bin / netcfg to configure the network configuration, hand-modified file IFCFG-ETH0 If your NIC is installed, you can find the following file: / etc / sysconfig / network-scripts / ifcfg- Eth0 Open File Device = Eth0ipaddr = xxx.xxx.xxx.xxxnetmask = 255.255.255.xxxnetwork = xxx.xxx.xxx.xxxBroadcast = xxx.xxx.xxx.xxxonboot = yes where iPaddr = IP address Netmask = subnet mask network mask network = Network start address Broadcast = broadcast address onboot = yes four, manual modification file inet / etc / rc.d / init.d / inet This file is the configuration file of the TCP / IP network service, the role is to set the domain name, establish a route Start the service process, you can put the ifconfig command here to configure the network card gateway router 1. Temporary configuration uses the route command, for example: Route Add Default GW xxx.xxx.xxx.xx eth0, use the network configuration tool to use the network configuration tool to use the command / bin / netcfg Configure the third, manually modified file inet / etc / rc.d / init.d / ineset route command placed here to configure the gateway route setting domain name server 1. Use the network configuration tool to use command / bin / netcfg for network configuration two, manually modify file The domain name server can be configured in resolv.conf / etc / resolv.conf, for example: Nameserver xxx.xxx.xxx.xxx network management command command action PING Check NetStat Check Network State Hostnam e Display hostname DIP Establish SLIP Connection PPPD to establish a PPP connection