Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Network management

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Network Management I. IP address configuration

Linux server configuration IP address has static assignment and dynamic allocation mode to configure interface IP address.

1. Static assignment

Configure static IP through the ifconfig command

Usage: ifconfig ifname IP/length up

Configure static IP by editing the configuration file

Edit configuration file / etc/sysconfig/network-scripts/ifcfg-ifname

Restart network services

two。 Dynamic allocation

Static assignment of IP addresses can solve the above problems when the number of hosts is small and IP addresses do not change frequently. You only need to configure the interface to obtain the IP address in DHCP mode. Edit configuration file / etc/sysconfig/network-scripts/ifcfg-ifname

Restart network services

View eth2 interface IP address

II. DNS configuration

Specify that DNS Server needs to edit the configuration file / etc/resolv.conf, add

Nameserver DNS_SERVER_IP

For example: nameserver 8.8.8.8 or nameserver 114.114.114.114

Third, routing configuration 1. View rout

Usage: route-n

two。 Add rout

Usage: route add [- net |-host] target [netmask netmask-length] [gw gw-ip] [[dev] If]

Add host rout

Usage: route add-host host-ip gw gw-ip dev ifname

Add static rout

Usage: route add-net target netmask netmask-length gw gw-ip dev ifname

Add default rout

Usage: route add default gw gw-ip dev ifname

3. Delete a rout

Usage: route del [- net |-host] target [netmask netmask-length] [gw gw-ip] [[dev] If]

Delete host rout

Usage: route del-host host-ip gw gw-ip dev ifname

Delete static rout

Usage: route add-net target netmask netmask-length gw gw-ip dev ifname

Delete default rout

Usage: route del default gw gw-ip dev ifname

Fourth, network monitoring 1. Detect Network Connectivity ping Command Detection

Usage: ping option IP option description-c count specifies the number of packets returned-I interval specifies the wait interval-I ifname specifies the source interface-s packetsize specifies the ping packet size-W timeout specifies the timeout

Specifies that the packet size is 128bytes, plus the IP header 8 bytes should be 136bytes

Nmap command detection

The nmap command can be used for batch detection, usage: nmap-sP NetPrefix/netmask

two。 Test port connectivity

Telnet command detection

You can use the telnet command to simply test port connectivity. Telnet command is generally used to connect remote connection devices, because it is plaintext transmission, it is not secure, now generally use ssh protocol to remotely log in to the server. Use the telnet command to detect the state of the server port.

Usage: telnet IP port

Nc command detection

The powerful nc command can be used to detect ports.

Usage: nc-v [- t |-u] IP PORT

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report