vlan:
Rw1:[rw1]interface Eth-Trunk 0
[rw1-GigabitEthernet0/0/22]eth-trunk 0
[rw1-GigabitEthernet0/0/23]eth-trunk 0
Rw2:[rw2]interface Eth-Trunk 0
[rw2-GigabitEthernet0/0/22]eth-trunk 0
[rw2-GigabitEthernet0/0/23]eth-trunk 0
Rw1:[rw1]vlan 2
Rw2:[rw2]vlan 2
Rw1:[rw1]int Eth-Trunk 0
[rw1-Eth-Trunk0]port link-type trunk
[rw1-Eth-Trunk0]port trunk allow-pass vlan 2
[rw1]int g0/0/1
[rw1-GigabitEthernet0/0/1]port link-type trunk
[rw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[rw1]int g0/0/2
[rw1-GigabitEthernet0/0/2]port link-type trunk
[rw1-GigabitEthernet0/0/2]port trunk allow-pass vlan2
Rw2:[rw2]port-group group-member Eth-Trunk 0 GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2
[rw2-port-group]port link-type trunk
[rw2-Eth-Trunk0]port link-type trunk
[rw2-GigabitEthernet0/0/1]port link-type trunk
[rw2-GigabitEthernet0/0/2]port link-type trunk
[rw2-port-group]port trunk allow-pass vlan 2
[rw2-Eth-Trunk0]port trunk allow-pass vlan 2
[rw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[rw2-GigabitEthernet0/0/2]port trunk allow-pass vlan 2
Rw2:[rw3]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2
[rw3-port-group]port link-type trunk
[rw3-GigabitEthernet0/0/1]port link-type trunk
[rw3-GigabitEthernet0/0/2]port link-type trunk
[rw3-port-group]port trunk allow-pass vlan 2
[rw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[rw3-GigabitEthernet0/0/2]port trunk allow-pass vlan 2
Rw4:[rw4]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2
[rw4-port-group]port link-type trunk
[rw4-GigabitEthernet0/0/1]port link-type trunk
[rw4-GigabitEthernet0/0/2]port link-type trunk
[rw4-port-group]port trunk allow-pass vlan 2
[rw4-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[rw4-GigabitEthernet0/0/2]port trunk allow-pass vlan 2
Rw3:[rw3-GigabitEthernet0/0/4]port link-type access
[rw3-GigabitEthernet0/0/4]port default vlan 2
Rw4:[rw4-GigabitEthernet0/0/4]port link-type access
[rw4-GigabitEthernet0/0/4]port default vlan 2
stp配置:
Rw1:[rw1]stp enable
[rw1]stp region-configuration
[rw1-mst-region]region-name a
[rw1-mst-region]instance 1 vlan 1
[rw1-mst-region]instance 2 vlan 2
[rw1-mst-region]active region-configuration
[rw1]stp instance 1 root primary
[rw1]stp instance 2 root secondary
[rw2]stp enable
Rw2:[rw2]stp region-configuration
[rw2-mst-region] region-name a
[rw2-mst-region] instance 1 vlan 1
[rw2-mst-region] instance 2 vlan 2
[rw2-mst-region] active region-configuration
[rw2]stp instance 1 root secondary
[rw2]stp instance 2 root primary
Rw3:[rw3]stp enable
[rw3]stp region-configuration
[rw3-mst-region] region-name a
[rw3-mst-region] instance 1 vlan 1
[rw3-mst-region] instance 2 vlan 2
[rw3-mst-region] active region-configuration
[rw3]port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4
[rw3-port-group]stp edged-port enable
[rw3-GigabitEthernet0/0/3]stp edged-port enable
[rw3-GigabitEthernet0/0/4]stp edged-port enable
Rw4:[rw4]stp enable
[rw4]stp region-configuration
[rw4-mst-region] region-name a
[rw4-mst-region] instance 1 vlan 1
[rw4-mst-region] instance 2 vlan 2
[rw4-mst-region] active region-configuration
[rw4]port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4
[rw4-port-group]stp edged-port enable
[rw4-GigabitEthernet0/0/3]stp edged-port enable
[rw4-GigabitEthernet0/0/4]stp edged-port enable
[rw1]display stp brief
svi:
Rw1:[rw1]interface vlan 1
[rw1-Vlanif1]ip address 172.16.1.1 25
[rw1-Vlanif2]ip address 172.16.1.129 25
Rw2:[rw2]int vlan 1
[rw2-Vlanif1]ip address 172.16.1.2 25
[rw2-Vlanif2]ip address 172.16.1.130 25
vrrp:
Rw1:[rw1-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.126
[rw1-Vlanif1]vrrp vrid 1 priority 105
[rw1-Vlanif1]vrrp vrid 1 track interface GigabitEthernet 0/0/24 reduced 10
[rw1-Vlanif2]vrrp vrid 1 virtual-ip 172.16.1.254
Rw2:[rw2-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.126
[rw2-Vlanif2]vrrp vrid 1 virtual-ip 172.16.1.254
[rw2-Vlanif2]vrrp vrid 1 priority 105
[rw2-Vlanif2]vrrp vrid 1 track interface GigabitEthernet 0/0/24
DHCP:
Rw1:[rw1]dhcp enable
[rw1]ip pool a
[rw1-ip-pool-a] gateway-list 172.16.1.126
[rw1-ip-pool-a] network 172.16.1.0 mask 255.255.255.128
[rw1-ip-pool-a]ip pool b
[rw1-ip-pool-b] gateway-list 172.16.1.254
[rw1-ip-pool-b] network 172.16.1.128 mask 255.255.255.128
[rw1-Vlanif1]dhcp select global
[rw1-Vlanif2]dhcp select global
Rw2:[rw2]dhcp enable
[rw2]ip pool a
[rw2-ip-pool-a] gateway-list 172.16.1.126
[rw2-ip-pool-a] network 172.16.1.0 mask 255.255.255.128
[rw2-ip-pool-a]ip pool b
[rw2-ip-pool-b] gateway-list 172.16.1.254
[rw2-ip-pool-b] network 172.16.1.128 mask 255.255.255.128
[rw2-Vlanif1]dhcp select global
[rw2-Vlanif2]dhcp select global
路由:
R2:[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1-area-0.0.0.0]network 172.16.0.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 172.16.0.5 0.0.0.0
Rw1:[rw1]ospf 1 router-id 3.3.3.3
[rw1-ospf-1-area-0.0.0.0]network 172.16.0.2 0.0.0.0
[rw1-ospf-1-area-0.0.0.1]network 172.16.1.1 0.0.0.0
[rw1-ospf-1-area-0.0.0.1]network 172.16.1.129 0.0.0.0
Rw2:[rw2]ospf 1 router-id 4.4.4.4
[rw2-ospf-1-area-0.0.0.0]network 172.16.0.6 0.0.0.0
[rw2-ospf-1-area-0.0.0.1]network 172.16.1.2 0.0.0.0
[rw2-ospf-1-area-0.0.0.1]network 172.16.1.130 0.0.0.0
汇总:
Rw1:[rw1-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0
[rw2-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0
R2:[r2]ip route-static 0.0.0.0 0 12.1.1.1
[r2-ospf-1]default-route-advertise
Rw1:[rw1-ospf-1]silent-interface all
[rw1-ospf-1]undo silent-interface Vlanif 1
[rw1-ospf-1]undo silent-interface Eth-Trunk 0
[rw1-ospf-1]undo silent-interface Vlanif 99
Rw1:[rw2-ospf-1]silent-interface all
[rw2-ospf-1]undo silent-interface Vlanif 1
[rw2-ospf-1]undo silent-interface Eth-Trunk 0
[rw2-ospf-1]undo silent-interface Vlanif 99
nat:
R2:[r2]acl 2000
[r2-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r2-GigabitEthernet0/0/0]nat outbound 2000