文章目录
实验要求
![实验要求](https://gitee.com/jixiansiwei/ImagesBed/raw/master/Network/Configuration/VLAN/实验要求.png)
实验分析
- tj-R:单臂路由实现VLAN间通信
- tj-sw:以太网链路实现
- bj-R:单臂路由实现VLAN间通信;DHCP服务
- R、SW:开启远程管理
- 路由协议采用RIPv2
实验拓扑
![实验拓扑](https://gitee.com/jixiansiwei/ImagesBed/raw/master/Network/Configuration/VLAN/实验拓扑.png)
实验过程
0x01 DHCP-Server配置
-
打开DHCP-Server配置界面设置IP信息,操作结果如下图所示。
-
打开DHCP-Server服务配置界面,开启并配置DHCP服务操作结果如下图所示。
0x02 tj-sw1配置
![tj-sw1配置](https://gitee.com/jixiansiwei/ImagesBed/raw/master/Network/Configuration/VLAN/tj-sw1配置.png)
0x03 tj-sw2配置
![tj-sw配置](https://gitee.com/jixiansiwei/ImagesBed/raw/master/Network/Configuration/VLAN/tj-sw配置.png)
0x04 tj-R配置
![tj-R配置](https://gitee.com/jixiansiwei/ImagesBed/raw/master/Network/Configuration/VLAN/tj-R配置.png)
0x05 ISP-A配置
![ISP-A路由配置](https://gitee.com/jixiansiwei/ImagesBed/raw/master/Network/Configuration/VLAN/ISP-A路由配置.png)
0x06 ISP-B配置
![ISP-B配置](https://gitee.com/jixiansiwei/ImagesBed/raw/master/Network/Configuration/VLAN/ISP-B配置.png)
0x07 bj-R配置
![bj-R配置](https://gitee.com/jixiansiwei/ImagesBed/raw/master/Network/Configuration/VLAN/bj-R配置.png)
0x08 bj-w配置
![bj-w配置](https://gitee.com/jixiansiwei/ImagesBed/raw/master/Network/Configuration/VLAN/bj-w配置.png)
0x09 Web-Server配置
-
打开Web-Server的Desktop配置界面设置IP操作结果如下图所示。
-
打开Web-Server服务配置界面,开启HTTP服务操作解雇如下图所示。
0x10 DNS-Server配置
-
打开DNS-Server的Desktop配置界面设置IP操作结果如下图所示。
-
打开DNS-Server服务配置界面,开启DNS服务操作解雇如下图所示。
实验结果
-
PC1通过DHCP获取到的IP地址如下图所示。
-
PC4通过DHCP获取到的IP地址如下图所示。
-
PC2访问
www.baidu.com
显示结果如下图所示。 -
PC3远程管理tj-sw1操作结果如下图所示。
-
PC3远程管理tj-R操作结果如下图所示。
-
PC5远程管理bj-sw操作结果如下图所示。
-
PC5远程管理bj-R操作结果如下图所示。
注意事项
- vlan20必须在tj-sw1中配置,否则PC2无法获取IP地址
- DHCP跨VLAN分配IP必须配置DHCP中继
附录
tj-sw1:
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname tj-sw1
vlan 100
vlan 10
vlan 20
exit
int f0/1
switchport mode access
switchport access vlan 100
int f0/2
switchport mode access
switchport access vlan 10
int f0/3
switchport mode trunk
switchport trunk allowed vlan all
int range f0/4-6
switchport mode trunk
switchport trunk allowed vlan all
channel-group 1 mode on
ex
line vty 0 4
pass cisco
login
exit
enable pass cisco
int vlan 10
ip add 192.168.10.2 255.255.255.0
no sh
ex
ip default-gateway 192.168.20.1
tj-sw2:
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname tj-sw2
vlan 10
vlan 20
exit
int f0/1
switchport mode access
switchport access vlan 20
int f0/2
switchport mode access
switchport access vlan 10
int range f0/4-6
switchport mode trunk
switchport trunk allowed vlan all
channel-group 1 mode on
ex
line vty 0 4
pass cisco
login
exit
enable pass cisco
int vlan 10
ip add 192.168.10.3 255.255.255.0
no sh
ex
ip default-gateway 192.168.20.1
tj-R:
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname tj-R
int s1/0
ip add 223.221.159.1 255.255.255.0
clock rate 9600
no sh
int f0/0.1
encapsulation dot1Q 100
ip add 192.168.10.1 255.255.255.0
no sh
ip helper-address 192.168.10.254
int f0/0.2
encapsulation dot1Q 10
ip add 192.168.20.1 255.255.255.0
no sh
ip helper-address 192.168.10.254
int f0/0.3
encapsulation dot1Q 20
ip add 192.168.30.1 255.255.255.0
no sh
ip helper-address 192.168.10.254
int f0/0
no sh
ex
router rip
version 2
network 192.168.10.0
network 192.168.20.0
network 192.168.30.0
network 223.221.159.0
ex
line vty 0 4
pass cisco
login
exit
enable pass cisco
ISP-A:
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname ISP-B
int f0/0
ip add 111.111.111.1 255.255.255.0
no sh
int f0/1
ip add 11.11.11.1 255.255.255.0
no sh
int s1/0
ip add 223.221.159.2 255.255.255.0
no sh
ex
route rip
version 2
network 223.221.159.0
network 111.111.111.0
network 11.11.11.0
ISP-B:
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname ISP-B
int f0/0
ip add 222.222.222.1 255.255.255.0
no sh
int f0/1
ip add 11.11.11.2 255.255.255.0
no sh
int s1/0
ip add 223.11.115.1 255.255.255.0
clock rate 9600
no sh
ex
route rip
version 2
network 11.11.11.0
network 222.222.222.0
network 223.11.115.0
bj-R:
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname bj-R
int f0/0.1
encapsulation dot1Q 100
ip add 192.168.100.1 255.255.255.0
no sh
int f0/0.2
encapsulation dot1Q 200
ip add 192.168.101.1 255.255.255.0
no sh
int f0/0
no sh
int s1/0
ip add 223.11.115.2 255.255.255.0
no sh
ex
ip dhcp pool vlan100
network 192.168.100.0 255.255.255.0
default-router 192.168.100.1
dns-server 222.222.222.222
ex
ip dhcp excluded-address 192.168.100.1 192.168.100.10
ip dhcp pool vlan200
network 192.168.101.0 255.255.255.0
default-router 192.168.101.1
dns-server 222.222.222.222
ex
ip dhcp excluded-address 192.168.101.1 192.168.101.10
route rip
version 2
network 223.11.115.0
network 192.168.100.0
network 192.168.101.0
ex
line vty 0 4
pass cisco
login
exit
enable pass cisco
bj-sw:
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname bj-sw
vlan 100
vlan 200
exit
int f0/1
switchport mode access
switchport access vlan 100
int f0/2
switchport mode access
switchport access vlan 200
int f0/3
switchport mode trunk
switchport trunk allowed vlan all
ex
line vty 0 4
pass cisco
login
exit
enable pass cisco
int vlan 100
ip add 192.168.100.2 255.255.255.0
no sh
ex
ip default-gateway 192.168.100.1