静态路由配置实验

本文详细描述了网络设备的IP地址配置,包括R1至R6路由器的接口IP、环回地址,以及静态路由的设置以实现全网互通。还涉及DHCP服务、IP池管理和服务器配置,强调了避免路由黑洞、缺省路由环路的重要性。
摘要由CSDN通过智能技术生成

1、R6为ISP,接口IP地址均为公有地址,该设备只能配置IP地址,之后不能再对其进行任何配置;
2、R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配;
3、R1、R2、R4,各有两个环回IP地址;R5,R6各有一个环回地址;所有路由器上环回均代表连接用户的接口;
4、R3下面的两台PC通过DHCP自动获取IP地址;
5、选路最佳,路由表尽量小,避免环路;
6、R1-R5均可以访问R6的环回;
7、R6 telnet R5的公有地址时,实际登录到R1上;
8、R4与R5正常通过1000M链路,故障时通过100m链路;

第一步

划分网段配置IP地址

R1:0/0/0:ip add 192.168.1.1 30
        0/0/1:ip add 192.168.1.5 30                                                                                                                L1:ip add 192.168.1.49 28
        L0:ip add 192.168.1.33 28

R2:   0/0/0:ip add 192.168.1.2 30
        0/0/1:ip add 192.168.1.9 30                                                                                                                L0:ip add 192.168.1.65 28
        L1:ip add 192.168.1.81 28

R3:   0/0/0:ip add 192.168.1.6 30
        0/0/1:ip add 192.168.1.13 30                                                                                                              0/0/2:ip add 192.168.1.97 27                                                                                                             

R4:   0/0/0:ip add 192.168.1.10 30
         0/0/1:ip add 192.168.1.14 30                                                                                                             0/0/2:ip add 192.168.1.17 30                                                                                                             4/0/0: ip add 192.168.1.21 30                                                                                                             L0: ip add 192.168.1.129 28                                                                                                               L1:ip  add 192.168.1.145 28

R5: 0/0/0:ip add 192.168.1.18 30                                                                                                            0/0/2:ip add 192.168.1.22 30   
      0/0/1:ip add 12.0.0.5 24    

      L0: ip add 192.168.1.161 27

R6:0/0/0:ip add 12.0.0.6 24

L0:ip add 1.1.1.6 24

第二步

配置静态路由实现全网通

以R1为列                                                                   
ip route-static192.168.1.64 27 192.168.1.2 
ip route-static 192.168.1.8 30 192.168.1.2 
ip route-static 192.168.1.128 27 192.168.1.2 
ip route-static 192.168.1.128 27 192.168.1.6 
ip route-static 192.168.1.16 30 192.168.1.2 
ip route-static 192.168.1.16 30 192.168.1.6
ip route-static 192.168.1.160 27 192.168.1.2 
ip route-static 192.168.1.160 27 192.168.1.6 
ip route-static 192.168.1.20 30 192.168.1.2 
ip route-static 192.168.1.20 30192.168.1.6 
ip route-static 192.168.1.12 30192.168.1.6 
ip route-static 192.168.1.96 27192.168.1.6

R2:
    ip route-static 192.168.1.128 27 192.168.1.10
    ip route-static 192.168.1.16 30 192.168.1.10
    ip route-static 192.168.1.20 30 192.168.1.10
    ip route-static 192.168.1.160 27 192.168.1.10
    ip route-static 192.168.1.12 30 192.168.1.10
    ip route-static 192.168.1.96 27 192.168.1.10
    ip route-static 192.168.1.96 27 192.168.1.1
    ip route-static 192.168.1.4 30 192.168.1.1
    ip route-static 192.168.1.32 27 192.168.1.1

R3

ip route-static 192.168.1.32 27 192.168.1.5

ip route-static 192.168.1.0 30 192.168.1.5
ip route-static 192.168.1.64 27 192.168.1.5

ip route-static 192.168.1.64 27 192.168.1.14

ip route-static 192.168.1.8 30 192.168.1.14
ip route-static 192.168.1.128 27 192.168.1.14
ip route-static 192.168.1.16 30 192.168.1.14

ip route-static 192.168.1.160 27 192.168.1.14

ip route-static 192.168.1.20 30 192.168.1.14

R4:
    ip route-static 192.168.1.160 27 192.168.1.18
    ip route-static 192.168.1.160 27 192.168.1.22
    ip route-static 192.168.1.64 27 192.168.1.9
    ip route-static 192.168.1.0 30 192.168.1.9
    ip route-static 192.168.1.32 27 192.168.1.9
    ip route-static 192.168.1.32 27 192.168.1.13
    ip route-static 192.168.1.4 30 192.168.1.13
    ip route-static 192.168.1.96 27 192.168.1.13    
    
R5:
   ip route-static 192.168.1.128 27 192.168.1.17
   ip route-static 192.168.1.128 27 192.168.1.21
   ip route-static 192.168.1.8 30 192.168.1.17
   ip route-static 192.168.1.8 30 192.168.1.21
   ip route-static 192.168.1.64 27 192.168.1.21
   ip route-static 192.168.1.64 27 192.168.1.17
   ip route-static 192.168.1.64  192.168.1.17
   ip route-static 192.168.1.0 30 192.168.1.17
   ip route-static 192.168.1.0 30 192.168.1.21
   ip route-static 192.168.1.32 27 192.168.1.21
   ip route-static 192.168.1.32 27 192.168.1.17
   ip route-static 192.168.1.4 30 192.168.1.17
   ip route-static 192.168.1.4 30 192.168.1.21
   ip route-static 192.168.1.96 27 192.168.1.21
   ip route-static 192.168.1.96 27 192.168.1.17
   ip route-static 192.168.1.12 30 192.168.1.17
   ip route-static 192.168.1.12 30 192.168.1.21

    

注意:

1,静态路由写法

[Huawei]ip route-static 192.168.3.0 24 192.168.2.2——静态路由

route(路由器)static(静态)——静态路由

192.168.3.0 24——目的地网段

192.168.2.2——下一跳

2,手工汇总

[r2]ip route-static 192.168.1.0 24 12.0.0.1
[r2]ip route-static 192.168.2.0 24 12.0.0.1——两段同时包含在192.168.0.0/22网段都可通过                                                                                     12.0.0.1接口

[r2]ip route-static 192.168.0.0 22 12.0.0.1

3,路由黑洞

在汇总中,如果包含网络内实际不存在的网段时,可能造成流量的有去无回,浪费链路资源

4,缺省路由

一旦路由黑洞和缺省路由相遇,将100%出现路由环路。

缺省路由就是一条不限定目标的路由条目。缺省路由一定是路由表中所有路由条目都无法匹配时,才最后匹配。

[r1]ip route-static 0.0.0.0 0 12.0.0.2——0.0.0.0可以是任意值,0掩码可以是任意值,12.0.0.2是下一跳

5,空接口路由

用来解决缺省和黑洞相遇出环的问题。 --- 在黑洞路由器上配置一条指向汇总网段的空接口路由到路由表中。

[R1]ip route-static 192.168.1.160 27 NULL0

6,浮动静态路由
 

通过修改默认的优先级,实现静态路由的备份效果。

[r1]ip route-static 192.168.2.0 24 21.0.0.2 preference 61——手动修改静态路由的优先级

第三步

修改DHCP地址池 
[R3]dhcp en    
[R3]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[R3]ip pool aa
Info: It's successful to create an IP address pool.
[R3-ip-pool-aa]net    
[R3-ip-pool-aa]netbios-typenetw    
[R3-ip-pool-aa]netwo    
[R3-ip-pool-aa]network 192.168.1.96 mask 27
[R3-ip-pool-aa]ga    
[R3-ip-pool-aa]gateway-list 192.168.1.97
[R3-ip-pool-aa]dn    
[R3-ip-pool-aa]dns-list 114.114.114.114 8.8.8.8
                  

第四步

配置服务器

[R5]aaa
[R5-aaa]local-user admin privilege level 3 password cipher 123456
[R5-aaa]display this
[V200R003C00]
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$H'+):kp']:))&dX+X)`JyT2y%$%$
 local-user admin privilege level 3
 local-user admin service-type http
#
return
[R5-aaa]local-user admin service-type telnet 
[R5-aaa]q    
[R5]user-interface vty 0 4
[R5-ui-vty0-4]authentication-mode aaa

R6

<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:admin
Password:
<R5>

  • 9
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值