In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces what are the commonly used network commands in RHEL7, which can be used for reference. Interested friends can refer to them. I hope you will gain a lot after reading this article.
Ping checks network connectivity
Ping is often used to test connectivity to the destination host.
You can ping [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.135icmp_seq=1 Destination Host UnreachableFrom 0.284 ms 0.529 ms [root@chao] # cannot ping [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 the network
Set up 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 tabl
Show routing tabl
[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 10000 ens33172.16.1.0 0.0.0.0 255.255.255.0 U 10000 ens33192.168.122.0 0.0.0 . 0 255.255.255.0 U 0 0 0 virbr0
Add rout
[root@chao] # route add-net 172.16.2.0 netmask 255.255.255.0 gw 172.16.1.254
Delete a rout
[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 * LISTEN tcp 0 0 chao:domain 0.0.0.0 4Active Internet connections * LISTEN
View tcp port
[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 Proto Recv-Q Send-Q Local Address Foreign Address State tcp * LISTEN tcp 0 0 chao:domain 0.0.0.0 atActive Internet connections * LISTEN tcp 0 0 0.0.0.0:ssh 0.0.0.0 localhos:x11-ssh-offset * LISTEN tcp 00 localhos:x11-ssh-offset 0.0.0.0 LISTEN tcp 0 36 chao:ssh 172.16.1.100 0.0.0.0:ssh 57418 ESTABLISHEDtcp6 00 [:]: sunrpc [:: ]: * LISTEN tcp6 0 [:]: ssh [::]: * LISTEN tcp6 0 0 localhos:x11-ssh-offset [::]: * LISTEN
View udp port
[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 Proto Recv-Q Send-Q Local Address Foreign Address State udp * udp 0 0 0.0.0.0:bootps 0.0.0.0 auActive Internet connections * Udp 0 0 localhost:323 0.0.0.0 localhost:323 * 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 packets1 gateway (172.16.1.254) 0.132 ms 0.062 ms 0.086 ms2 * 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 80wget download network file [root@chao ~] # wget https:/ / mirror.bit.edu.cn/apache/httpd/httpd-2.4.43.tar.gz
Thank you for reading this article carefully. I hope the article "what are the network commands commonly used in RHEL7" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.