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
Hello everyone, I am Liang Xu. When using Linux, ...
Table of contents Set a not null constraint when ...
Table of contents 1. setTimeout() timer 2. Stop t...
1. Introduction The previous program architecture...
MySQL stored procedures, yes, look like very rare...
1. Understanding the meaning of web standards-Why...
Focus images are a way of presenting content that ...
There was no problem connecting to the database y...
Here is a brief summary of the installation and c...
Table of contents 1. Mysql data structure 2. The ...
Preface Recently, I encountered a requirement at ...
Below, we introduce three ways to draw heart shap...
The insignificant flex-basis has caused a lot of ...
#!/bin/bash #Download SVN yum -y install subversi...
Today I will talk about a CSS special effect of h...