Recently, XP, RedHatEnterprise5, and Ubuntu9.04 were installed in Ubuntu10.10 with VitualBox. They wanted to Ping each other to build a built-in LAN and ping each other, it was found that the virtual machine can be pinged directly between the virtual machine and the host, but the host cannot be pinged to any virtual machine, and a lot of information has been found .. Finally solved the problem. You can Ping each other .. (The Internet is amazing .) The specific VBOX version is slightly different,
Recently, XP, Red Hat Enterprise 5, and Ubuntu9.04 were installed with VitualBox in Ubuntu10.10. They wanted to Ping each other and connect the four of them so as to build a built-in LAN for playing and ping each other, it was found that the virtual machine can be pinged directly between the virtual machine and the host, but the host cannot be pinged to any virtual machine, and a lot of information has been found .. Finally solved the problem. You can Ping each other .. (The Internet is amazing .)
The specific VBOX version is a little different. I cut my own picture.
First, install two libraries for bridging the network. Run the following commands in Ubuntu to install these libraries:
Sudo apt-get install uml-utilities bridge-utils
Then, a user group named "uml-net" will appear in the system. Use the following command to add users running virtual machines to the group:
Sudo gpasswd-a user_name uml-net red part is the user name of your own virtual machine, which is generally the same as your host
Replace "user_name" with the user name of the user running the virtual machine, and then edit the network interface configuration file:
Sudo vi/etc/network/interfaces
Add the following paragraph at the end or beginning of the file:
Auto tap0
Iface tap0 inet manual
Up ifconfig $ IFACE 0.0.0.0 up
Down ifconfig $ IFACE down
Tunctl_user user_name is set above
The configuration information above indicates that the virtual network interface is set to "tap0", its IP configuration method is manual, and the user using this interface is "user_name ". Configure a bridge and add the following content below the configuration information:
Auto br0
Iface br0 inet dhcp
Bridge_ports all tap0
The configuration information indicates that a bridge named "br0" is created, and the IP address is obtained automatically through DHCP. All network interfaces of the local machine are obtained, the "tap0" virtual interfaces will all be built on this bridge. If you want to manually specify an IP address, you can replace the preceding configuration information with the following:
Auto br0
Iface br0 inet static
Address 192.168.0.5
Netmask 255.255.255.0
Network 192.168.0.0
Broadcast 192.168.0.255
Gateway 192.168.0.1
The configuration information above sets the IP address of the bridge to "192.168.0.5 ".
Save the file, restart the system, and enter the following command in the virtual terminal to enable the bridge network. This command only needs to be executed once:
Sudo/sbin/ifup br0
Sudo/sbin/ifup tap0
Open VirtualBox, select the Guest system from the list, click "Settings"> "network" on the toolbar, and select one of the listed network adapters, generally, only one "network adapter 0" is used. Click "enable network adapter". Then, select "Host Interface" from the drop-down list after "Connect ", at the same time, make sure that the "access network cable" is selected, and then fill in "tap0" in "host Network Interface Name". Do not worry about the remaining. Click "OK" and then start Guest. Set the system IP address to automatically obtain to make the bridge network take effect.
In this section, check your own virtual machine version. My settings are as follows:
After the settings, You can Ping the host and the virtual machine:
Note: In XP, if ping is successful, you must turn off the firewall first.
After Ping each other, you can set up the corresponding server to communicate with each other. If you do not configure it, you will not write it, and you will learn more ...... TFTP, SAMBA ..