NICs and IP addresses are not one-to-one. Many users create virtual NICs that can be assigned separate IP addresses when needed. A single physical NIC can cluster unlimited subnet cards or virtual NICs, each of which can assign its own IP address to the corresponding port. Today Xiaobian will tell you how to add virtual network cards to Linux.
The first method: express create \\ delete virtual network card
sudo ifconfig eth0:0 192.168.10.10 up
The above command can create a call on the eth0 network card The virtual network card of eth0:0, his address is: 192.168.1.63
If you do not want this virtual network card, you can use the following command to delete:
sudo ifconfig eth0:0 down
After restarting the server or network, the virtual network card is gone.
hzhsan: But found that the added virtual network card and the original network card physical address is the same.
The second way: to modify the network card configuration file
In ubuntu, LAN configuration file is /etc /network /interfaces, so we modify it:
sudo vim /etc/network/interfaces
Add the following to this file and save it:
auto eth0:0
iface eth0:0 inet static
address 192.168.10.10
netmask 255.255.255.0
#network 192.168.10.1
#broadcast 192.168.1.255
After saving, we need Restart the NIC (reload the configuration file) to take effect, use the following command to restart:
sudo /etc/init.d/networking restart
His advantage is that restarting the server or NIC configuration will not Lost.
The third method: create tap
The first two methods have a feature, the created network card can have different ip address, but the Mac address is the same. Cannot be used to create a virtual machine.
Adding a virtual network card tap
tunctl -b
Attaching a related command Introduction:
Displaying bridge information
brctl show< Br>
Adding a bridge
brctl addbr virbr0
Activating a bridge
ip link set virbr0 up
Adding a virtual NIC tap
tunctl -b
tap0 -------》 Performing the above mission will generate a tap with the suffix increasing from 0, 1, and 2
activating the created tap< Br>
ip link set tap0 up
Add the tap0 virtual NIC to the specified bridge.
brctl addif br0 tap0
Configuring an ip address for a bridge
ifconfig virbr1 169.254.251.4 up
NIC5 eth5 bound to the virbr1 bridge Remove
brctl delif virb1 eth5
Add NIC to virbr1 bridge eth6
brctl addif virbr1 eth6
The above is how Linux adds virtual NIC, three Different methods are available, and users in need can choose any method to add a virtual network card.
of configuring KVM network in RedHat KVM is a virtual machine. After installing KVM on RedHat syste
Currently, the version number of the IP protocol is 4, that is, IPv4. Then IPv6 is
Leap Second translates to the meaning of leap seconds, because the Linux system nee
I believe many people know what system files are, but few people know what the text stream is. In fa
How to identify Linux soft links and hard links
Linux installation using the compression tool 7-zip steps
Ubuntu 12.04 via XRDP Remote Desktop Method
What should I do if the Linux system Openvpn process exits abnormally?
Techniques for Handling Shared Interrupts in Linux
Ubuntu notebook can not be remotely restarted after closing the lid.
How to check if the Linux disk space is full?
How to install Linux using dstat monitoring tool
Ubuntu how to modify the command prompt PS1
How does Linux modify the PATH path of sudo?
Linux file default permissions and hidden permissions resolution
Win7 repair method in anti-virus mode in safe mode
How does Windows Server 2008 change the server name and administrator password?
In 2014, it cost 2.6 billion dollars for WP8? Nonsense
How to recover deleted files Error deleted file recovery method
How to backup Win7 system? Backup system method
Turn off windows under Windows 7 to automatically maximize functionality near the edge of the screen
Win7 system laptop graphics card can be changed?
What if win10 takes up the hard disk? Win10 disk occupancy rate of 100% solution
How to see the WeChat group is the group leader WeChat group founder view method