静态路由实验

R1ip配置

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
Mar 24 2024 11:29:54-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
Mar 24 2024 11:32:13-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[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-LoopBack1]

R2

[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
Mar 24 2024 11:34:49-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
Mar 24 2024 11:35:10-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r2-GigabitEthernet0/0/1]int l0
[r2-LoopBack0]ip add 192.168.1.65 28
[r2-LoopBack0]int l1
[r2-LoopBack1]ip add 192.168.1.81 28
[r2-LoopBack1]

R3

[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
Mar 24 2024 11:37:08-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
Mar 24 2024 11:37:30-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r3-GigabitEthernet0/0/1]int g0/0/2
[r3-GigabitEthernet0/0/2]ip add 192.168.1.97 27
Mar 24 2024 11:38:23-08:00 r3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[r3-GigabitEthernet0/0/2]

R4

[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.10 30
Mar 24 2024 11:39:32-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.1.14 30
Mar 24 2024 11:40:11-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r4-GigabitEthernet0/0/1]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 192.168.1.17 30
Mar 24 2024 11:40:39-08:00 r4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[r4-GigabitEthernet0/0/2]int g4/0/0
[r4-GigabitEthernet4/0/0]ip add 192.168.1.21 30
[r4-GigabitEthernet4/0/0]
Mar 24 2024 11:40:54-08:00 r4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet4/0/0 has entered the UP state. 
[r4-GigabitEthernet4/0/0]int l0
[r4-LoopBack0]ip add 192.168.1.129 28
[r4-LoopBack0]int l1
[r4-LoopBack1]ip add 192.168.1.145 28
[r4-LoopBack1]

R5

[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.1.18 30
Mar 24 2024 11:42:57-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r5-GigabitEthernet0/0/0]int g0/0/1
[r5-GigabitEthernet0/0/1]ip add 192.168.1.22 30
Mar 24 2024 11:43:12-08:00 r5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r5-GigabitEthernet0/0/1]int g0/0/2
[r5-GigabitEthernet0/0/2]ip add 12.0.0.5 24
Mar 24 2024 11:43:47-08:00 r5 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[r5-GigabitEthernet0/0/2]int l0
[r5-LoopBack0]ip add 192.168.1.161 27
[r5-LoopBack0]

R6

[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 12.0.0.6 24
Mar 24 2024 11:44:59-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r6-GigabitEthernet0/0/0]int l0
[r6-LoopBack0]ip add 1.1.1.6 24
[r6-LoopBack0]

静态

R1

[r1]ip rou    
[r1]ip route
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.128 27 192.168.1.2
[r1]ip route-static 192.168.1.128 27 192.168.1.6
[r1]ip route-static 192.168.1.16 30 192.168.1.6
[r1]ip route-static 192.168.1.16 30 192.168.1.2
[r1]ip route-static 192.168.1.160 27 192.168.1.2
[r1]ip route-static 192.168.1.160 27 192.168.1.6
[r1]ip route-static 192.168.1.20 30 192.168.1.6
[r1]ip route-static 192.168.1.20 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.96 27 192.168.1.6
[r1]

R2

[r2]ip rou    
[r2]ip route
[r2]ip route-static 192.168.1.128 27 192.168.1.10
[r2]ip route-static 192.168.1.16 30 192.168.1.10
[r2]ip route-static 192.168.1.160 27 192.168.1.10
[r2]ip route-static 192.168.1.12 30 192.168.1.10
[r2]ip route-static 192.168.1.20 30 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
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]

R3

[r3]ip rou    
[r3]ip route
[r3]ip route-static 192.168.1.32 27 192.168.1.5
[r3]ip route-static 192.168.1.0 30 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.14
[r3]ip route-static 192.168.1.8 30 192.168.1.14
[r3]ip route-static 192.168.1.128 27 192.168.1.14
[r3]ip route-static 192.168.1.16 30 192.168.1.14
[r3]ip route-static 192.168.1.160 27 192.168.1.14
[r3]ip route-static 192.168.1.20 30 192.168.1.14
[r3]

R4

[r4]ip rou    
[r4]ip route
[r4]ip route-static 192.168.1.160 27 192.168.1.18
[r4]ip route-static 192.168.1.160 27 192.168.1.22
[r4]ip route-static 192.168.1.96 27 192.168.1.13
[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.32 27 192.168.1.9
[r4]ip route-static 192.168.1.0 30 192.168.1.9
[r4]ip route-static 192.168.1.64 27 192.168.1.9
[r4]

R5

[r5]ip rou    
[r5]ip route
[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.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.96 27 192.168.1.17
[r5]ip route-static 192.168.1.96 27 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.32 27 192.168.1.17
[r5]ip route-static 192.168.1.32 27 192.168.1.21
[r5]ip route-static 192.168.1.0 30 192.168.1.21
[r5]ip route-static 192.168.1.0 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.8 30 192.168.1.21
[r5]ip route-static 192.168.1.8 30 192.168.1.17
[r5]

R3dhcp服务

[r3]dhcp en    
[r3]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[r3]ip pool bb
Info: It's successful to create an IP address pool.
[r3-ip-pool-bb]net    
[r3-ip-pool-bb]netbios-type
[r3-ip-pool-bb]network 192.168.1.96 ma    
[r3-ip-pool-bb]network 192.168.1.96 mask 27
[r3-ip-pool-bb]ga    
[r3-ip-pool-bb]gateway-list 192.168.1.97
[r3-ip-pool-bb]dn    
[r3-ip-pool-bb]dns-list 114.114.114.114 8.8.8.8
[r3-ip-pool-bb]q
[r3]int g0/0/2
[r3-GigabitEthernet0/0/2]dhcp se    
[r3-GigabitEthernet0/0/2]dhcp select g    
[r3-GigabitEthernet0/0/2]dhcp select global 
[r3-GigabitEthernet0/0/2]q
[r3]

测试通路

外网通

防环处理

[r1]ip rou    
[r1]ip route
[r1]ip route-static 192.168.1.32 27 n    
[r1]ip route-static 192.168.1.32 27 NULL 0
[r1]

[r2]ip rou    
[r2]ip route
[r2]ip route-static 192.168.1.64 27 n    
[r2]ip route-static 192.168.1.64 27 NULL 0
[r2]

[r4]ip rou    
[r4]ip route
[r4]ip route-static 192.168.1.128 27 n    
[r4]ip route-static 192.168.1.128 27 NULL 0
[r4]

nat配置

<r5>sys
Enter system view, return user view with Ctrl+Z.
[r5]acl 2000
[r5-acl-basic-2000]rule permit
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r5-acl-basic-2000]q
[r5]int g0/0/2
[r5-GigabitEthernet0/0/2]nat o    
[r5-GigabitEthernet0/0/2]nat outbound 2000
[r5-GigabitEthernet0/0/2]

R1-R4静态缺省路由配置

<r1>sys
Enter system view, return user view with Ctrl+Z.
[r1]ip rou    
[r1]ip route
[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]

<r2>sys
Enter system view, return user view with Ctrl+Z.
[r2]ip rou    
[r2]ip route
[r2]ip route-static 0.0.0.0 0 192.168.1.10
[r2]

<r3>sys
Enter system view, return user view with Ctrl+Z.
[r3]ip rou    
[r3]ip route
[r3]ip route-static 0.0.0.0 0 192.168.1.14
[r3]

<r4>sys
Enter system view, return user view with Ctrl+Z.
[r4]ip rou    
[r4]ip route
[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]

telnet配置

<r1>sys
Enter system view, return user view with Ctrl+Z.
[r1]aaa
[r1-aaa]loc    
[r1-aaa]local-user yuzhiwei pa    
[r1-aaa]local-user yuzhiwei password  ci    
[r1-aaa]local-user yuzhiwei password ci    
[r1-aaa]local-user yuzhiwei password cipher yuzhiwei pri    
[r1-aaa]local-user yuzhiwei password cipher yuzhiwei privilege l    
[r1-aaa]local-user yuzhiwei password cipher yuzhiwei privilege level 15
Info: Add a new user.
[r1-aaa]lo    
[r1-aaa]local-user yuzhiwei se    
[r1-aaa]local-user yuzhiwei service-type tel    
[r1-aaa]local-user yuzhiwei service-type telnet 
[r1-aaa]q
[r1]user    
[r1]user-bind
[r1]user-group
[r1]user-interface vty 0 4
[r1-ui-vty0-4]au       
[r1-ui-vty0-4]authentication-mode a    
[r1-ui-vty0-4]authentication-mode aaa 
[r1-ui-vty0-4]q
[r1]

端口映射

<r5>sys
Enter system view, return user view with Ctrl+Z.
[r5]int g 0/0/2
[r5-GigabitEthernet0/0/2]nat s    
[r5-GigabitEthernet0/0/2]nat server p    
[r5-GigabitEthernet0/0/2]nat server protocol  t    
[r5-GigabitEthernet0/0/2]nat server protocol  tcp g    
[r5-GigabitEthernet0/0/2]nat server protocol  tcp global cu    
[r5-GigabitEthernet0/0/2]nat server protocol  tcp global current-interface 23 in
[r5-GigabitEthernet0/0/2]nat server protocol  tcp global current-interface 23 inside 192.168.1.1 23
Warning:The port 23 is well-known port. If you continue it may cause function failure.
Are you sure to continue?[Y/N]:y
[r5-GigabitEthernet0/0/2]q
[r5]

浮动静态配置

[r4]ip rou    
[r4]ip route
[r4]ip route-static 0.0.0.0 0 192.168.1.22 pre    
[r4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
Info: Succeeded in modifying route.
Mar 24 2024 13:04:46-08:00 r4 %%01RM/4/IPV4_DEFT_RT_CHG(l)[0]:IPV4 default Route
 is changed. (ChangeType=Delete, InstanceId=0, Protocol=Static, ExitIf=GigabitEt
hernet4/0/0, Nexthop=192.168.1.22, Neighbour=0.0.0.0, Preference=1023410176, Lab
el=NULL, Metric=0) 
[r4]

[r5]ip rou    
[r5]ip route
[r5]ip route-static 192.168.1.0 30 192.168.1.21pre    
[r5]ip route-static 192.168.1.0 30 192.168.1.21 pre    
[r5]ip route-static 192.168.1.0 30 192.168.1.21 preference 61
Info: Succeeded in modifying route.
[r5]ip route-static 192.168.1.4 30 192.168.1.21 preference 61
Info: Succeeded in modifying route.
[r5]ip route-static 192.168.1.8 30 192.168.1.21 preference 61
Info: Succeeded in modifying route.
[r5]ip route-static 192.168.1.12 30 192.168.1.21 preference 61
Info: Succeeded in modifying route.
[r5]ip route-static 192.168.1.32 27 192.168.1.21 preference 61
Info: Succeeded in modifying route.
[r5]ip route-static 192.168.1.64 27 192.168.1.21 preference 61
Info: Succeeded in modifying route.
[r5]ip route-static 192.168.1.96 27 192.168.1.21 preference 61
Info: Succeeded in modifying route.
[r5]ip route-static 192.168.1.128 27 192.168.1.21 preference 61
Info: Succeeded in modifying route.
[r5]

  • 19
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值