ENSP配置 实例十一 综合实验
交换机1
[SW1]vlan batch 10 20
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]port l a
[SW1-GigabitEthernet0/0/1]p d v 10
[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]port l a
[SW1-Ethernet0/0/2]p d v 20
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]p l t
[SW1-Ethernet0/0/3]p t a vlan 10 20
R1
[R1]int g0/0/0.1
[R1-GigabitEthernet0/0/0.1]dot1q termination vid 10
[R1-GigabitEthernet0/0/0.1]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0.1]arp broadcast enable
[R1-GigabitEthernet0/0/0.1]int g0/0/0.2
[R1-GigabitEthernet0/0/0.2]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.2]ip add 192.168.2.254 24
[R1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 10.0.12.1 24
[R1-GigabitEthernet0/0/2]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 10.0.13.1 24
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]a 0
[R1-ospf-1-area-0.0.0.0]
[R1-ospf-1-area-0.0.0.0]net 192.168.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]net 192.168.2.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]net 10.0.12.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]net 10.0.13.0 0.0.0.255
R3
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 10.0.13.3 24
[R3-GigabitEthernet0/0/1]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 10.0.23.3 24
[R3-GigabitEthernet0/0/1]q
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]net 10.0.13.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]net 10.0.23.0 0.0.0.255
R2
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.0.12.2 24
[R2-GigabitEthernet0/0/1]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.0.23.2 24
[R2-GigabitEthernet0/0/0]int g0/0/2
[R2-GigabitEthernet0/0/2]ip add 10.0.22.2 24
[R2-GigabitEthernet0/0/2]q
[R2]ospf 1 r
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 0
[R2-ospf-1-area-0.0.0.0]net 10.0.12.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]net 10.0.23.0 0.0.0.255
[R2]ip route-static 172.16.1.0 24 10.0.22.1
[R2-ospf-1]import-route static
[R2-ospf-1]q
[R2]ip route-static 0.0.0.0 0.0.0.0 10.0.12.
ACL
[R2]acl 2000
[R2-acl-basic-2000]rule deny source 192.168.2.0 0.0.0.255
[R2-acl-basic-2000]rule permit
[R2-acl-basic-2000]q
[R2]int g0/0/2
[R2-GigabitEthernet0/0/2]traffic-filter outbound acl 2000
交换机2
[SW2]vlan batch 30 40
[SW2]interface vlan 40
[SW2-Vlanif40]ip add 10.0.22.1 24
[SW2-Vlanif40]int vlan 30
[SW2-Vlanif30]ip add 172.16.1.254 24
[SW2-Vlanif30]q
[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1]p l t
[SW2-GigabitEthernet0/0/2]p d v 30
[SW2]ip route-static 0.0.0.0 0.0.0.0 10.0.22.2