首先给路由器配IP地址
R1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
[r1-GigabitEthernet0/0/1]int lo0
[r1-LoopBack0]ip add 192.168.1.33 28
[r1-LoopBack0]int lo1
[r1-LoopBack1]ip add 192.168.1.49 28
R2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
[r2-GigabitEthernet0/0/1]int lo0
[r2-LoopBack0]ip add 192.168.1.65 28
[r2-LoopBack0]int lo1
[r2-LoopBack1]ip add 192.168.1.81 28
R3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
[r3-GigabitEthernet0/0/1]int g0/0/2
[r3-GigabitEthernet0/0/2]ip add 192.168.3.1 24
[r3-GigabitEthernet0/0/2]int lo0
[r3-LoopBack0]ip add 192.168.1.97 27
R4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.10 30.
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.1.14 30
[r4-GigabitEthernet0/0/1]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 192.168.1.17 30
[r4-GigabitEthernet0/0/2]int g4/0/0
[r4-GigabitEthernet4/0/0]ip add 192.168.1.21 30
[r4-GigabitEthernet4/0/0]int lo0
[r4-LoopBack0]ip add 192.168.1.129 28
[r4-LoopBack0]int lo1
[r4-LoopBack1]ip add 192.168.1.145 28
R5
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.1.18 30
[r5-GigabitEthernet0/0/0]int g0/0/2
[r5-GigabitEthernet0/0/2]ip add 192.168.1.22 30
[r5-GigabitEthernet0/0/2]int g0/0/1
[r5-GigabitEthernet0/0/1]ip add 12.0.0.5 24
[r5-GigabitEthernet0/0/1]int lo0
[r5-LoopBack0]ip add 192.168.1.161 27
R6
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 12.0.0.6 24
[r6-GigabitEthernet0/0/0]int lo0
[r6-LoopBack0]ip add 1.0.0.6 24
在R3上启动dhcp让pc段自动获取IP地址
[r3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r3]ip pool 1
Info: It's successful to create an IP address pool.
[r3-ip-pool-1]network 192.168.3.1 mask 24
[r3-ip-pool-1]gateway-list 192.168.3.1
[r3-ip-pool-1]dns-list 114.114.114.114 8.8.8.8
[r3-ip-pool-1]q
[r3]int g0/0/2
[r3-GigabitEthernet0/0/2]dhcp select global
配置内网全网可达
R1
[r1]ip route-static 0.0.0.0 0 192.168.1.2
[r1]ip route-static 0.0.0.0 0 192.168.1.6
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.12 30 192.168.1.6
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.96 27 192.168.1.6
R2
[r2]ip route-static 0.0.0.0 0 192.168.1.10
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[r2]ip route-static 192.168.1.12 30 192.168.1.10
[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]ip route-static 192.168.1.128 27 192.168.1.10
[r2]ip route-static 192.168.1.96 27 192.168.1.10
[r2]ip route-static 192.168.1.96 27 192.168.1.1
R3
[r3]ip route-static 0.0.0.0 0 192.168.1.14
[r3]ip route-static 192.168.1.0 30 192.168.1.5
[r3]ip route-static 192.168.1.8 30 192.168.1.14
[r3]ip route-static 192.168.1.32 27 192.168.1.5
[r3]ip route-static 192.168.1.128 27 192.168.1.14
[r3]ip route-static 192.168.1.64 27 192.168.1.14
[r3]ip route-static 192.168.1.64 27 192.168.1.5
R4
[r4]ip route-static 0.0.0.0 0 192.168.1.18
[r4]ip route-static 0.0.0.0 0 192.168.1.22
[r4]ip route-static 192.168.1.0 30 192.168.1.9
[r4]ip route-static 192.168.1.32 27 192.168.1.9
[r4]ip route-static 192.168.1.4 30 192.168.1.13
[r4]ip route-static 192.168.1.32 27 192.168.1.13
[r4]ip route-static 192.168.1.64 27 192.168.1.9
[r4]ip route-static 192.168.1.96 27 192.168.1.13
R5
[r5]ip route-static 192.168.1.8 30 192.168.1.17
[r5]ip route-static 192.168.1.8 30 192.168.1.21
[r5]ip route-static 192.168.1.12 30 192.168.1.21
[r5]ip route-static 192.168.1.12 30 192.168.1.17
[r5]ip route-static 192.168.1.128 27 192.168.1.17
[r5]ip route-static 192.168.1.128 27 192.168.1.21
[r5]ip route-static 192.168.1.0 30 192.168.1.17
[r5]ip route-static 192.168.1.0 30 192.168.1.21
[r5]ip route-static 192.168.1.4 30 192.168.1.21
[r5]ip route-static 192.168.1.4 30 192.168.1.17
[r5]ip route-static 192.168.1.64 27 192.168.1.17
[r5]ip route-static 192.168.1.64 27 192.168.1.21
[r5]ip route-static 192.168.1.96 27 192.168.1.21
[r5]ip route-static 192.168.1.96 27 192.168.1.17
[r5]ip route-static 192.168.1.32 27 192.168.1.17
[r5]ip route-static 192.168.1.32 27 192.168.1.21
为了防止成环给汇总了的环回路由配置空接口
[r1]ip route-static 192.168.1.32 27 NULL 0
[r2]ip route-static 192.168.1.64 27 NULL 0
[r4]ip route-static 192.168.1.128 27 NULL 0
私网在R5上做nat使公网私网互通
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[r5-acl-basic-2000]q
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]nat outbound 2000
R6在R1上远程登入
[r1]aaa
[r1-aaa]local-user 1111 privilege level 15 password cipher 123456
[r1-aaa]local-user 1111 service-type telnet
创建名为1111的账号,权限最大,密码123456;该账号仅用于telnet 远程登录
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa 在vty线上开启认证