Linux Network Basic Configuration

Basic network configuration commands

1 Use the ifconfig command to see the network interface address

Linux Network Basic Configuration

2 hostname change the hostname

Linux Network Basic Configuration

Linux Network Basic Configuration

3 using the route / netstat -r command to view the routing table entries

Linux Network Basic Configuration

Linux Network Basic Configuration

4 Use the netstat command to view the network connection

Common options

-a Displays current host network connection information for all activities

-n display information related to the host address and port in digital form

-r Displays the routing table information

-l display and network connection port information in the listening state

View -t tcp protocol-related information

-u Displays information related to the udp protocol

-p process ID associated with the display connected to the network, process name information

When viewing utp and tcp protocol, in order to show complete and options usually used with anp

Linux Network Basic Configuration

Linux Network Basic Configuration

5 ping command to test network connectivity

Format: ping [options] target host

Windows and different systems, the ping command of the Linux system will continue to send data packets to the target host, equivalent to the windows system plus -t ping command, CTRL + C must be forcibly terminated, and the windows system and the same data packet life cycle are 64

Linux Network Basic Configuration

6 using the traceroute command tracking data packet routing path

Format: traceroute + IP destination address, the command which can be tested via the network between a node from the current host to the destination host, and displays the connection state of the intermediate node for network fault testing

Linux Network Basic Configuration

7 Use the nslookup command to test DNS name resolution

This command will resolve domain names to ip address

Format: nslookup target host address DNS server address []

Linux Network Basic Configuration

8 set network parameters

(1) Change of Address card

Linux Network Basic Configuration

Temporary configuration does not permanently change will restore after restart, use the command ifconfig

Linux Network Basic Configuration

Fixed configuration that is entering the configuration file changes

Command: vim / etc / sysconfig / network-scripts / ifcfg- card name

Linux Network Basic Configuration

(2) disable and enable card

ifconfig network interface up
ifconfig network interface down

Linux Network Basic Configuration

Linux Network Basic Configuration

Linux Network Basic Configuration

Linux Network Basic Configuration

(3) set up a virtual network interface

Set up a virtual network interface that is more than a piece of card with ip address, you can access the server via ip address configuration

Format: ifconfig interface name: No. ip address

Linux Network Basic Configuration

Linux Network Basic Configuration

Linux Network Basic Configuration

9 Set routing record route

Linux Network Basic Configuration

(1) specify the network segment

Linux Network Basic Configuration

Linux Network Basic Configuration

(2) the default gateway

Linux Network Basic Configuration

Linux Network Basic Configuration

Guess you like

Origin blog.51cto.com/14449536/2434549