vlan batch 1020100172
int g0/0/2
p l t
p t a v1020172
int g0/0/3
p l t
p t a v1020172
int g0/0/4
p l h #使用hybrid,可省略
port hybrid pvid vlan 172
port hybrid untagged vlan 1020100172
dis port vlan
stp mode stp #更改stp模式为stp
stp priority 0#更改为根桥的方式:更改优先级
dis stp bri #查看端口角色
int loop 0ipadd10.1.1.1 32
int vlanif 10ipadd192.168.10.254 24
int vlanif 20ipadd192.168.20.254 24
int vlanif 172ip add172.16.1.254 24
int vlanif 100ipadd192.168.2.2 24
int eth-thrunk 1
mode lacp-static
trunkport g 0/0/11 0/0/12
p l a
p d v100
dis eth-trunk
SW2
vlan batch 1020172
int g0/0/2
p l t
p t a v1020172
int g0/0/1
p l t
p t a v1020172
int g0/0/3
p l a
p d v10
dis port vlan
stp mode stp
dis stp bri
#### SW3
vlan batch 1020172
int g0/0/2
p l t
p t a v1020172
int g0/0/1
p l t
p t a v1020172
int g0/0/3
p l a
p d v20
dis port vlan
stp mode stp
dis stp bri
R1
int eth-trunk 1
undo portswitch
mode lacp-static
trunkport g 0/0/1 0/0/2
ipadd192.168.2.1 24
int loop 0ipadd1.1.1.1 32
dis eth-trunk
二、ospf
SW1
ospf router-id 10.1.1.1
area 1
net 10.1.1.1 0.0.0.0
net 192.168.2.0 0.0.0.255
net 192.168.10.0 0.0.0.255
net 192.168.20.0 0.0.0.255
net 172.16.1.0 0.0.0.255
authentication-mode md5 1 cipher thinkmo #不退出ospf进程的情况下敲这条,做ospf认证 ip route-static 0.0.0.0 0.0.0.0 192.168.2.1
R1
ospf router-id 1.1.1.1
area 1
net 1.1.1.1 0.0.0.0
net 192.168.2.0 0.0.0.255
authentication-mode md5 1 cipher thinkmo
dis ip routing-table
vlan 30
q
int g0/0/2
p l a
p d v30
q
dhcp enable
int vlanif 30ipadd192.168.30.254 24
dhcp select global
q
ip pool 30
gateway-list 192.168.30.254
network 192.168.30.0 mask 24
lease day 2
q
vlan 100
q
int vlanif 100ipadd192.168.4.2 24
int g0/0/1
p l a
p d v100
int loop 0ipadd10.4.4.4 32
ospf 1 router-id 4.4.4.4
a 2
net 192.168.30.0 0.0.0.255
net 10.4.4.4 0.0.0.0
net 192.168.4.0 0.0.0.255
authentication-mode md5 1 cipher thinkmo
ip route-static 0.0.0.0 0.0.0.0 192.168.4.1
R2
int g0/0/1
ipadd192.168.4.1 24
int loop 0ipadd2.2.2.2 32
ospf 1 router-id 2.2.2.2
a 2
net 192.168.4.0 0.0.0.255
net 2.2.2.2 0.0.0.0
authentication-mode md5 1 cipher thinkmo
ip route-static 0.0.0.0 0.0.0.0 101.1.2.3
acl 2000
rule per source192.168.30.0 0.0.0.255
int g0/0/0
ipadd101.1.2.2 24
nat outbound 2000