For ease of work, multiple virtual machines are deployed under vshpere because they are test systems because they are physically disconnected from the production network. Therefore, how to use these virtual machines to build the necessary network environment, become my concern.
In fact, the switch router is essentially an operating system, but this operating system is specifically customized optimization, so we can also use the server to achieve network deployment of switches and routers.
Here are some implementation procedures:
I. Linux acting as a switch configuration
1. Create a VLAN
Vconfig eth0//eth0 Real physical network card; 10 is the VLAN number; eth0 is trunk port ifconfig eth0.10//activating the VLAN
2. Create Bridge
Brctl ADDBR brvlan10 brctl addif brvlan10 eth0.10//Bundle VLAN with bridge brctl addif brvlan10 eth1//eth1 is an access port for VLAN10
3. Configure the Gateway
Ifconfig brvlan10 172.16.1.254/24
4. Create multiple VLANs
Vconfig eth0 20ifconfig eth0.20brctl addbr brvlan20brctl addif brvlan20 eth2
At this point, the eth0 is the port of the trunk vlan10 and Vlan20, and the peer-to-peer physical port should support the trunk ports of these two VLANs
Note: In Linux, to establish a VLAN first, and the VLAN and the physical port bundle, the switch is two layer exchange, processing is a data frame, so as long as the previous two steps to achieve the same VLAN data exchange. In this example, adding a gateway is using this Linux as a three-tier interchange.
Two. Linux acts as a router configuration
1. Under Linux, turn on soft route forwarding
1. Modify the configuration file/etc/sysctl.conf
2. Change Net.ipv4.ip_forward=0 to Net.ipv4.ip_forward=1
3. Sysctl–p make configuration effective
2. Add the route entry as required, as follows:
Route add-net 192.168.1.1/24 GW 172.16.1.254
Three. Things that ESXi should be aware of
The "Virtual machine Port Group" where eth0 should be set "VLAN ID" to "All (4095)"
Reference pages:
http://blog.csdn.net/dog250/article/details/7354590
Http://www.it165.net/os/html/201208/3088.html
This article is from the "Dot Drop" blog, please be sure to keep this source http://chiweiwei.blog.51cto.com/2686252/1621330
Linux Servers act as switches and routers