VMware implements a network in a computer
From Develpworks Author:
Forrest
This article explores the use of VMware to simulate multiple computers on one computer, and achieves multiple analog machines in a more complex network environment, and uses Zebra Routing Software and IPv6 as an example to test and instructions. Why do you want this test? Use VMware for software developers and network maintenance personnel, very meaningful. It is not only that it can easily simulate a virtual machine environment for work, but also to operate some operations such as network attacks, destructive experiments, etc., if VMware will be very safe, because virtual The impact of the environment is just the impact on a data file, which does not really generate other problems with the Host host hardware device software program. The system adjustment above the production system has not been tested data, and the direct launch of the risks will impose a huge risk. If software development or system management uses VMware, it will be ideal for this type of testing and research. In addition, many network environments test and experiments, we must use switches (or HUB), a bunch of network cables, multiple test equipment. When the author is online experiment from the 25-series router with Cisco, 5 Cisco routers and a bunch of network cables are not small, and this experiment is expensive. VMware Workstation Version is virtual computer software developed by VMware for desktop users under stand-alone criteria. With this software, users can customize multiple virtual computers simultaneously under a real operational platform and a complex network environment. In some cases, you can abandon the big pile of network equipment! Another point, there are currently a lot of information on a single system using VMware, but the information that pays attention to the virtual network environment is not very common, here you can want to throw the jade. What is VMware? VMware is a powerful virtual machine software (http://www.vmware.com) for VMware INC. It has multiple versions, with GSX, ESX versions for the server, and Workstation versions for desktop users. A very complete Ethernet environment can be provided in VMware, even 9 virtual switches in VMware are available! For more information, please see his online manual. The experimental environmental router is a nuclear equipment in the network, and the test learning and research of the router in the actual network environment is reality, and a more complex router environment is costly. With Linux's powerful router software Zebra, with VMware's Virtual Network, we can build your own router experimental environment and can continue to expand according to your needs. In addition, IPv6 and other tests must use multiple network devices and analyze the network analysis tools to better understand and learn. 1. Environmental Preparation: Experimental Environment: 1) IBM ThinkPad R40e Laptop (CPU P4 2.0G, 256M Memory, 30gdisk) 2) Windowns XP Home Edition SP13) VMware Workstation 4.0.5 Build-6030 30days license2, change network configuration : After installing VMware, first I changed the VMware's network environment (find Virtual Network Setting in the VMware's EDIT menu).
The steps are as follows: 1) Point EDIT under Virtual Network Setting ..., pop-up the Virtual Network Editor dialog; 2) In the Virtual Network Editor dialog box, the button "...", "...", then pop up the Subnet of the menu , Then set the subnet; 3) Subnet1 set to 192.168.1.0/255.255.255.0: The subnets of Mnet2, Vmnet3, Vmnet4 ,VMnet8 ,VMnet9 were taken from 192.168.0.0/255.25.255.0, 192.168.3.0/255.255.255.0, respectively. 192.168.4.0, 192.168.0, 192.168.9.055.0, 192.168.9.0/255.255.255.0.4) Other VMNet idle, up to 9 subnets can be set as needed. 3, Network Custom Optimization: 1) Since the default installation VMware is obtained by the IP address, I have disabled VMware's DHCPD service after installation, and then disabled the use of DHCP to obtain IP. 2) If in order to access the virtual machine to access the external network, you should set a VMNET to access the external network using the NAT service, and the default VMNET8 can access the external network through NAT. The default gateway of this subnet segment is set to 192.168.8.2 and make sure the NAT Service service starts. 3) Confirm that Automatic BridGing's Automatic Bridge's Automatic Bridge An Available Physical Network Adapter to Bridge to VMNET0 option is selected. 4. Virtual Machine Tailor Optimization In order to run multiple virtual machines on a machine, it is best to do some optimization of each virtual machine. Depending on the experience of use, the demand for memory is much larger than the Utilization of the CPU in the virtual machine that operates in the virtual machine. Therefore, we are equipped with R1, R2, R3, R4 and R5, which is based on Debian GNU / Linux, and it is recommended to optimize the Kernel of each virtual machine to reduce system overhead for actual machines. Personal practices are as follows: 1) The simplest installation of virtual system Debian 3, install the target folder and the virtual machine is named R1; 2) Increase the necessary virtual machine hardware, such as NIC, etc .; 3) In other debian Linux virtual Compiling the software tools of BIN in the machine environment, get the R1 virtual machine through SCP or FTP, etc., and do related configurations.
Here I have installed some of the network tools such as IPUTILS, IPROUTE2, TCPDUMP, SSHD, ZEBRA and other software; 4) In order to do IPv6 testing, compiling a KERNEL supporting IPv6 in other environments also gets the R1 virtual; 5) Prepare ZEBRA Prepare: Change the .sample file under / usr / local / zebra / etc; 6) Confirm that the R1 virtual machine is ready, turn off the R1 virtual machine; 7) and then back up this installation system data folder Permanently backed up, copy 4 copies, named R2, R3, R4, R5; 8), then "Open Existing Virtual Machine" in VMware, and change the respective VitRual in Option Machine Names are R2, R3, R4, R5; 9), respectively, change the corresponding settings of R2, R3, R4, R5, respectively, and change the IP address / IPv6 address, etc., respectively. 5. Build the following network topology map: Network configuration: 6, test: Start the virtual machine of R1 to R5, and check the Unicom of the virtual network. Check other virtual machines of the unique network segment in each virtual machine to do related tests as the R1. If you want to have more deep observation about the communication process of the network, open TCPDUMP in the second console interface of R1, check the information you want to observe at any time.
1) Detection NIC address ifconfig or IP command: r1: ~ # ip A1: eth0:
Note that this is not only possible to use the DEBUG of the various routing software of Zebra to observe the working process of the routing protocol, and can also take more detailed observations using Linux TCPDUMP. 4) Start the Zebrad and related routing protocol process services (for better experiments, each routing protocol separately); 5) Open the dynamic routing discovery, see if all routers have been discovered? :) Virtual Machine Network Environment Router Mode is said to be as follows: 6) We can fully imagine, using so many "routers" experiments various route protocols. If you have more ideas, such as using serial ports, parallel communication can also be tried. :) 7) Read more detailed use of Zebra Read Zebra's manual and other information. IPv6 software Test Environment IPv6 is the next version of the IP protocol, and with the development of network technology, it is increasingly entering everyone's sight. Here is a simple IPv6 test to verify the newly established network with VMware. It is recommended to open TCPDUMP-6 detailed observation of the IPv6 protocol work. 1) IPv6 test preparation: IPROUTE and IPUTILS have been installed when installing the system, which can be tested for IPv6, and the part of the Linux version is not loaded with the IPv6 support module by default. Please load it at each. R1: ~ # modprobe ipv6 && lsmod | GREP IPv6 If the IPv6 module is successfully loaded, please do the following R1: ~ # i -6 a S1: Eth0:
(Because R4 does not open IPv6, you will not see the corresponding IPv6 address of R4) R1: ~ # ping6 -i eth0 Fe80 :: 20c: 29ff: Fe07: 1B34PING Fe80: 1b: 29ff: Fe07: 1B34 (Fe80 :: 20c : 29ff: fe07: 1b34) from Fe80 :: 20c: 29ff: feae: a159 eth0: 56 da bytes64 bytes from Fe80 :: 20c: 29ff: Fe07: 1b34: ICMP_SEQ = 1 TTL = 64 Time = 6.10 MS64 BYTES from Fe80: : 20C: 29ff: Fe07: 1B34: ICMP_SEQ = 2 TTL = 64 TIME = 89.1 MS --- Fe80 :: 20c: 29ff: Fe07: 1b34 Ping Statistics --- 3 Packets Transmitted, 3 Received, 0% Packet Loss, Time 2003msrtt min / avg / max / mdev = 1.835 / 32.373 / 89.185 / 40.209 MSIPv6 PING command is the ping6 command in the IPUTIL kit, you must note that if there are multiple network card interfaces, it must be used to specify which network card interface to use . 3) Discover IPv6 routing: The IPv6 routing table in the default route is as follows: r1: ~ # ip -6 RFE80 :: / 64 dev eth0 metric 256 MTU 1500 Advms 1440FE80 :: / 64 dev eth1 metric 256 MTU 1500 Advms 1440fe80 :: / 64 dev eth2 metric 256 mtu 1500 advmss 1440ff00 :: / 8 dev eth0 metric 256 mtu 1500 advmss 1440ff00 :: / 8 dev eth1 metric 256 mtu 1500 advmss 1440ff00 :: / 8 dev eth2 metric 256 mtu 1500 advmss 1440default dev eth0 proto kernel metric 256 mtu 1500 advmss 1440default dev eth1 proto kernel metric 256 mtu 1500 advmss 1440default dev eth2 proto kernel metric 256 mtu 1500 advmss 1440unreachable default dev lo proto none metric -1 error -1014) test ipv6 local service system currently supports linux server software has been very ipv6 More, common software such as OpenSshd / Sshd, Apache, Bind, Telnetd, Iptables-IPv6, NMAP, etc. Here is a test with SSHD.
R1: ~ # ssh-6 :: 1host Key Not Found from Database.Key Fingerprint: XOBIT-PIHUZ-GYPEK-LOKAD-LELIZ-HUPIM-PAVEK-PYVEM-CANAM-NEFAF-LAXAXYOU CAN GET A Public Key's FingerPrint by Running% SSH -Keygen -f publickey.pubon the key? iver You Want to Continue Connecting (YES / NO)? 5) IPv6-in-IPv4 Tunnel Test Since IPv4 has already achieved many years in the network, and the development of Internet has increased IPv4 Development, current IPv6 actual situation in the network is that IPv6 is like an isolated ocean by IPv4, and each IPv6 network connection needs to pass IPv4 networks, and there is a common IPv6-IPv4 tunnel. This virtual environment is used to perform an experiment (R1-R2) of the IPv6-In-IPv4 Tunnel (R1-R2). On the R1 machine: IP -6 AddR Add 3ffe: 3200 :: 1/24 dev eth0 # Give ETH0 Set a local IPv6 address, use CERNET Test IPv6 Address as an Example IP Tunnel Add 6to4 Mode Sit Remote 192.168.8.12 Local 192.168 .8.11 # Add a 6to4 channel IP link set dev 6to4 up # activation 6to4 channel IP -6 AddR Add 3ffe: 3200 :: 1/24 dev 6to4 # to channel Add Local IPv6 address IP-6 R add 3ffe: 3200 :: 2 / 24 DEV 6TO4 # Add to use channel devices IPv6 routing, due to testing, destination network is the opponent IPv6 address on R2 machine: IP -6 AddR add 3ffe: 3200 :: 2/24 dev eth0ip tunnel add 6to4 Mode Sit Remote 192.168.8.12ip Local 192.168.8.12ip Link SET DEV 6TO4 UPIP-6 AddR Add 3ffe: 3200 :: 2/24 DEV 6TO4IP-6 R ADD 3ffe: 3200 :: 1/24 DEV 6TO4 can also join R3, R4 , R5 IPv6 Tunnel for more complex testing.
On the R1 and R2 devices, use the ping6 command to view the peer IPv6 address; on the R1 and R2 devices, use the SSH-6 IPv6 address to pass the IPv6 Tunnel login point to other IPv6 devices; R1: ~ # ssh -6 3ffe : 3200 :: 2Host key not found from database.Key fingerprint: xobit-pihuz-gypek-lokad-leliz-hupim-pavek-pyvem-canam-nefaf-laxaxYou can get a public key's fingerprint by running% ssh-keygen -F publickey b??????::: b b b b b b b b b b b b b b b b b b b b b b Root Wed Mar 31 2004 19:12:51 0800Root's Password: Authentication Successful.R2: ~ # W08: 16: 21 Up 3:02, 3 Uses, Load Average: 0.00, 0.01, 0.00User Tty from login @ idle jcpu PCPU What: 3200 :: 11 08:16 0.00S 0.13s 0.04s WR2: ~ # OK, we have seen the IPv6-in-IPv4 Tunnel to see we use IPv6 address to log in to another device! This process is tcpdump results on R2: 08: 23: 35.833428 3ffe: 3200 :: 2.1047> 3ffe: 3200 :: 1.ssh: s 2462930696: 2462930696 (0) Win 5760
3ffe: 3200 :: 2.1047:. ACK 50 WIN 5632
192.168.8.11: 3ffe: 3200 :: 1.Ssh> 3ffe: 3200 :: 2.1047:. ACK 826 WIN 6432