Introduction to the configuration file and common commands under Linux

xiaoxiao2021-03-06  90

/ etc / sysconfig / network includes host basic network information for system startup

/ etc / sysconfig / network-script / this directory is the information of the system started the initialization network

/ etc / sysconfig / network-script / ifcfg-eth0 network configuration information

/etc/xinetd.conf Defines the network service that is started by the Super Process Xinetd

/ etc / protocols sets the protocol used by the host and the protocol numbers of each protocol

/ etc / services set network services for different ports of the host

// Network Configuration Tool

# redHat-config-network

/ * Configure and view the network interface when using the ifconfig command * /

// Configure the IP of Eth0, and activate the device at the same time.

# ifconfig eth0 192.168.168.119 Netmask 255.255.255.0 Up

// Configure the ip of Eth0 alias equipment Eth0: 1, and add a route

# ifconfig eth0: 1 192.168.168.110

# Route add -host 192.168.168.110 dev eth0: 1

// Activate (disable) device

# ifconfig eth0: 1 Up (Down)

/ / View all (specified) network interface configuration

# ifconfig (eth0)

/ * Use the route command to configure the routing table * /

// Add to the host route

# Route add -host 192.168.168.110 dev eth0: 1

# Route Add-Host 192.168.168.119 GW 192.168.168.1

// Add to the network's routing

# Route Add -Net IP Netmask Mask Eth0

# Route Add -Net IP Netmask Mask GW IP

# Route Add -Net IP / 24 Eth1

// Add a default gateway

# Route Add Default GW IP

// Delete the route

# Route del -host 192.168.168.110 dev eth0: 1

/ * Common ordered command * /

# Traceroute www.bcxy.com

# ping www.bcxy.com

// Display network interface status information

# netstat -i

/ / Display all Sockets of all monitored servers and program information that is using socket

# netstat -lpe

// Display kernel routing table information

# netstat -r

# netstat -nr

/ / Display the connection status of the TCP / UDP transport protocol

# netstat -t

# netstat -u

/ / Change the host name

# Hostname MyHost

/ / View ARP cache

# arp

//Add to

# arp -s ip mac

//delete

# arp -d ip

/ * Run level and network service * /

/ / View the current run level

# Runlevel

// Run level switch

# init

# Telinit If there is any problem, please send an email: webmaster@bcxy.com

转载请注明原文地址:https://www.9cbs.com/read-107561.html

New Post(0)