In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what is the use of IP tools in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The ifconfig command has been deprecated on Linux for more than a decade, and the iproute2 project contains the magical tool ip. Many online tutorial resources still use old command-line tools such as ifconfig, route, and netstat. The goal of this tutorial is to share some web-related things that can be easily done with ip tools.
Find out your IP address [dneary@host] $ip addr show [snip] 44: wlp4s0: mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 5c:e0:c5:c7:f0:f1 brd ff:ff:ff:ff:ff:ff inet 10.16.196.113and23 brd 10.16.197.255 scope global dynamic wlp4s0 valid_lft 74830sec preferred_lft 74830sec inet6 fe80::5ee0:c5ff:fec7:f0f1/64 scope link valid_lft forever preferred_lft forever
Ip addr show will tell you a lot about all your web-linked devices. In this case, my wireless Ethernet card (wlp4s0) is the IPv4 address (inet field) 10.16.196.113 and 23. / 23 means that 23 bits of the 32-bit IP address will be shared by all IP addresses in the subnet. The IP address range in the subnet is from 10.16.196.0 to 10.16.197.254. The broadcast address of the subnet (the brd field after the IP address) 10.16.197.255 is reserved for broadcast traffic for all hosts on the subnet.
We can only use ip addr show dev wlp4s0 to display information about a single device.
Show your routing table [dneary@host] $ip route listdefault via 10.16.197.254 dev wlp4s0 proto static metric 60010.16.196.0 metric 23 dev wlp4s0 proto kernel scope link src 10.16.196.113 metric 601192.168.122.0 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
The routing table is the way in which local hosts help network traffic determine where to go. It contains a set of road signs that send traffic to a specific interface and to a specific next location on its journey.
If you run any virtual machine or container, they will get their own IP address and subnet, which may complicate these routing tables, but there are usually two instructions in a single host. For local traffic, it is sent to the local Ethernet, and the network switch will find out (using a protocol called ARP) which host has the destination IP address and where to send the traffic. For traffic to the Internet, send it to the local gateway node, which will better understand how to reach the destination.
In the above case, the * * line represents the external gateway for external traffic, the second line represents local traffic, and the third line represents the virtual bridge of the virtual machine running on the host, but the link is not currently active.
Monitor your network configuration [dneary@host] $ip monitor all [dneary@host] $ip-s link list wlp4s0
The ip monitor command can be used to monitor changes to the routing table (network addressing on the network interface) or changes to the ARP table on the local host. This command is particularly useful when debugging network problems related to containers and networks, such as when two virtual machines should be able to communicate with each other, but they cannot.
When using all, ip monitor reports all changes prefixed with [LINK] (network interface change), [ROUTE] (change routing table), [ADDR] (IP address change), or [NEIGH] (independent of horse-related changes related to the neighbor's ARP address).
You can also monitor changes on specific objects (for example, specific routing tables or IP addresses).
Another useful option for many commands is ip-s, which provides some statistics. Add the second-s option to add more statistics. The ip-s link list wlp4s0 above gives a lot of information about the packets received and sent, the number of packets dropped, the errors detected, and so on.
Tip: shorten your command
In general, for ip tools, you only need to include enough letters to identify what you want to do. You can use ip mon instead of ip monitor. You can use ip a l instead of ip addr list, and you can use ip r instead of ip route. Ip link list can be abbreviated to ip l ls.
The above is all the content of the article "what are the IP tools in Linux?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow 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.
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.