In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
This blog is an experimental group that combines Microsoft system with Linux system. That is, in the local area network environment, use Linux system to build DHCP service, and interconnect with Microsoft client. Note: this experiment is carried out in the virtual machine environment! Experimental structure: construction of topology in GNS3 Microsoft client configuration DHCP service configuration interconnection verification of layer 2 and layer 3 switches 1. Construction of topology in GNS3
OK, officially start the experiment!
Open GNS3 to build the topology of this experiment, through the icon bar on the left side of the main interface, drag two routing images and three HOST virtual hosts into the working interface (HOST 1, 2 as the client, HOST 3 as the DHCP server). As shown in the figure:
Then, use the network cable to connect the equipment to form the topology diagram needed for this experiment, and mark it according to the following figure to facilitate the follow-up operation.
Specific setup steps:
R1 、 R2
Right-click R1 (R2) and click "Configure", "Change hostname" and "Change symbol" respectively to modify the settings, hostname and style.
1-1 enter the Configure interface, enter "Memories and disks" and "Slots" successively
Add "PCMCIA disks0 size" and "slot 1 veneer" to routing
Click Open all to complete the construction of the overall framework of the experiment, and the specific settings will begin below.
II. Configuration of Microsoft client
The experiment is always from simple to difficult, and the configuration of the client is the easiest.
The steps are as follows:
1. Open two Win10 virtual machines in the VM virtual environment
2. Right-click the relevant host, click to set the → network adapter, and bind the two clients to VMnet 1 and 2, respectively, both in host-only mode
3. Make sure that both Win10 clients obtain IP addresses automatically.
Operation example:
This completes the setup of the Microsoft client, and then it should be Linux's turn.
Third, the construction of DHCP service
Having completed the setup of the Microsoft client, it is now the turn of this experiment to focus on the DHCP service.
The setup steps are as follows:
1. Install the DHCP service
Enter in the terminal:
[root@localhost ~] # yum install dhcp-y
Install the DHCP service.
2. Set static IP address
DHCP services usually run in a local area network environment, while servers carrying DHCP services need to have a fixed IP address.
(1) enter "vim / etc/sysconfig/network-scripts/ifcfg-ens33" to configure the ens33 network card.
(2) in the VIM editor, enter "/ dhcp" to search
(3) use the "dw" shortcut to delete the dhcp word.
(4) press "a" to insert behind the cursor and enter "static" (static IP)
(5) press "G" to navigate to the last line and use "o" to insert on the next line.
(6) input in turn
"IPADDR="-static IP address
"NETMASK="-Subnet mask
"GATEWAY="-Gateway
(7) ESC exits the insert mode and type ": wq" to save the exit.
Examples are as follows:
(8) after exiting the VIM editor, type "systemctl restart network" to restart the network server and make the changes take effect.
(9) enter "ifconfig" for verification.
Examples are as follows:
3. Modification of DHCP configuration file
If you want to build a service, a profile is essential. The main configuration file for the DHCP service is stored in "/ etc/dhcp/dhcpd.conf".
But one thing to pay attention to! After the first installation of the dhcpd.conf, there is no configuration, a blank. You need to copy a template to configure it.
Enter:
[root@localhost ~] # cp/ usr/share/doc/dhcp-4.2.5/dhcd.conf.example / etc/dhcp/dhcpd.conf
Copy the template file
At this point, there will be a template for the DHCP main configuration file "dhcpd.conf", and we just need to modify it. The steps are as follows:
(1) enter "vim / etc/dhcp/dhcpd.conf" to enter the text editor
(2) use "/ subnet" to search
(3) divide the address pool of the network segment into three VLAN domains according to the topology diagram:
Subset-- is followed by the division of network segments.
Subnet mask behind netmask--
The address pool of IP that can be assigned to this network segment after range--
The option routers-- is followed by the gateway address of the segment.
(4) ESC exits the insert mode and type ": wq" to save the exit.
Operation example:
Note: the division of the address pool and the gateway address must be in curly braces and end with a ";" sign.
Now that the DHCP has been configured, what you need to do is to turn on the service and make it run as "active".
The steps are as follows:
(1) enter "systemctl start dhcpd" to start the DHCP service
(2) enter "systemctl status dhcpd" to check whether the DHCP service is running properly (it is a good habit to start verification! )
Examples are as follows:
At this point, the configuration of the service is actually over, but it's not over yet.
When we first installed the dhcp package, it was installed through the online yum repository, but the environment needed for this experiment was a closed LAN environment. So next you need to change the mode of the VMnet8 virtual network card bound to the Linux server.
The steps to change are as follows:
(1) from the menu bar at the top of VM14, click View → drop-down menu to select a virtual network editor.
(2) locate the VMnet8 network card and click "change Settings" in the lower right corner.
(3) change its mode to "host-only mode" and uncheck the box below "assign IP addresses to virtual machines using local DHCP services".
Operation example:
At this point, the construction of the entire DHCP service is completed perfectly, and the whole experiment has entered the second half.
Configuration of layer 4, layer 2 and layer 3 switches
The server that provides the service and the client that receives the service are configured, leaving only layer 2 switches and layer 3 switches.
1. Configuration of layer 2 switch
Double-click "sw1" in GNS3 to start configuring the layer 2 switch.
The steps are as follows:
(1) enter "configure termimal" to enter global mode
(2) enter "no ip routing" to turn off the routing function of the layer 2 switch, and then enter "vlan 1010 20200" to divide the VLAN domain.
(3) enter in the interface modes of f1max 1, 1max 2 and 1max 3, respectively.
"switchport access vlan 10"-f1bin2
"switchport access vlan 20"-f1bin1
"switchport access vlan 200"-f1Comp3
Divide the three ports connecting the client and the server into the corresponding vlan domain according to the topology diagram.
(4) use "show vlan-sw brief" to verify the partition.
Operation example:
(5) enter the f1max 0 interface connected to layer 3 switching, and enter
"swichport trunk encapsulation dot1q"-sets the encapsulation format to dot1q
"switchport mode trunk"-set to trunk link
Operation example:
2. Layer 3 switch settings
Double-click sw2, go to the control window and start to set up
The steps are as follows:
(1) enter "configure termimal" to enter global mode
(2) enter "vlan 10J 20200" to divide the VLAN domain.
(3) enter the f1max 0 interface corresponding to layer 2 switching, set it as trunk link, and enter:
"swichport trunk encapsulation dot1q"-sets the encapsulation format to dot1q
"switchport mode trunk"-set to trunk link
(4) then use the three DHCP domains as virtual interfaces, set IP as gateways and relay respectively to facilitate the passage of VLANs assigned by VLANs. Enter:
"interface vlan10 (20,200)"-enter the vlan10, 20,200 virtual interface
"ip address 192.168.10 (20,200). 1 255.255.255.0"-sets IP and subnet mask as gateways for the virtual interface
"ip helper-address 192.168.200.100"-sets the relay for the DHCP server
Examples are as follows:
So far, all the devices in the whole topology diagram have been set up, and here is the moment to witness the miracle!
V. Interconnection verification
All settings have been completed and miracles begin to appear!
Enter the Win10 client, right-click the icon in the lower left corner, →, run →, enter "cmd" to enter the command prompt.
(1) enter "ipconfig" to query the client IP address
(2) enter "ping 192.168.200.100" to query whether it can be interconnected with the DHCP server.
These are all the contents of the experiment. You are welcome to leave a message for common progress in the comment area below. Any inadequacies in this experiment can also be raised in the comment area.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.