华为模拟器用三层交换使网络互通实验报告
实验目的:
1.pc地址都是DHCP获取IP;
2.C1,C3在vlan10,C2,C4在vlan20,且实现互通;
3.pc都能访问外网;
4.在AR2能够远程AR1
所需设备:
使用ENSP模拟器模拟2台路由器 1台三层交换机2台二层交换机 4台PC机
实验拓扑图:
实验步骤:
1.给二层交换机划分vlan,并把每个接口加入各自的vlan和建立中继口。
LSW1:划分vlan:
[Huawei]vlan 10 划分vlan 10
[Huawei-vlan10]vlan 20 划分vlan 20
把接口加入vlan:
[Huawei]int e0/0/1 进接口
[Huawei-Ethernet0/0/1]port link-type access 创建access口
[Huawei-Ethernet0/0/1]port default vlan 10 把接口e0/0/1加入vlan 10
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port default vlan 20
[Huawei-Ethernet0/0/2]intg0/0/1
配置中继口:
[Huawei-GigabitEthernet0/0/1]port link-type trunk 创建trunk口
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20创建中继口
LSW2同LSW1
2.给三层交换机划分vlan,并且建立中继口和配置每个vlan的网关地址。
[Huawei]vlan 10
[Huawei-vlan10]vlan 20
配置中继口:
[Huawei-Vlanif20] g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
[Huawei-GigabitEthernet0/0/1] g0/0/2
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
配置中继口:
[Huawei-Vlanif20] g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
[Huawei-GigabitEthernet0/0/1] g0/0/2
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
DHCP:
[Huawei]dhcp enable 激活DHCP
[Huawei]int vlan 10进入虚拟vlan接口
[Huawei-Vlanif10]dhcp select interface 开启vlan 10自动获取IP
[Huawei-Vlanif10]dhcp server dns-list 8.8.8.8 配置DNS
[Huawei-Vlanif10]int vlan 20
[Huawei-Vlanif20]dhcp select interface
[Huawei-Vlanif20]dhcp server dns-list 9.9.9.9
验证:
3.能够让pc访问到AR1。
[Huawei]vlan 100 创建vlan100
[Huawei-vlan100]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 100
[Huawei-Vlanif100]int vlan 100
[Huawei-Vlanif100]ip add 192.168.1.1 24
[Huawei-Vlanif100]un shutdown
注:三层交换机没有三层接口所以给SW1g0/0/3和AR1不好配置在一个网段,只能用虚拟vlan接口来配置IP。
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.2 配置三层交换机到AR1交换机的默认路由
给AR1配置IP和静态路由。
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.2 24
[Huawei-GigabitEthernet0/0/0]un shutdown
[Huawei]ip route-static 192.168.10.0 255.255.255.0 192.168.1.1 配置R1到10.0网段的静态路由
[Huawei]ip route-static 192.168.20.0 255.255.255.0 192.168.1.1 配置R1到20.0网段的静态路由
4.让pc用户能够访问外网。
配置路由器AR2IP
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 202.106.1.2 30
[Huawei-GigabitEthernet0/0/0]un shutdown
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 202.106.1.1 30
[Huawei-GigabitEthernet0/0/1]un shutdown
测试能够互通就行
给路由器AR1开启远程登录
[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]au
[Huawei-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):123
[Huawei-ui-vty0-4]q
[Huawei]super password cipher abc123
[Huawei]q
在AR2上测试远程登陆AR1,如图,登陆成功,实验结束