静态综合实验
IP地址规划
192.168.1.0/24
192.168.1.0/27 骨干
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.28/30
192.168.1.32/27 R1环回
192.168.1.32/28
192.168.1.48/28
192.168.1.64/27 R2环回
192.168.1.64/28
192.168.1.80/28
192.168.1.96/27 R3
192.168.1.128/27 R4环回
192.168.1.128/28
192.168.144/28
192.168.1.169/27 R5环回
配置
配置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.26 30
[r1-GigabitEthernet0/0/1]int l0
[r1-LoopBack0]ip add 192.168.1.33 28
[r1-LoopBack0]int l1
[r1-LoopBack1]ip add 192.168.1.49 28
配置静态路由(以r1为例)
r1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
[r1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.25
[r1]ip route-static 192.168.1.96 30 192.168.1.25
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[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.25
DHCP服务
[r3]dhcp enable
Info: The operation may take a few seconds. Please wait for a
[r3]ip pool xh
[r3-ip-pool-xh]network 192.168.1.96 mask 27
[r3-ip-pool-xh]gateway-list 192.168.1.97
[r3-ip-pool-xh]int g0/0/2
[r3-GigabitEthernet0/0/2]dhcp select global
空接口避免路由黑洞的产生(r1为例)
[r1]ip route-static 192.168.1.32 27 NULL 0
nat 让AR1到AR3都可以访问lsp
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.0
[r5-acl-basic-2000]int g0/0/0
[r5-GigabitEthernet0/0/0]nat outbound 2000
r6telnetr5的公有IP地址的时候实际登录到r1上
在r1开启telnet服务
[r1]aaa
[r1-aaa]local-user xh privilege level 3 password cipher 12345
[r1-aaa]local-user admin service-type telnet
[r1-aaa]q
[r1]user-interface vty 0 3
[r1-ui-vty0-3]authentication-mode aaa
在r5进行对r1的端口映射
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]nat server protocol tcp global current-interface 23 inside 192.168.1.1 23
Are you sure to continue?[Y/N]:y
在r6测试
telnet 12.0.0.1
Press CTRL_] to quit telnet mode
Trying 12.0.0.1 …
Connected to 12.0.0.1 …
Login authentication
Username:xh
Password: