一,将192.168.1.0 24划分为4个网段
192.168.1.0 26 192.168.1.64 26
192.168.1.128 26 192.168.1.192 26
(1)取192.168.1.0 26继续划分,为主干道添加IP地址
192.168.1.0 30-------192.168.1.20 30
将其添加至各个接口
(2)取192.168.1.64 26 划分成三个网段作为R1环回
(3)取192.168.1.128 26 继续划分,作为交换机VLAN2与VLAN3的网段
二添加ip地址
R1:
[r1-GigabitEthernet0/0/1]ip add 192.168.1.1 30
[r1-GigabitEthernet0/0/0]ip add 192.168.1.21 30
[r1-LoopBack0]ip add 192.168.1.65 28
[r1-LoopBack1]ip add 192.168.1.81 28
[r1-LoopBack2]ip add 192.168.1.97 28
R2:
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[r2-GigabitEthernet0/0/1]ip add 192.168.1.5 30
R3:
[r3-GigabitEthernet0/0/0]ip add 192.168.1.22 30
[r3-GigabitEthernet0/0/1]ip add 192.168.1.17 30
R4:
[r4-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[r4-GigabitEthernet0/0/1]ip add 192.168.1.18 30
[r4-GigabitEthernet0/0/2]ip add 192.168.1.13 30
[r4-GigabitEthernet4/0/0]ip add 192.168.1.9 30
R5:
[r5-GigabitEthernet0/0/0]ip add 192.168.1.14 30
[r5-GigabitEthernet0/0/2]ip add 192.168.1.10 30
[r5-GigabitEthernet0/0/1]ip add 100.1.1.1 24
ISP:
[ISP-GigabitEthernet0/0/0]ip add 100.1.1.2 24
三,汇总R1环回并防环
r1]ip route-static 192.168.1.64 26 NULL 0
四,配置交换机
(1)划分VLAN
[sw1]vlan batch 2 3
[sw2]vlan batch 2 3
(2)交换机上的各个接口划分到对应的vlan中
sw1:
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 2
[sw1-Ethernet0/0/3]port link-type access
[sw1-Ethernet0/0/3]port default vlan 2sw2:
[sw2-Ethernet0/0/2]port link-type access
[sw2-Ethernet0/0/2]port default vlan 3[sw2-Ethernet0/0/3]port link-type access
[sw2-Ethernet0/0/3]port default vlan 3:
(3)trunk干道
sw1:
[sw1-Ethernet0/0/1]port link-type trunk
[sw1-Ethernet0/0/1]port trunk allow-pass vlan 2 to 3[sw1-Ethernet0/0/4port link-type trunk
[sw1-Ethernet0/0/4]port trunk allow-pass vlan 2 to 3sw2:
[sw2-Ethernet0/0/1]port link-type trunk
[sw2-Ethernet0/0/1]port trunk allow-pass vlan 2 to 3
(4)R3子接口
[r3-GigabitEthernet0/0/2.1]dot1q termination vid 2
[r3-GigabitEthernet0/0/2.1]ip add 192.168.1.129 27
[r3-GigabitEthernet0/0/2.1]arp broadcast enable
[r3-GigabitEthernet0/0/2.2]dot1q termination vid 3
[r3-GigabitEthernet0/0/2.2]ip add 192.168.1.161 27
[r3-GigabitEthernet0/0/2.2]arp broadcast enable
(5)在子接口启用DHCP服务
[r3]dhcp enable
[r3]ip pool v2
Info: It's successful to create an IP address pool.
[r3-ip-pool-v2]network 192.168.1.128 mask 27
[r3-ip-pool-v2]gateway-list 192.168.1.129
[r3-ip-pool-v2]dns-list 8.8.8.8
[r3]ip pool v3
[r3-ip-pool-v3]network 192.168.1.160 mask 27
[r3-ip-pool-v3]gateway-list 192.168.1.161
[r3-ip-pool-v3]dns-list 114.114.114.114
[r3-GigabitEthernet0/0/2.1]dhcp select global
[r3-GigabitEthernet0/0/2.2]dhcp select global
五,配置静态路由
R1
[r1]ip route-static 192.168.1.4 30 192.168.1.2
[r1]ip route-static 192.168.1.16 30 192.168.1.22
[r1]ip route-static 192.168.1.128 26 192.168.1.22
[r1]ip route-static 192.168.1.8 30 192.168.1.6
[r1]ip route-static 192.168.1.8 30 192.168.1.18
[r1]ip route-static 192.168.1.12 30 192.168.1.6
[r1]ip route-static 192.168.1.12 30 192.168.1.18
R2
[r2]ip route-static 192.168.1.20 30 192.168.1.1
[r2]ip route-static 192.168.1.16 30 192.168.1.6
[r2]ip route-static 192.168.1.128 26 192.168.1.22
[r2]ip route-static 192.168.1.128 26 192.168.1.17
[r2]ip route-static 192.168.1.64 26 192.168.1.1
[r2]ip route-static 192.168.1.8 30 192.168.1.6
[r2]ip route-static 192.168.1.12 30 192.168.1.6
R3
[r3]ip route-static 192.168.1.0 30 192.168.1.21
[r3]ip route-static 192.168.1.4 30 192.168.1.18
[r3]ip route-static 192.168.1.64 26 192.168.1.21
[r3]ip route-static 192.168.1.8 30 192.168.1.18
[r3]ip route-static 192.168.1.12 30 192.168.1.18
R4
[r4]ip route-static 192.168.1.0 30 192.168.1.5
[r4]ip route-static 192.168.1.20 30 192.168.1.17
[r4]ip route-static 192.168.1.64 26 192.168.1.1
[r4]ip route-static 192.168.1.64 26 192.168.1.21
[r4]ip route-static 192.168.1.128 26 192.168.1.17
R5
[r5]ip route-static 192.168.1.4 30 192.168.1.9
[r5]ip route-static 192.168.1.4 30 192.168.1.13
[r5]ip route-static 192.168.1.16 30 192.168.1.9
[r5]ip route-static 192.168.1.16 30 192.168.1.13
[r5]ip route-static 192.168.1.20 30 192.168.1.17
[r5]ip route-static 192.168.1.128 26 192.168.1.17
[r5]ip route-static 192.168.1.0 30 192.168.1.5
[r5]ip route-static 192.168.1.64 26 192.168.1.1
[r5]ip route-static 192.168.1.64 26 192.168.1.21
六配置缺省路由
R1
[r1]ip route-static 0.0.0.0 0 192.168.1.22
[r1]ip route-static 0.0.0.0 0 192.168.1.2R2
[r2]ip route-static 0.0.0.0 0 192.168.1.6
R3
[r3]ip route-static 0.0.0.0 0 192.168.1.18
R4
[r4]ip route-static 0.0.0.0 0 192.168.1.14 preference 100-----浮动静态路由
[r4]ip route-static 0.0.0.0 0 192.168.1.10
R5
[r5]ip route-static 0.0.0.0 0 100.1.1.2
七调用NAT
[r5]acl 2000
[r5-acl-basic-2000]rule 1 permit source any
[r5-GigabitEthernet0/0/1]nat outbound 2000
八,限制Vlan2网段访问ISP
[r4]acl 2000
[r4-acl-basic-2000]rule 1 deny source 192.168.1.128 0.0.0.31
[r4-GigabitEthernet0/0/2]traffic-filter outbound acl 2000
[r4-GigabitEthernet4/0/0]traffic-filter outbound acl 2000
九全网互通