In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Experimental requirements:
1.sw2 is a layer 2 switch, with three vlan,f1/1-3s of vlan10,vlan20,vlan100 as access links and f1amp 0 as trunk links.
2.sw1 is a layer 3 switch, which provides gateways for three vlan, vlan10:192.168.10.1/24, vlan20:192.168.20.1/24, vlan100:192.168.100.1/24, and the external network interface is f1Uniplex 12.0.0.1Unix 24.
3. Local area network internal Linux server set up dhcp service function to provide addresses for vlan10,vlan20 and vlan100, address range:
Vlan10:192.168.10.100~192.168.10.200 subnet mask: 255.255.255.0 gateway 192.168.10.1Univer 24
Vlan20:192.168.20.100~192.168.20.200 subnet mask: 255.255.255.0 gateway 192.168.20.1 Universe 24
Vlan100:192.168.100.100~192.168.100.200 subnet mask: 255.255.255.0 gateway 192.168.100.1 Universe 24
The address of the dns server is: 192.168.100.100Universe 24
Among them, the win10-1 host always gets the 192.168.10.18 win10 24 address, and the dhcp-2 server automatically assigns the address.
4. The local area network internal Linux server sets up the DNS service function to resolve the www.kgc.com and www.yun.com domain names, the resolution address is 14.0.0.14 Web server, while the DNS server provides pan-domain name resolution function, and the resolution address is 8.8.8.8
5. In the external network, there is a WEB server built by server2016, and the virtual machine host is established to provide two websites, namely www.kgc.com and www.yun.com, to customize the differential display of the home page, to achieve the final interconnection of the whole network, and the functional access is sound.
Experimental operation: 1. GNS3 setting
1. Build the topology diagram in GNS3.
two。 First of all, configure the sw2.
Sw2#conf t / / enter global mode sw2 (config) # no ip routing / / turn off routing function sw2 (config) # vlan10, 20100 / / add vlan10, vlan20, Vlan100sw2 (config-vlan) # int f1amp 1 / / enter interface f1/1sw2 (config-if) # sw mode acc / / interface mode is set to accesssw2 (config-if) # sw acc vlan10 / / add interface to vlan10sw2 (config-if) # Int f1int 2 / / enter interface f1/2sw2 (config-if) # sw mode acc / / interface mode is set to accesssw2 (config-if) # sw acc vlan20 / / add interface to vlan20sw2 (config-if) # int f1max 3 / / enter the interface f1/3sw2 (config-if) # sw mode acc / / set the interface mode to accesssw2 (config-if) # sw acc vlan100 / / add the interface to vlan100sw2 (config-if) # ex / / exit interface mode sw2 (config) # int F1 * / enter interface f1/0sw2 (config-if) # sw mode t / / interface mode is set to trunksw2 (config-if) # sw t en dot / / the encapsulation type of trunk is set to dot1qsw2 (config-if) # ex / / exit interface mode sw2 (config) # do show vlan-sw b / / View vlanVLAN Name Status Ports -1 default active Fa1/4 Fa1/5, Fa1/6, Fa1/7 Fa1/8, Fa1/9, Fa1/10, Fa1/11 Fa1/12, Fa1/13, Fa1/14 Fa1/1510 VLAN0010 active Fa1/120 VLAN0020 active Fa1/2100 VLAN0100 active Fa1/3.. / / omit some content sw2 (config) #
3. Configure sw1.
Sw1#conf t / / enter global mode sw1 (config) # vlan10, 20100 / / add vlan10, vlan20, Vlan100sw1 (config-vlan) # ex / / exit sw1 (config) # int vlan10 / / enter vlan10sw1 (config-if) # ip add 192.168.10.1 255.255.255.0 / / configure ip address and subnet mask sw1 (config-if) # ip helper-address 192.168.100.100 / / configure ip address of DHCP server sw1 (config-if) # no shut / / enable vlan10sw1 (config-if) # Int vlan20 / / enter vlan20sw1 (config-if) # ip add 192.168.20.1 255.255.255.0 / / configure ip address and subnet mask sw1 (config-if) # ip helper-address 192.168.100.100 / / configure DHCP server Ip address sw1 (config-if) # no shut / / enable vlan20sw1 (config-if) # int vlan100 / / enter vlan100sw1 (config-if) # ip add 192.168.100.1 255.255.255.0 / / configure ip address and subnet mask sw1 (config-if) # ip helper-address 192.168.100.100 / / configure ip address of DHCP server sw1 (config-if) # no shut / / enable vlan100sw1 (config-if) # ex / / exit sw1 (config) # int f1ram 0 / / enter interface f1/0sw1 (config-if) # sw mode t / / The interface mode is set to trunksw1 (config-if) # sw t en dot / / trunk encapsulation type is set to dot1qsw1 (config-if) # ex / / exit sw1 (config) # int F1 / / enter interface f1/1sw1 (config-if) # no switchport / / disable layer 2 interface sw1 (config-if) # ip add 12.0.0.1 255.255.255.0 / / set the ip address and subnet mask sw1 (config -if) # no shut / / enable the interface sw1 (config-if) # speed 100 / / set the rate to 100Msw1 (config-if) # duplex full / / Add default route sw1 (config) # for full-duplex sw1 (config-if) # ex / / exit sw1 (config) # ip route 0.0.0.0 0.0.0.0 12.0.0.2 / /
4. Configure router R2.
R3#conf t / / enter global mode R3 (config) # int f0Let0 / / enter interface f0/0R3 (config -if) # ip add 12.0.0.2 255.255.255.0 / / set the ip address and subnet mask R3 (config-if) # no shut / / enable interface R3 (config-if) # int f0max 1 / / enter interface f0/1R3 (config-if) # ip add 14.0.0.1 255.255.255.0 / / set ip address and subnet mask R3 (config-if) # no shut / / enable interface R3 (config-if) # ex / / exit R3 (config) # ip route 192.168.0.0 255.255.0.0 12.0.0.1 / / add static route R3 (config) #
2. Preparation of virtual machine experiment
1. In the Linux system, install the related programs of DHCP and DNS services.
Input: yum install dhcp-y input: yum install bind-y
two。 Bind the win10-1 system as a VMnet1 network card.
3. Bind the win10-2 system as a VMnet2 network card.
4. Bind the sever2016 system to the VMnet3 network card.
5. Bind the Linux system to the VMnet8 network card.
6. Change the type of the VMnet8 Nic to host-only mode and turn off the ability to assign IP addresses with the local DHCP server.
3. Configure DHCP service
1. First make a copy of the dhcp service profile template to overwrite the original profile. At the same time, edit it with the vim editor.
Input: cp/ usr/share/doc/dhcp-4.2.5/dhcpd.conf.exmple / etc/dhcp/dhcpd.conf input: yes input: vim / etc/dhcp/dhcpd.conf
two。 Change the dhcp server address configuration file "option domain-name-servers ns1.example.org, ns2.example.org;" in the configuration file to "option domain-name-servers 192.168.100.100;"
3. Add the address assignment file for three network segments: subnet is the network segment, netmask is the subnet mask, range is the allocation range of ip addresses, and option routers is the gateway. (pay attention to the format. Any error in the configuration file will cause the service to fail to start.)
Subnet 192.168.10.0 netmask 255.255.255.0 {range 192.168.10.100 192.168.10.200; option routers 192.168.10.1;} subnet 192.168.20.0 netmask 255.255.255.0 {range 192.168.20.100 192.168.20.200; option routers 192.168.20.1 } subnet 192.168.100.0 netmask 255.255.255.0 {range 192.168.100.100 192.168.100.200; option routers 192.168.100.1;}
4. Query the MAC address of the win10-1 system.
Input: ipconfig / all
5. Add a fixed ip assigned configuration ask price in the dhcp configuration file "/ etc/dhcp/dhcpd.conf".
Host fantasia {hardware ethernet 00VOCVRO 29VOUR 1EVOLAR 27LARO 9B; fixed-address 192.168.10.18;}
6. Use the vim editor to configure the network card and set a fixed IP address.
Enter: vim / etc/sysconfig/network-scripts/ifcfg-ens33 change dhcp to static add: IPADDR=192.168.100.100NETMASK=255.255.255.0GATEWAY=192.168.100.1
7. Restart the network service to see if the ip address is set successfully.
Input: systemctl restart network input: ifconfig
8. Start the dhcp service with the "systemctl start dhcpd" command.
9. Use the "ipconfig" command to view the IP address of the win10-1 system, and successfully obtain the fixed assigned ip address.
10. Use the "ipconfig" command to check the IP address of the win10-2 system, and successfully get the ip address of the address pool.
Configure the DNS server
1. Use the vim editor to edit the main configuration file of the dns service.
Enter: vim / etc/named.confoptions {listen-on port 53 {any;}; listen-on-v6 port 53 {:: 1;}; directory "/ var/named"; dump-file "/ var/named/data/cache_dump.db"; statistics-file "/ var/named/data/named_stats.txt"; memstatistics-file "/ var/named/data/named_mem_stats.txt" Recursing-file "/ var/named/data/named.recursing"; secroots-file "/ var/named/data/named.secroots"; allow-query {any;}
two。 Use the vim editor to edit the zone profile for the dns service.
Enter: vim / etc/named.rfc1912.zoneszone "kgc.com" IN {type master; file "kgc.com.zone"; allow-update {none;};}; zone "yun.com" IN {type master; file "yun.com.zone"; allow-update {none;};}
3. Enter the "/ var/named" directory, first make a copy of "named.localhost" named "kgc.com.zone" with the "cp-p" command, and then edit it with the vim editor.
Input: cd / var/named input: cp-p named.localhost kgc.com.zone input: vim kgc.com.zone$TTL 1D @ IN SOA @ rname.invalid. (0; serial 1D; refresh 1H; retry 1W; expire 3H) Minimum NS @ A 127.0.0.1www IN A 14.0.0.14 * IN A 8.8.8.8
4 then use the "cp-p" command to copy a "kgc.com.zone" file named "yun.com.zone", then turn off the firewall and enhanced security features, and turn on the dns service.
Input: cp-p kgc.com.zone yun.com.zone input: systemctl stop firewalld.servce input: setenforce 0 input: systemctl start named
5. On the win10-1 system, use the "nslookup" command to check whether the dns server can parse, and the result is successful.
6. On the win10-2 system, use the "nslookup" command to check whether the dns server can resolve, and the result is also successful.
5. Configure Web service
1. Add web service functionality to the server2016 system. (omit simple steps)
two。 Set a fixed ip address to the server2016 system and turn off the firewall function.
3. Add two web sites, "kgc" and "yun".
4. At the command prompt, create your own Web site files under the physical path directory of the two sites.
C:\ Users\ Administrator > cd. /.. C:\ > cd kgc.siteC:\ kgc.site > echo "this is KGCC packages!" > index.htmlC:\ kgc.site > cd.. C:\ > cd yun.siteC:\ yun.site > echo "this is yunks!" > index.htmlC:\ yun.site >
5. Using win10-2 system to visit two websites respectively, both of them can be visited successfully.
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.