eNSP实操——真机实验(模拟端)

发布时间:2024年01月22日

拓扑图 该交换机可做三层交换机 有部分路由器功能

一、先配置底端 二层交换机?

划分vlan,划分接口。

[H3C1]int g0/0/2
[H3C1-GigabitEthernet0/0/2]p l a
[H3C1-GigabitEthernet0/0/2]port default  vlan 20
[H3C1-GigabitEthernet0/0/2]q
[H3C1]
[H3C1]int g0/0/3
[H3C1-GigabitEthernet0/0/3]p l a
[H3C1-GigabitEthernet0/0/3]port default vlan 30
[H3C1-GigabitEthernet0/0/3]q
[H3C1]
[H3C1]int g0/0/1
[H3C1-GigabitEthernet0/0/1]p l t
[H3C1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 200 300
[H3C1-GigabitEthernet0/0/1]q

[H3C2]int g0/0/2
[H3C2-GigabitEthernet0/0/2]p l a 
[H3C2-GigabitEthernet0/0/2]p d vlan 200
[H3C2-GigabitEthernet0/0/2]q
[H3C2]int g0/0/3
[H3C2-GigabitEthernet0/0/3]p l a 
[H3C2-GigabitEthernet0/0/3]p d vlan 300
[H3C2-GigabitEthernet0/0/3]q
[H3C2]int g0/0/1
[H3C2-GigabitEthernet0/0/1]p l t
[H3C2-GigabitEthernet0/0/1]p t a v 10 20 30 200 300
[H3C2-GigabitEthernet0/0/1]q
[H3C2]q

二、配置三层交换机

?先配置连接二层交换机接口:trunk链路两条,网关两条,ip一条



[sanceng 1]vlan 20
[sanceng 1-vlan20]q
[sanceng 1]vlan 30
[sanceng 1-vlan30]q
[sanceng 1]
[sanceng 1]int g0/0/2
[sanceng 1-GigabitEthernet0/0/2]p l t
[sanceng 1-GigabitEthernet0/0/2]p t a v 10 20 30 200 300
[sanceng 1-GigabitEthernet0/0/2]q
[sanceng 1]
[sanceng 1]int vlanif 20
[sanceng 1-Vlanif20]ip add 192.168.1.10 27
[sanceng 1-Vlanif20]q
[sanceng 1]int vlanif 30
[sanceng 1-Vlanif30]ip add 192.168.1.40 27
[sanceng 1-Vlanif30]q
[sanceng 1]
[sanceng 1]vlan 10
[sanceng 1-vlan10]int vlanif 10
[sanceng 1-Vlanif10]ip add 192.168.1.129 27
[sanceng 1-Vlanif10]q
[sanceng 1]
[sanceng 1]int g0/0/1
[sanceng 1-GigabitEthernet0/0/1]p l t
[sanceng 1-GigabitEthernet0/0/1]p t a v 10 20 30 200 300
[sanceng 1-GigabitEthernet0/0/1]q
[sanceng 1]

[sanceng 2]vlan 200
[sanceng 2-vlan200]
q
[sanceng 2]vlan 300
[sanceng 2-vlan300]q
[sanceng 2]int g0/0/2
[sanceng 2-GigabitEthernet0/0/2]p l t
[sanceng 2-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 200 300
[sanceng 2-GigabitEthernet0/0/2]q
[sanceng 2]
[sanceng 2]int vlanif 200
[sanceng 2-Vlanif200]ip add 192.168.1.70 27
[sanceng 2-Vlanif200]q
[sanceng 2]int vlanif 300
[sanceng 2-Vlanif300]ip add 192.168.1.100 27
[sanceng 2-Vlanif300]q
[sanceng 2]
[sanceng 2]vlan 10
[sanceng 2-vlan10]q
[sanceng 2]int vlanif 10
[sanceng 2-Vlanif10]ip add 192.168.1.130 27
[sanceng 2-Vlanif10]
[sanceng 2-Vlanif10]q
[sanceng 2]int g0/0/1
[sanceng 2-GigabitEthernet0/0/1]p l t
[sanceng 2-GigabitEthernet0/0/1]p t a v 10 20 30 200 300
[sanceng 2-GigabitEthernet0/0/1]q
[sanceng 2]

三、分配自动获取地址池

[sanceng 1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[sanceng 1]ip pool q
Info:It's successful to create an IP address pool.
[sanceng 1-ip-pool-q]network 192.168.1.0 mask 27
[sanceng 1-ip-pool-q]gate 192.168.1.10
[sanceng 1-ip-pool-q]q
[sanceng 1]ip pool w
Info:It's successful to create an IP address pool.
[sanceng 1-ip-pool-w]network 192.168.1.32 mask 27
[sanceng 1-ip-pool-w]gate 192.168.1.40
[sanceng 1-ip-pool-w]q
[sanceng 1]int vlanif 20	
[sanceng 1-Vlanif20]dhcp select global 	
[sanceng 1-Vlanif20]q
[sanceng 1]int vlanif 30
[sanceng 1-Vlanif30]dhcp select global
[sanceng 1-Vlanif30]q
[sanceng 2]dhcp en	
[sanceng 2]dhcp enable 
[sanceng 2]ip pool q
[sanceng 2-ip-pool-q]network 192.168.1.64 mask 27
[sanceng 2-ip-pool-q]gate 192.168.1.70
[sanceng 2-ip-pool-q]q
[sanceng 2]ip poo w
Info:It's successful to create an IP address pool.
[sanceng 2-ip-pool-w]network 192.168.1.96 mask 27
[sanceng 2-ip-pool-w]gate 192.168.1.100
[sanceng 2-ip-pool-w]q
[sanceng 2]int vlanif 200
[sanceng 2-Vlanif200]dhcp select g	
[sanceng 2-Vlanif200]dhcp select global 
[sanceng 2-Vlanif200]q
[sanceng 2]int vlanif 300
[sanceng 2-Vlanif300]dhcp select global
[sanceng 2-Vlanif300]q

四、ospf宣告 实现互通

[sanceng 1]ospf 1 router-id 1.1.1.1
[sanceng 1-ospf-1]area 0
[sanceng 1-ospf-1-area-0.0.0.0]network 192.168.1.128 0.0.0.31
[sanceng 1-ospf-1-area-0.0.0.0]q
[sanceng 1-ospf-1]area 1
[sanceng 1-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.31
[sanceng 1-ospf-1-area-0.0.0.1]network 192.168.1.32 0.0.0.31
[sanceng 1-ospf-1-area-0.0.0.1]q
[sanceng 1-ospf-1]q
[sanceng 1]
[sanceng 1]ospf 1
[sanceng 1-ospf-1]area 1
[sanceng 1-ospf-1-area-0.0.0.1]abr-	
[sanceng 1-ospf-1-area-0.0.0.1]abr-summary 192.168.1.0 255.255.255.192
[sanceng 1-ospf-1-area-0.0.0.1]q
[sanceng 1-ospf-1]q
[sanceng 2]ospf 1 router-id 2.2.2.2
[sanceng 2-ospf-1]area 0
[sanceng 2-ospf-1-area-0.0.0.0]network 192.168.1.128 0.0.0.31
[sanceng 2-ospf-1-area-0.0.0.0]q
[sanceng 2-ospf-1]area 1
[sanceng 2-ospf-1-area-0.0.0.1]network 192.168.1.64 0.0.0.31
[sanceng 2-ospf-1-area-0.0.0.1]network 192.168.1.96 0.0.0.31
[sanceng 2-ospf-1-area-0.0.0.1]q
[sanceng 2-ospf-1]q
[sanceng 2]ospf 1
[sanceng 2-ospf-1]area 1
[sanceng 2-ospf-1-area-0.0.0.1]abr-s	
[sanceng 2-ospf-1-area-0.0.0.1]abr-summary 192.168.1.64 255.255.255.192
[sanceng 2-ospf-1-area-0.0.0.1]q
[sanceng 2-ospf-1]q

五、测试全网互通

成功!

在真机实验时,最先要注意不要记错接口,再连接到电脑给交换机配置命令,互相是可以通的!

拜拜!

文章来源:https://blog.csdn.net/m0_63884865/article/details/135716883
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。