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
Preface Fix the footer area at the bottom. No mat...
I found a lot of websites that use drop-down or sl...
Last night I wrote an essay about the browser ren...
Table of contents Let's talk about flattening...
In MySQL 8.0.18, a new Hash Join function was add...
Rendering Example Code Today we are going to use ...
Table of contents 1. Use of arrow functions 1. Fr...
What you will learn 1. Software installation and ...
In the previous blog, Xiao Xiong updated the meth...
I have searched various major websites and tested...
The <script> tag In HTML5, script has the f...
This article describes the commonly used MySQL fu...
1. Window -> preferences to open the eclipse p...
I have a server with multiple docker containers d...
This article example shares the specific code for...