下图为综合项目示例图,详细命令见图下:
屏蔽垃圾信息
undo terminal monitor
undo terminal trapping
undo terminal logging
undo terminal debugging
save
给三层和普通交换机之间相连接的所有接口配置TRUNK
port-group 1
group-member g0/0/1 g0/0/2 g0/0/3 g0/0/4 g0/0/5
port link-type trunk
port trunk allow-pass vlan all
普通交换机,
vlan batch 10 20 30 40
interface Ethernet 0/0/1
port link-type access
port default vlan 10 20 30 40
interface Ethernet 0/0/2 .. 0/0/5
port link-type turnk ...
创建VLAN,三层交换机1
vlan batch 10 20 30 40
interface Vlanif 10
ip address 192.168.10.252 24
interface Vlanif 20
ip address 192.168.20.252 24
interface Vlanif 30
ip address 192.168.30.252 24
interface Vlanif 40
ip address 192.168.40.252 24
创建VLAN,三层交换机2
vlan batch 10 20 30 40
interface Vlanif 10
ip address 192.168.10.253 24
interface Vlanif 20
ip address 192.168.20.253 24
interface Vlanif 30
ip address 192.168.30.253 24
interface Vlanif 40
ip address 192.168.40.253 24
配置vrrp,给三层交换机配置,记得vrid要区别
in vl10
vrrp vrid 1 virtual-ip 192.168.10.254
vrrp vrid 1 priority 105
in vl20
vrrp vrid 2 virtual-ip 192.168.20.254
vrrp vrid 2 priority 105
in vl30
vrrp vrid 3 virtual-ip 192.168.30.254
in vl40
vrrp vrid 4 virtual-ip 192.168.40.254
给另一台三层交换机配置
in vl10
vrrp vrid 1 virtual-ip 192.168.10.254
in vl20
vrrp vrid 2 virtual-ip 192.168.20.254
in vl30
vrrp vrid 3 virtual-ip 192.168.30.254
vrrp vrid 3 priority 105
in vl40
vrrp vrid 4 virtual-ip 192.168.40.254
vrrp vrid 4 priority 105
三层交换,添加新的VLAN并配地址
三层LSW1
valn 50
interface Vlanif 50
ip address 192.168.50.2 24
interface GigabitEthernet 0/0/7
port link-type access
port default vlan 50
valn 70
interface Vlanif 70
ip address 192.168.70.2 24
interface GigabitEthernet 0/0/8
port link-type access
port default vlan 70
三层LSW2
valn 80
interface Vlanif 80
ip address 192.168.80.2 24
interface GigabitEthernet 0/0/7
port link-type access
port default vlan 80
valn 60
interface Vlanif 60
ip address 192.168.60.2 24
interface GigabitEthernet 0/0/8
port link-type access
port default vlan 60
路由器AR1
interface GigabitEthernet 0/0/0
ip address 192.168.50.1 24
interface GigabitEthernet 0/0/1
ip address 192.168.60.1 24
路由器AR2
interface GigabitEthernet 0/0/0
ip address 192.168.80.1 24
interface GigabitEthernet 0/0/1
ip address 192.168.70.1 24
动态路由:路由器,三层交换机都设置,所有连接的网段
ospf
area 0
network 192.168.10.0 0.0.0.255
network 192.168.20.0 0.0.0.255
network 192.168.30.0 0.0.0.255
network 192.168.40.0 0.0.0.255
network 192.168.60.0 0.0.0.255
network 192.168.80.0 0.0.0.255
新加交换机,代替外网
interface Vlanif 1
ip address 100.0.0.10 8
路由器设置:EasyIP
路由器AR1、AR2 acl+nat
acl 2000
rule permit source any
interface GigabitEthernet 0/0/2 进入外网接口
nat outbound 2000
对路由器设置,配置默认路由
ip route-static 0.0.0.0 0 100.0.0.10
(或者宣告路由,在ospf中宣告
default-route-advertise )
或者在两台三层上设置下一跳地址
ip route-static 0.0.0.0 0 192.168.50.1
三层vrid 设置出错删除
in vl10
undo vrrp vrid 1
in vl20
undo vrrp vrid 2
in vl30
undo vrrp vrid 3
in vl40
undo vrrp vrid 4