Configure the TCPIP network in Linux

Source: Internet
Author: User
Configure the Network configuration file www.2cto.com (1)/Etc/Sysconfig/Network in the TCPIP Network Linux in LINUX: This file contains the basic Network information of the host, including the host name, and is mainly used for system startup. (2)/Etc/Sysconfig/Network-script/: The Directory contains the system... configure the Network configuration file www.2cto.com (1)/Etc/Sysconfig/Network under the tcp ip Network Linux in LINUX: This file contains the basic Network information of the host, including the host name, and is mainly used for system startup. (2)/Etc/Sysconfig/Network-script/: The Directory contains the most initial Network information for system startup, including some common Nic configurations and startup commands. (3)/Etc/Sysconfig/Network-script/ifcfg-eth0: This file contains the configuration information for the Network adapter eth0 (4)/Etc/Xinetd. conf: This file defines the network service started by the super server process Xinetd. (5)/Etc/Protocols: This file sets the protocol used by the host and the protocol numbers of each protocol. (6)/Etc/Services: this file sets the network service with different ports on the host to use commands to configure the network www.2cto.com 1. the ifconfig command ifconfig is a frequently used command to configure IP addresses, gateways, and other network card information. (1) configure the IP address of Eth0 and activate the device: # ifconfig eth0 192.168.10.88 netmask 255.255.255.0 upifconfig command to use the Down command when disabling the device. for example, # ifconfig eth0 down (2) configure the IP address for the alias of the device Eth0: # ifconfig eth0: 1 192.168.10.188 (3) view the specified network port configuration: # ifconfig eth0 (4) view all network excuse configurations: # The ifconfig2.route command can be used to configure and view the configuration of the kernel route table. (1) route to host // indicates that the route to host 192.168.10.188 is a network device eth0: 0 # route add-host 192.168.10.188 dev eth0: 0 // indicates that the route to host 192.168.10.148 goes through the Gateway 192.168.10.40 # route add-host 192.168.10.148 gw 192.168.10.40 (2) route entry to network // indicates that the route entry to network 192.168.10.0 is eth0 # route add-net 192.168.10.0 netmask route entry 255.0 eth0 // indicates the Gateway 192.168.10.1 # route that routes the route entry to host 192.168.10.148 add-net192.168.10.0 netmask1_255.255.0 gw192.168.10.1 // indicates that the route to network 192.168.10.0 is Network Device eth1 # route add-net 192.168.10.0/24 eth1 (3) add default gateway # route add default gw 192.168.10.1 (4) view kernel route table configuration # route (5) delete a route # route del-host 192.168.1.2 dev eht0: 0 # route del-host route gw 10.20.30.40 # route del-net route netmask route 248 eth0 # route del-net route netmask route 248 gw 10.20.30.41 # route del-net 192.168.1.0/24 eth1 default gw 192.168.1.13.ping command ping command You can test network connectivity # ping www. google. the com4.Netstat command can use the netstat command to display network status information (1) display network interface status: # netstat-I (2) display information about Scoket and programs using Scoket in all monitoring servers: # netstat-lpe (3) display kernel route table information: www.2cto.com # netstat-r # netstat-nr (4) display TCP/UDP transmission protocol connection status: # netstat-t # netstat-u5.Hostname command Hostname can modify the host name: # Hostname set_your_name6.ARP command can view ARP command to configure and view ARP cache (1) view ARP cache # arp (2) add an IP address and MAC address record # arp-s 192.168.10.15 34: 560: 78: 17: AB: F3 (3) delete an IP address and MAC address The corresponding cache record # arp-d 192.168.10.157.DHCP needs to modify the/Etc/Sysconfig/Network file for configuration, and modify the configuration file of each Network device in the Etc/Sysconfig/Network-scripts directory. In this directory, each device has a configuration file named Ifcfg-ethX. the EthX is the name of the network device, such as Eth0 and Eth1. If you want to start the NIC and its configuration during boot, the NETWORKING variable must be set to yes. In addition, the/Etc/Sysconfig/network file should contain the following lines: NETWORKING = yesDEVICE = eth0BOOTPROTP = dhcpONBOOT = yes. then, restart the NIC and run the following command: # ifdown eth0 # ifup eth0
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.