In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Add an isolation marker:
Ip netns add fd
two。 Put the specified network card in isolation:
Ip link set eth2 netns fd
3. Execute the command in an isolated environment:
Ip netns exec fd ifconfig eth2 downip netns exec fd ifconfig eth2 upip netns exec fd ip addr add 192.168.1.2/24 dev eth2
4. When there are multiple network ports, you can connect two pairs of network ports directly, configure the same network segment ip, and perform ping operation to verify whether the isolated network port ip configuration is successful:
Ping-I eth3 192.168.1.2
Knowledge point expansion: detailed explanation of Linux's command to view ip
I believe that the method of viewing ip in Linux is very similar to understanding. Today, I will introduce to you an urgent command for Linux to view ip for your reference and study. The following is a specific introduction.
Ifconfig
Linux command to check the IP address-- ifconfig
The ifconfig command is used to view and change the address and parameters of a network interface
$ifconfig-a lo0: flags=849 mtu 8232 inet 127.0.0.1 netmask ff000000 hme0: flags=863 mtu 1500 inet 211.101.149.11 netmask ffffff00 broadcast 211.101.149.255 ether 8:0:20:a7:4d:21
The system displays the name of the network interface and the status of the interface (up or down)
Information such as IP address and mask of the interface
Change the IP address of the network interface:
# ifconfig hme0 down # ifconfig hme0 211.101.149.233 netmask 255.255.255.0 up
First, use the down command parameter to temporarily stop the service of the network interface hme0, then use the Linux View ip ifconfig command to assign a new IP address and mask to the interface, and start the network interface service. You can also change the IP address of the machine by changing the value of the IP address in the file / etc/hosts and restarting the system.
/ etc/hosts/: 211.101.149.11 sampdt defines hostnames in / etc/hostname.hme0 and IP addresses.
The Nic has been changed / added, and the system cannot start the interface service automatically. In this case, you need to create the Nic manually:
# ifconfig hme0 plumb
Linux can create a network port service for the interface le0 by viewing ip.
Accordingly, using ifconfig with the unplumb parameter can stop the service and shut down the network.
Netconfig is used to set the IP address
Summary
The above is the Linux introduced by the editor to use the ip netns command to isolate the network port and configure the ip address. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!
If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!
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.