Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Comprehensive experiment-(layer 2 switching, layer 3 switching, router, dhcp+dns

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Experimental environment: GNS3-1.3.10 VMware Workstation

The purpose of the experiment is to achieve the final interworking of the whole network and improve the functional access. Cross countless obstacles, go to the distant side to see you, let the mountains and rivers become your help.

Experimental requirements:

1) sw1 is a layer 2 switch (the first mountain), with three vlan,f1/1-3 access links for vlan10,vlan20,vlan100 and a trunk link for f1max 0 (a river).

2) sw3 is a layer 3 switch (the second mountain), 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 F1 _

3) the Linux server within the local area network sets up the dhcp service function to provide addresses and address ranges for vlan10,vlan20 and vlan100

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

4) the local area network internal Linux server sets up the DNS service function to analyze www.kgc.com and www.yun.com

The resolution address is 14.0.0.14amp 24 public network WEB server, while providing pan-domain name resolution function, the resolution address is 8.8.8.8

5) there is a WEB server built by server2016 in the public network, 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 home page content.

6) realize the final interconnection of the whole network and improve the function access.

Mountain after mountain ~

The topology diagram is as follows:

The steps of the experiment:

1. First, set up the topology diagram above on GNS3, open four virtual machines in VMware Workstation, two win10 PCs, one centos7 as linxu server, and one server2016 to build web service and prepare the basic equipment. Then we began to conquer the first mountain-the sw1 layer 2 switch. First of all, add vlan to him so that he can interconnect in different Lans (the first bridge). Build the second bridge on the f1ap0 interface as a trunk link.

Sw1#conf t enters global mode

Sw1 (config) # v1an 10pm 20100 add three vlan

Sw1 C config-vlan) # ex

Sw1 (config) # int f1amp 1 enters the f1amp 1 interface

Sw1 (config-if) # sw mo acc enters the acc interface

Sw1 (config-if) # sw acc vlan 10 configures vlan for the interface

Sw1 (config-if) # ex

Sw1 (config#int f1amp 2 enters the f1max 2 interface and configures vlan for the interface

Sw1 (config-if) # sw mo acc

Sw1 (config-if) # sw acc vlan 20

Sw1 (config-if) # ex

Sw1 (config) # int f1amp 3 enters the f1amp 3 interface and configures vlan for the interface

Sw1 (config-if) # sw mo acc

Sw1 (config-if) # sw acc vlan 100

Sw1 (config-if) # ex

Sw1 (config) # do show v1an-sw b to view the configuration

Sw1 (config) # int f1amp 0 enters the interface f1amp 0

Sw1 (config-if) # sw mo t enters the trunk interface

Sw1 (config-if) # sw t

Sw1 (config-if) # sw t en dot1q

Sw1 (config-if) # ex

Sw1 (config) # do show int f1amp 0 switchport to view the interface configuration

Sw1 (config) # no ip routing turns off routing

2. Conquer the second mountain, sw3 layer 3 switching, and provide gateways for three vlan. Add a trunk link to the f1ap0 interface.

Sw3#conf t enters global mode

Sw3 (config) # v1an 10, 20100 add three vlan

Sw3 (config-vlan) # ex

Sw3 (config) # int f1amp 0 enters the f1bin0 interface and configures it with trunk links

Sw3 (config-if) # sw mo t

Sw3 (config-if) # sw t en do

SW3 (config-if) # sw t en dot1q

Sw3 (config-if) # ex

Sw3 (config) # do show int f1and0 switchport to check the configuration

Sw3 (config) # int vlan10 enters vlan10, configures IP for vlan10, and configures virtual interface

Sw3 (config-if) # ip add 192. 168.10.1 255. 255.255.0

Sw3 (config-if) # ip he1per-address 192. 168.100.100

Sw3 (config-if) # no shut

Sw3 C config-if) # ex

Sw3 (config) # int v1an 20 enter vlan20, configure IP for vlan10, configure virtual interface

Sw3 (config-if) # ip add 192. 168.20.1255. 255.255.0

Sw3 (config-if) # ip he1per-address 192. 168.100.100

Sw3 (config-if) # no shut

Sw3 (config-if) # ex

Sw3 (config) # int v1an 100 enter vlan100, configure IP for vlan10, configure virtual interface

Sw3 (config-if) # ip add 192. 168.100.1 255. 255.255.0

Sw3 (config-if) # ip he1per-address 192. 168.100.100

Sw3 (conf ig-if) # no shut

Sw3 C config-if) # ex

Sw3 (config) # so show ip int b to view the configuration

3. Build the third bridge, enter the f1cane1 interface, configure IP, duplex and rate matching, and connect to our route R1

Sw3 (config) # int f1amp 1 enters the interface

Sw3 (config-if) # no switchport enables layer 2 switching

Sw3 (config-if) # no shut

Sw3 (config-if) # ip add 12.0.0.1 255. 255.255.0 configure IP

Sw3 (config-if) # no shut

Sw3 (config- if) # speed 100Duplex rate matching

Sw3 (config-if) # duplex fu11

Sw3 (config-if) # ex

Sw3 (config) # do show ip toute to view the configuration

4. Configure R1 routing, conquer the third mountain, and configure IP,f0/1 and IP for interface f0x0. Configure default rout

R1#conf t enters global mode

R1 (config) # int f0swap 0 enters interface f0zip 0

R1 (config-if) # ip add 12.0.0.2 255. 255.255.0 configure IP

R1 (config-if) # no shut is enabled

R1 (config-if) # ex

Rl (config) # int f0Uniq1 enters interface f0Uniq1

R1 (config-if) # ip add 14.0.0.1 255. 255.255.0 configure IP

R1 (config-if) # no shut is enabled

R1 (config-if) # ex

R1 (config) # ip route 192.168.0. 0255. 255.0. 012.0.0.1 configure default rout

5. Configure linux, configure dhcp service and dns service. First, install the dhcp,dns toolkit in net networking mode. Then switch to host-only mode to bind the network card VMnet8, configure static IP and DHCP service as required

Download and install DHCP software package with yum warehouse

[root@localhost ~] # yum install dhcp-y install DHCP package

[root@localhost ~] # yum install bind-y install bind tool

B. Switch to custom mode to bind vmnet8

C. Configure static IP and restart the network service

[root@localhost ~] # vim / etc/sysconfig/network-scripts/ifcfg-ens33 change configuration static IP

D. Configure the dhcp server. The DHCP service file is empty. You need to find and copy the template to the DHCP configuration file, and then configure it. Start the DHCP service after the configuration is completed.

[root@localhost ~] # rpm-qc dhcp View the path of the dhcp main configuration file

[root@localhost ~] # cp/ usr/share/doc/dhcp-4.2.5/dhcpd.conf.example / etc/dhcp/dhcpd.conf overwrites dhcp's main profile template to its own dhcp file directory

[root@localhost ~] # vim / etc/dhcp/dhcpd.conf configure dhcp service

[root@localhost ~] # systemctl start dhcpd starts the dhcpd service

E. Configure dns service

[root@localhost ~] # rpm-qc bind View configuration file

F, configure the main configuration file, modify the listen-on address, and access permissions

[root@localhost ~] # vim / etc/namde.conf configuration main configuration file

G, configure the zone profile, add the domain name to be resolved, and the path where the zone data configuration file is located

[root@localhost ~] # vim / etc/named.rfc1912.zones configuration zone configuration file

F. Copy the zone data configuration file (named.localhost) that comes with the system to the zone data file (kgc.com.zone/yun.com.zone) that you want to parse your own configuration.

Be careful to retain the original permissions, and then go to your area data file to edit and configure your parsing data.

Root@localhost ~] # cd / var/named/

[root@localhost ~] # cp-p named.localhost kgc.com.zone retains the original permission to copy to kgc.com.zone

[root@localhost ~] # vim kgc.com.zone

[root@localhost ~] # cp-p kgc.com.zone yun.com.zone retains the original permission to copy to yun.com.zone

I. Turn off the firewall and the features that enhance security.

[root@localhost named] # systemctl stop fi rewalld. Service, turn off the firewall

[root@localhost named] # setenforce 0 turns off the enhanced security feature

J and dns forward parsing has been built, and local tests are conducted to see if the experiment is successful. Use the host command.

6. Set the two PCs to host-only mode, bind wein10-1 to vmnet1, change win10-2 to custom mode, and bind vmnet2. Cmd to see if you can automatically get the address of the network segment of 10 prime 20.

B. Open win10-1, enter cmd command, enter ipconfig, and check the IP address.

Open win10-2 and enter the cmd command. Enter ipconfig to view the IP address.

C. Ping tests whether the network is unobstructed.

7. Open sever2016 to build web service, first set it to custom binding network card vmnet3, and configure it with IP (14.0.0.14).

A. Set up the network card

B. Set a fixed IP14.0.0.14

C. Set up web service

D. Configure www.kgc.com.

8. Communicate between different servers to view the experimental results.

A, PC visits the web page-- success

B. PC ping server2016-- succeeded

C, PC resolution domain name verification dns service set up-successful

D, win10-2 ping win10-2 check the communication between two PCs-- success

The experiment ended successfully. With the determination to move forward, any hindrance is not a problem, and we will succeed in reaching the finish line.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report