1. Add the isolation marker: 2. Put the specified network card into isolation: 3. Execute commands in an isolated environment: ip netns exec fd ifconfig eth1 down ip netns exec fd ifconfig eth1 up ip netns exec fd ip addr add 192.168.1.2/24 dev eth1 4. If there are multiple network ports, you can directly connect two pairs of network ports, configure IP addresses in the same network segment, and perform a ping operation to verify whether the isolated network port IP address configuration is successful: Knowledge point extension: Linux command to view IP address I believe everyone would like to know how to check IP in Linux. Today, I will introduce to you the following commands for checking IP in Linux for your reference and study. The following is a detailed introduction. ifconfig Linux command to view IP address The ifconfig command is used to view and change the address and parameters of the 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 will display the name of the network interface, the status of the interface (up or down), Interface IP address and mask information To change the IP address of a 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 network interface hme0, then use the Linux ifconfig command to view ip 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 If the network card is changed/added, the system cannot automatically start the interface service. In this case, you need to manually create the network port service: Linux can create a network port service for interface le0 by checking ip Accordingly, use ifconfig with the unplumb parameter to stop the service and shut down the network. netconfig is used to set the IP address Summarize The above is what I introduced to you about using the ip netns command to isolate network ports and configure IP addresses under Linux. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: In-depth explanation of the locking mechanism in MySQL
>>: JavaScript to implement dynamic digital clock
Table of contents Understanding SQL Understanding...
Preface To put it simply, tcpdump is a packet ana...
Table of contents 1. The elephant that can’t fit ...
This article example shares the specific code of ...
This article uses examples to describe MySQL tran...
Table of contents 1. Project Environment 2. Proje...
This article shares the specific code of Bootstra...
MySQL full-text index is a special index that gen...
Table of contents 1. Count data is lost Solution ...
glibc is the libc library released by gnu, that i...
Because if there is no forward slash at the end of...
Shtml and asp are similar. In files named shtml, s...
Introduction to DNMP DNMP (Docker + Nginx + MySQL...
Table of contents background accomplish Supplemen...
I believe that people who have experience with Re...