Bootstrap

第二次作业

目标:

1.全网可达 

2.所有pc的IP地址通过DHCP获取 

3.r5可以通过telnet登录到r1上

第一题

思路:先给每个路由器端口配ip地址,接着观察与此路由直连的网段和非直连的网段,给每个路由器的路由表添加信息,最后各设备能互相ping通则成功。

 1.配ip        

<r1>system-view 

[r1]interface GigabitEthernet 0/0/0

[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24

2.添加路由表信息     

  <r1>system-view  

  [r1]ip route-static 192.168.4.0 24 192.168.2.2
  [r1]ip route-static 192.168.5.0 24 192.168.3.2
  [r1]ip route-static 192.168.6.0 24 192.168.3.2
  [r1]ip route-static 192.168.6.0 24 192.168.2.2

由于到达同一目标网段存在多条开销相似路径,所有同时写在静态路由中,形成负载均衡。

最后各设备互相ping能成功

        

PC>ping 192.168.6.10

Ping 192.168.6.10: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.6.10: bytes=32 seq=2 ttl=125 time=63 ms
From 192.168.6.10: bytes=32 seq=3 ttl=125 time=46 ms
From 192.168.6.10: bytes=32 seq=4 ttl=125 time=79 ms
From 192.168.6.10: bytes=32 seq=5 ttl=125 time=62 ms

--- 192.168.6.10 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/62/79 ms

第二题

 思路:给r6和r4开启DHCP服务,接着进行配置,最后两台pc都可以通过dhcp服务获取ip地址

[r6]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r6]ip pool aa
Info: It's successful to create an IP address pool.
[r6-ip-pool-aa]network 192.168.1.0 mask 24
[r6-ip-pool-aa]gateway-list 192.168.1.1
[r6-ip-pool-aa]dns-list 144.144.144.144
[r6]int g 0/0/0
[r6-GigabitEthernet0/0/0]dhcp select global
PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:fef1:7a80
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-F1-7A-80
DNS server........................: 144.144.144.144

第三题

思路:给r1先配置aaa,再创建一个用户并定义用户类型,接着配置虚拟登录端口,最后在r6端登录r1.

1.配置aaa,创建和定义用户类型

[r6]aaa
[r6-aaa]local-user huazhu privilege level 15 password cipher 123456
Info: Add a new user.
[r6-aaa]local-user huazhu service-type telnet

2.配置寻登录端口

[r6]user-interface vty 0 4
[r6-ui-vty0-4]authentication-mode aaa

3.在r6的客户端登录r1,注意要回到客户端才行

<r6>telnet 192.168.1.1
  Press CTRL_] to quit telnet mode
  Trying 192.168.1.1 ...
  Connected to 192.168.1.1 ...

Login authentication


Username:huazhu
Password:
<r1>

最后成功登录

;