实验 :小型三层架构实验

在这里插入图片描述
ISP

#                                         
interface GigabitEthernet0/0/0
 ip address 12.1.1.1 255.255.255.0 
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.0 

R1

#
acl number 2000  
 rule 5 permit source 192.168.0.0 0.0.255.255 
#                                         
interface GigabitEthernet0/0/0
 ip address 12.1.1.2 255.255.255.0 
 nat outbound 2000
#
interface GigabitEthernet0/0/1
 ip address 10.1.4.2 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 10.1.5.2 255.255.255.0 
#
ospf 1 router-id 0.0.0.1 
 default-route-advertise
 area 0.0.0.0 
  network 10.1.4.0 0.0.0.255 
  network 10.1.5.0 0.0.0.255 
#
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/0 12.1.1.1

SW1

#
sysname sw1
#
vlan batch 2 to 6
#
stp instance 1 root primary
stp instance 2 root secondary
#
dhcp enable
#
stp region-configuration
 region-name a
 instance 1 vlan 2
 instance 2 vlan 3
 active region-configuration                   
#
ip pool a
 gateway-list 192.168.2.254
 network 192.168.2.0 mask 255.255.255.0
#
ip pool b
 gateway-list 192.168.3.254
 network 192.168.3.0 mask 255.255.255.0
#
interface Vlanif2
 ip address 192.168.2.1 255.255.255.0     
 vrrp vrid 1 virtual-ip 192.168.2.254
 vrrp vrid 1 priority 110
 vrrp vrid 1 track interface GigabitEthernet0/0/1 reduced 15
 dhcp select global
#
interface Vlanif3
 ip address 192.168.3.1 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.3.254
 dhcp select global
#
interface Vlanif4
 ip address 10.1.4.1 255.255.255.0
#
interface Vlanif6
 ip address 10.1.6.1 255.255.255.0
#
interface Eth-Trunk0
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/1
 port link-type access                    
 port default vlan 4
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/22
 eth-trunk 0                              
#
interface GigabitEthernet0/0/23
 eth-trunk 0
#
ospf 1 router-id 1.1.1.1
 area 0.0.0.0
  network 10.1.4.0 0.0.0.255
  network 192.168.2.0 0.0.0.255
  network 192.168.3.0 0.0.0.255

SW2

#
sysname sw2
#
vlan batch 2 to 6
#
stp instance 1 root secondary
stp instance 2 root primary
#
dhcp enable
#
stp region-configuration
 region-name a
 instance 1 vlan 2
 instance 2 vlan 3
 active region-configuration               
#
ip pool a
 gateway-list 192.168.2.254
 network 192.168.2.0 mask 255.255.255.0
#
ip pool b
 gateway-list 192.168.3.254
 network 192.168.3.0 mask 255.255.255.0
#
interface Vlanif1
#
interface Vlanif2
 ip address 192.168.2.2 255.255.255.0
 vrrp vrid 1 virtual-ip 192.168.2.254
 dhcp select global                       
#
interface Vlanif3
 ip address 192.168.3.2 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.3.254
 vrrp vrid 2 priority 110
 vrrp vrid 2 track interface GigabitEthernet0/0/2 reduced 15
 dhcp select global
#
interface Vlanif5
 ip address 10.1.5.1 255.255.255.0
#
interface MEth0/0/1
#
interface Eth-Trunk0
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 5
#
interface GigabitEthernet0/0/3            
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/22
 eth-trunk 0
#
interface GigabitEthernet0/0/24
 eth-trunk 0                              
#
ospf 1 router-id 2.2.2.2
 area 0.0.0.0
  network 192.168.2.0 0.0.0.255
  network 192.168.3.0 0.0.0.255
  network 10.1.5.0 0.0.0.255

SW3

#
sysname sw3
#
vlan batch 2 to 5
#
stp region-configuration
 region-name a
 instance 1 vlan 2
 instance 2 vlan 3
 active region-configuration
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/23
 port link-type access
 port default vlan 2
#
interface GigabitEthernet0/0/24
 port link-type access
 port default vlan 3

SW4

#
sysname sw4
#
vlan batch 2 to 5
#
stp region-configuration
 region-name a
 instance 1 vlan 2
 instance 2 vlan 3
 active region-configuration
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/23
 port link-type access
 port default vlan 3
#
interface GigabitEthernet0/0/24
 port link-type access
 port default vlan 2

猜你喜欢

转载自blog.csdn.net/m0_55778885/article/details/121323637