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

How to manage RHEL7 network

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

Share

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

This article shows you how to RHEL7 network management, concise and easy to understand, absolutely can make your eyes shine, through the detailed introduction of this article I hope you can gain something.

With the increase of servers, the network environment is becoming more and more complex, and linux network management is becoming more and more important. Next, we will introduce linux network management commands to improve operation and maintenance efficiency. ping Check network connectivity

Ping is often used to test connectivity to the destination host.

can ping the

[root@chao ~]# ping 172.16.1.254PING 172.16.1.254 (172.16.1.254) 56(84) bytes of data.64 bytes from 172.16.1.254: icmp_seq=1 ttl=128 time=0.529 ms64 bytes from 172.16.1.254: icmp_seq=2 ttl=128 time=0.297 ms64 bytes from 172.16.1.254: icmp_seq=3 ttl=128 time=0.135 ms64 bytes from 172.16.1.254: icmp_seq=4 ttl=128 time=0.245 ms64 bytes from 172.16.1.254: icmp_seq=5 ttl=128 time=0.214 ms^C--- 172.16.1.254 ping statistics ---5 packets transmitted, 5 received, 0% packet loss, time 4001msrtt min/avg/max/mdev = 0.135/0.284/0.529/0.133 ms[root@chao ~]#

No ping allowed.

[root@chao ~]# ping 172.16.1.250PING 172.16.1.250 (172.16.1.250) 56(84) bytes of data.From 172.16.1.16 icmp_seq=1 Destination Host UnreachableFrom 172.16.1.16 icmp_seq=2 Destination Host UnreachableFrom 172.16.1.16 icmp_seq=3 Destination Host UnreachableFrom 172.16.1.16 icmp_seq=4 Destination Host UnreachableFrom 172.16.1.16 icmp_seq=5 Destination Host UnreachableFrom 172.16.1.16 icmp_seq=6 Destination Host UnreachableFrom 172.16.1.16 icmp_seq=7 Destination Host UnreachableFrom 172.16.1.16 icmp_seq=8 Destination Host Unreachable^C--- 172.16.1.250 ping statistics ---9 packets transmitted, 0 received, +8 errors, 100% packet loss, time 8003mspipe 4

configure network

set the IP

[root@chao ~]# ifconfig ens33:1 172.16.1.114 netmask 255.255.255.0 up

Change MAC Address

[root@chao ~]# ifconfig ens33:1 hw ether 00:0c:29:0b:07:77

modify routing table

display the routing table

[root@chao ~]# route -nKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface0.0.0.0 172.16.1.254 0.0.0.0 UG 100 0 0 ens33172.16.1.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0

add route

[root@chao ~]# route add -net 172.16.2.0 netmask 255.255.255.0 gw 172.16.1.254

delete a route

[root@chao ~]# route del -net 172.16.2.0 netmask 255.255.255.0

view network status

View all ports

[root@chao ~]# netstat -a|head -4Active Internet connections (servers and established)Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:sunrpc 0.0.0.0:* LISTEN tcp 0 0 chao:domain 0.0.0.0:* LISTEN

View tcp ports

[root@chao ~]# netstat -atActive Internet connections (servers and established)Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:sunrpc 0.0.0.0:* LISTEN tcp 0 0 chao:domain 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN tcp 0 0 localhos:x11-ssh-offset 0.0.0.0:* LISTEN tcp 0 36 chao:ssh 172.16.1.100:57418 ESTABLISHEDtcp6 0 0 [::]:sunrpc [::]:* LISTEN tcp6 0 0 [::]:ssh [::]:* LISTEN tcp6 0 0 localhos:x11-ssh-offset [::]:* LISTEN

View udp ports

[root@chao ~]# netstat -auActive Internet connections (servers and established)Proto Recv-Q Send-Q Local Address Foreign Address State udp 0 0 chao:domain 0.0.0.0:* udp 0 0 0.0.0.0:bootps 0.0.0.0:* udp 0 0 localhost:323 0.0.0.0:* udp6 0 0 localhost:323 [::]:*

traceroute View routing information

[root@chao ~]# traceroute to www.baidu.com (103.235.46.39), 30 hops max, 60 byte packets 1 gateway (172.16.1.254) 0.132 ms 0.062 ms 0.086 ms 2 * * * 3 * * * 4 * * * 5 * * * 6 * * * 7 * * * 8 * * * 9 * * *10 * * *11 * * *12 * * *13 * * *14 * * *15 * * *16 * * *17 * * *18 * * *19 * * *20 * * *21 * * *22 * * *23 * * *24 * * *25 * * *26 * * *

telnet test remote port

[root@chao ~]# telnet 172.16.1.16 80

wget download network file

[root@chao ~]# wget https://mirror.bit.edu.cn/apache/httpd-2.4.43.tar.gz The above content is how to manage RHEL7 network. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserves, please pay attention to the industry information channel.

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