配置
Ip规划
192.168.0.0/24
192.168,1,0/24 ---骨干链路
192.168.1.0/30
192.168.1.4/30
192.168.1.8/30
192.168.1.12/30
192.168.1.16/30
192.168.1.20/30
192.168.1.24/30
192.168.1.32/27 ----r1
192.168.1.32/29
192.168.1.40/29
192.168.1.48/29
192.168.1.64/27 ---- r4
192.168.1.64/28
192.168.1.80/28
192.168.1.96/27
Sw1
[sw1]vlan batch 2 to 3
[sw1]int e0/0/2
[sw1-Ethernet0/0/2]p
[sw1-Ethernet0/0/2]port l a
[sw1-Ethernet0/0/2]p d v 2
[sw1]int e0/0/3
[sw1-Ethernet0/0/3]p l a
[sw1-Ethernet0/0/3]
Jul 17 2023 17:30:26-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 8, the c
hange loop count is 0, and the maximum number of records is 4095.p d v 3
[sw1-Ethernet0/0/3]q
[sw1]int e0/0/4
[sw1-Ethernet0/0/4]p l t
[sw1-Ethernet0/0/4]port trunk allow-pass vlan all
[sw1-Ethernet0/0/4]int e0/0/1
[sw1-Ethernet0/0/1]port link-type trunk
[sw1-Ethernet0/0/1]port trunk allow-pass vlan all
[sw1-Ethernet0/0/4]p t a v a
.
Sw2
[sw2]vlan batch 2 to 3
[sw2-Ethernet0/0/1]p l t
[sw2-Ethernet0/0/1]p t a v a
[sw2-Ethernet0/0/1]int e0/0/2
[sw2-Ethernet0/0/2]p l a
[sw2-Ethernet0/0/2]p d v 2
[sw2-Ethernet0/0/2]q
[sw2]int e0/0/3
[sw2-Ethernet0/0/3]port link-type access
[sw2-Ethernet0/0/3]p d v 3
[sw2-Ethernet0/0/3]q
R4
dhcp enable
#
ip pool 1
gateway-list 192.168.1.65
network 192.168.1.64 mask 255.255.255.240
#
ip pool 2
gateway-list 192.168.1.81
network 192.168.1.80 mask 255.255.255.240
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 192.168.1.22 255.255.255.252
#
interface GigabitEthernet0/0/1
ip address 192.168.1.17 255.255.255.252
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/2.1
dot1q termination vid 2
ip address 192.168.1.65 255.255.255.240
arp broadcast enable
dhcp select global
#
interface GigabitEthernet0/0/2.2
dot1q termination vid 3
ip address 192.168.1.81 255.255.255.240
arp broadcast enable
dhcp select global
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 192.168.1.18
ip route-static 192.168.1.0 255.255.255.252 192.168.1.21
ip route-static 192.168.1.4 255.255.255.252 192.168.1.18
ip route-static 192.168.1.8 255.255.255.252 192.168.1.18 preference 61
ip route-static 192.168.1.12 255.255.255.252 192.168.1.18
ip route-static 192.168.1.32 255.255.255.224 192.168.1.21
ip route-static 192.168.1.64 255.255.255.224 NULL0
R5
acl number 2000
rule 5 permit source 192.168.1.0 0.0.0.255
interface GigabitEthernet0/0/0
ip address 192.168.1.14 255.255.255.252
#
interface GigabitEthernet0/0/1
ip address 192.168.1.10 255.255.255.252
#
interface GigabitEthernet0/0/2
ip address 100.1.1.1 255.255.255.0
nat outbound 2000
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 100.1.1.2
ip route-static 192.168.1.0 255.255.255.0 192.168.1.9 preference 61
ip route-static 192.168.1.0 255.255.255.0 192.168.1.13
Isp
interface GigabitEthernet0/0/0
ip address 100.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.0
R2
interface GigabitEthernet0/0/0
ip address 192.168.1.2 255.255.255.252
#
interface GigabitEthernet0/0/1
ip address 192.168.1.5 255.255.255.252
#
interface GigabitEthernet0/0/2
nat outbound 2000
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 192.168.1.6
ip route-static 192.168.1.8 255.255.255.252 192.168.1.6 preference 61
ip route-static 192.168.1.12 255.255.255.252 192.168.1.6
ip route-static 192.168.1.16 255.255.255.252 192.168.1.6
ip route-static 192.168.1.20 255.255.255.252 192.168.1.1
ip route-static 192.168.1.32 255.255.255.224 192.168.1.1
ip route-static 192.168.1.64 255.255.255.224 192.168.1.1
ip route-static 192.168.1.64 255.255.255.224 192.168.1.6
#
R1
interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.252
#
interface GigabitEthernet0/0/1
ip address 192.168.1.21 255.255.255.252
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 192.168.1.33 255.255.255.248
#
interface LoopBack1
ip address 192.168.1.41 255.255.255.248
#
interface LoopBack2
ip address 192.168.1.49 255.255.255.248
#
ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
ip route-static 0.0.0.0 0.0.0.0 192.168.1.22
ip route-static 192.168.1.4 255.255.255.252 192.168.1.2
ip route-static 192.168.1.8 255.255.255.252 192.168.1.2 preference 61
ip route-static 192.168.1.8 255.255.255.252 192.168.1.22 preference 61
ip route-static 192.168.1.12 255.255.255.252 192.168.1.22
ip route-static 192.168.1.12 255.255.255.252 192.168.1.2
ip route-static 192.168.1.16 255.255.255.252 192.168.1.22
ip route-static 192.168.1.32 255.255.255.224 NULL0
ip route-static 192.168.1.64 255.255.255.224 192.168.1.22
R3
interface Ethernet4/0/0
ip address 192.168.1.9 255.255.255.252
#
interface Ethernet4/0/1
#
interface GigabitEthernet0/0/0
ip address 192.168.1.6 255.255.255.252
#
interface GigabitEthernet0/0/1
ip address 192.168.1.18 255.255.255.252
#
interface GigabitEthernet0/0/2
ip address 192.168.1.13 255.255.255.252
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 192.168.1.10 preference 61
ip route-static 0.0.0.0 0.0.0.0 192.168.1.14
ip route-static 192.168.1.0 255.255.255.252 192.168.1.5
ip route-static 192.168.1.20 255.255.255.252 192.168.1.17
ip route-static 192.168.1.32 255.255.255.224 192.168.1.5
ip route-static 192.168.1.32 255.255.255.224 192.168.1.17
ip route-static 192.168.1.64 255.255.255.224 192.168.1.17入代码片
测试