IA复习实验

一、实验要求:

1、R6为isp ,接口 IP 地址均为公有地址;该设备只能配置Ip 地址,之后不能再对其进行其他任何配置;

2、R1-R5为局域网,私有 IP 地址192.168.1.0/24,请合理分配;

3、R1,R2,R4,各有两个环回地址;R5,R6各有一个环回地址;所有路由器上环回均代表连接用户的接口;

4、R3下的两台PC 通过 DHCP 自动获取 IP 地址;

5、选路最佳,路由表尽量小,避免环路;

6、R1-R5均可以访问R6的环回

7、R6telnetR5的公有 IP地址时,实际登陆到R1上;

8、R4与R5正常通过1000M琏路,故障时通过100M链路;

二,实验步骤:

1、确认广播域,划分IP地址

     骨干电路: 192.168.1.0 /27

             因为骨干电路需要六个广播域因此将骨干电路的IP划分为六个

              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  /30

     R1的环回:192.168.1.32   /27

               LoopBack0:192.168.1.32  /28

                    LoopBack1:192.168.1.48   /28

     R2的环回:192.168.1.64   /27

               LoopBack0:192.168.1.64  /28

                    LoopBack1:192.168.1.80  /28

     R3的设备:192.168.1.160  /27

     R4的环回:192.168.1.96    /27

                    LoopBack0 :192.168.1.96  /28

                    LoopBack1:192.168.1.112  /28

     R5的环回:192.168.1.128  /27

     R6:环回已知为1.1.1.0 /24

2、将划分好的IP地址配入相应的设备

   1)、给每个路由器的接口配置相应IP地址

  

<Huawei>system-view    ———— 进入系统视图

[Huawei]sysname r1     ———— 给路由器修改名称

[r1]interface GigabitEthernet 0/0/0 --- 进入接口视图

[r1-GigabitEthernet0/0/1]ip address 192.168.1.1 255.255.255.0  ———— 给路由器的0/0/1接口配置IP地址

每个路由器配置IP地址的步骤都相同。

2)、给R1-R4路由器建立两个环回。

[r1]interface LoopBack 0  ————进入系统视图输入命令

[r1-LoopBack0]            ————建立的虚拟环回

[r1-LoopBack0]ip address 192.168.1.33 28   ————配置环回一的IP地址

[r1-LoopBack1]ip ad 192.168.1.49 28        ————配置环回二的IP地址

[r1]display ip routing-table  ————用于查看路由表配置情况

其他路由表操作同上

3)、给R3建立DHCP服务器

(1)、启动DHCP服务器 (由路由器作为服务器)

[r3]dhcp enable

 

(2)、创建地址池

[r3]ip pool aa

Info: It's successful to create an IP address pool.

[r3-ip-pool-aa]

(3)、配置地址池

[r3-ip-pool-aa]network 192.168.1.160 mask 27

[r3-ip-pool-aa]gateway-list 192.168.1.161        

[r3-ip-pool-aa]dns-list 8.8.8.8

(4)、在接口选择全局配置

[r3-GigabitEthernet0/0/2]dhcp select global

 

可以用 ipconfig 命令符查看

 

4)、给R5和R6各配置一个环回,步骤通 2 )、

R5配置情况如下:

R6配置情况如下:

5)、实现全网可达。

(1)、在每个路由器手写静态路由步骤如下:

<r1>sys——进入系统视图

Enter system view, return user view with Ctrl+Z.

[r1]ip route-static 192.168.1.61 27 192.168.1.2——手写路由表

R2:

[r2]ip route-static 192.168.1.32 27 192.168.1.1

[r2]ip route-static 192.168.1.8 30 192.168.1.1

[r2]ip route-static 192.168.1.160 27 192.168.1.1

[r2]ip route-static 192.168.1.160 27 192.168.1.6

[r2]ip route-static 192.168.1.96 27 192.168.1.6

[r2]ip route-static 192.168.1.12 30 192.168.1.6        

[r2]ip route-static 192.168.1.16 30 192.168.1.6 preference 70

[r2]ip route-static 192.168.1.20 30 192.168.1.6

[r2]ip route-static 192.168.1.128 27 192.168.1.6

R3:

[r3]ip route-static 192.168.1.32 27 192.168.1.9

[r3]ip route-static 192.168.1.64 27 192.168.1.9

[r3]ip route-static 192.168.1.0 30 192.168.1.9

[r3]ip route-static 192.168.1.64 27 192.168.1.14

[r3]ip route-static 192.168.1.96 27 192.168.1.14

[r3]ip route-static 192.168.1.4 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.20 30 192.168.1.14        

[r3]ip route-static 192.168.1.16 30 192.168.1.14 preference 70

R4:

[r4]ip route-static 192.168.1.0 30 192.168.1.5

[r4]ip route-static 192.168.1.4 30 192.168.1.5

[r4]ip route-static 192.168.1.64 27 192.168.1.5

[r4]ip route-static 192.168.1.32 27 192.168.1.5

[r4]ip route-static 192.168.1.32 27 192.168.1.13

[r4]ip route-static 192.168.1.160 27 192.168.1.13

[r4]ip route-static 192.168.1.8 30 192.168.1.13

[r4]ip route-static 192.168.1.128 27 192.168.1.18 preference 70 ——负载均衡

[r4]ip route-static 192.168.1.128 27 192.168.1.22

R5:

[r5]ip route-static 192.168.1.0 24 192.168.1.17 pr        

[r5]ip route-static 192.168.1.0 24 192.168.1.17 preference 70

[r5]ip route-static 192.168.1.0 24 192.168.1.21

6)、缺省路由的配置

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.10

R2:

[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.14

R4:

[r4]ip route-static 0.0.0.0 0 192.168.1.22

r4]ip route-static 0.0.0.0 0 192.168.1.18 preference 70

7)、空接口的配置

R1:

[r1]ip route-static 192.168.1.32 27 NULL 0

R2:

[r2]ip route-static 192.168.1.64 27 n0

R3:

[r3]ip route-static 192.168.1.160  27 n0

R4:

[r4]ip route-static 192.168.1.96 27 n0

R5:

[r5]ip route-static 192.168.1.128 27 n0

8)、浮动静态路由

通过修改静态路由的优先级(默认60,取值范围0-255,小优)可以实现静态路由备份的作用

9)、私有转换公有

[r5]acl 2000

[r5-acl-basic-2000]ru        

[r5-acl-basic-2000]rule per         

[r5-acl-basic-2000]rule permit s        

[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255

[r5-acl-basic-2000]q

[r5]int g 0/0/1

[r5-GigabitEthernet0/0/1]nat ou        

[r5-GigabitEthernet0/0/1]nat outbound 2000

三、实验测试。

R1:

<r1>ping 1.1.1.1

  PING 1.1.1.1: 56  data bytes, press CTRL_C to break

    Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=252 time=40 ms

    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=252 time=40 ms

    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=252 time=40 ms

    Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=252 time=40 ms

    Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=252 time=40 ms

  --- 1.1.1.1 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 40/40/40 ms

R2:

<r2>ping 1.1.1.1

  PING 1.1.1.1: 56  data bytes, press CTRL_C to break

    Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=253 time=30 ms

    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=253 time=40 ms

    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=253 time=30 ms

    Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=253 time=30 ms

    Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=253 time=40 ms

  --- 1.1.1.1 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 30/34/40 ms

R3:

<r3>ping 1.1.1.1

  PING 1.1.1.1: 56  data bytes, press CTRL_C to break

    Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=253 time=30 ms

    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=253 time=20 ms

    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=253 time=30 ms

    Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=253 time=20 ms

    Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=253 time=30 ms

  --- 1.1.1.1 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 20/26/30 ms

R4:

<r4>ping 1.1.1.1

  PING 1.1.1.1: 56  data bytes, press CTRL_C to break

    Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=254 time=20 ms

    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=254 time=30 ms

    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=254 time=30 ms

    Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=254 time=20 ms

    Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=254 time=20 ms

  --- 1.1.1.1 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 20/24/30 ms

R5:

<r5>ping 1.1.1.1

  PING 1.1.1.1: 56  data bytes, press CTRL_C to break

    Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=255 time=30 ms

    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=255 time=20 ms

    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms

    Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms

    Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 1.1.1.1 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 20/22/30 ms

四)、R6telnetR5的公有 IP地址时,实际登陆到R1上;

[r1]aaa

[r1-aaa]lo        

[r1-aaa]local-user ad        

[r1-aaa]local-user admin pr        

[r1-aaa]local-user admin privilege le        

[r1-aaa]local-user admin privilege level 15 p        

[r1-aaa]local-user admin privilege level 15 password ci        

[r1-aaa]local-user admin privilege level 15 password cipher 123456

[r1-aaa]lo        

[r1-aaa]local-user ad        

[r1-aaa]local-user admin se        

[r1-aaa]local-user admin service-type t        

[r1-aaa]local-user admin service-type telnet

[r1-aaa]q

[r1]user-interface vt        

[r1]user-interface vty 0 4

[r1-ui-vty0-4]authentication-mode aaa

R5:

[r5]int g0/0/1

[r5-GigabitEthernet0/0/1]nat s        

[r5-GigabitEthernet0/0/1]nat server pr        

[r5-GigabitEthernet0/0/1]nat server protocol tcp        

[r5-GigabitEthernet0/0/1]nat server protocol tcp g        

[r5-GigabitEthernet0/0/1]nat server protocol tcp global c                

[r5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 in        

[r5-GigabitEthernet0/0/1]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:admin

Password:

  -----------------------------------------------------------------------------

   

  User last login information:    

  -----------------------------------------------------------------------------

  Access Type: Telnet     

  IP-Address : 192.168.1.2    

  Time       : 2022-01-05 20:17:05-08:00    

  -----------------------------------------------------------------------------

<r1>

<r1>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

空城唯有一人

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值