计算机网络的综合实验搭建

要求:

 

  1. R6为isp,接口rP地址均为公有地址﹔该设备只能配置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. R6 telnet R5 的公有IP地址时,实际登陆到R1上;
  8. R4与R5正常通过1000M链路,故障时通过100M链路;

 

分析:

  1. ip地址的划分 --- 192.168.1.0/24 的划分
  2. 配置路由下一跳和缺省路由
  3. 减少路由条目 -- 手工汇总 -- 空接口路由
  4. 浮动静态路由设置
  5. DHCP地址池分配和环回接口
  6. nat的ISP技术 --- 动态nat分配
  7. ACL策略的远程登录

IP地址划分:

网络中有6个直连线路,4个路由器需要设置环回路由,一个DHCP地址池

我将6个直连线路汇总为一个网段(/30 --- >/27)

此时需要1+4+1=6个网段 2^x -2 >= 6  ---- x =3

网段划分:

192.168.1.0/27 --- 直连路由
192.168.1.32/27 --- R1的环回
192.168.1.64/27 --- R2的环回
192.168.1.96/27 --- R4的环回
192.168.1.128/27 --- R5的环回
192.168.1.160/27 --- R3的DHCP地址池

//直连路由再次划分为/30的网段
192.168.1.0/30    R1和R2
192.168.1.4/30    R2和R4
192.168.1.8/30    R3和R4
192.168.1.12/30   R1和R3
192.168.1.16/30   R4和R5   --- 1000M
192.168.1.20/30   R4和R5   --- 100M
192.168.1.24/30
192.168.1.28/30        

//R1的环回
192.168.1.32/28 --- R1的环回1
192.168.1.48/28 --- R1的环回2

//R2的环回
192.168.1.64/28 --- R1的环回1
192.168.1.80/28 --- R1的环回2

//R4的环回
192.168.1.96/28 --- R1的环回1
192.168.1.112/28 --- R1的环回2

//R5的环回
192.168.1.128/27 --- R5的环回

//R6的环回已给定
1.0.0.0/24

①配置直连,环回,DHCP地址池:

//R1的接口
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[R1-GigabitEthernet0/0/0]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.13 30

//R2的接口
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[R2-GigabitEthernet0/0/0]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.5 30

//R3的接口
[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.14 30
[R3-GigabitEthernet0/0/0]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.9 30

//R4需要加入一个接口!!!
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[R4-GigabitEthernet0/0/0]interface g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.10 30
[R4-GigabitEthernet0/0/1]interface g0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[R4-GigabitEthernet0/0/2]interface e4/0/0
[R4-Ethernet4/0/0]ip address 192.168.1.21 30

//R5的接口
[R5]interface g0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[R5-GigabitEthernet0/0/0]interface g0/0/2
[R5-GigabitEthernet0/0/2]ip address 192.168.1.22 30
[R5-GigabitEthernet0/0/2]interface g0/0/1
[R5-GigabitEthernet0/0/1]ip address 12.0.0.1 24

//R6仅需要配置一个接口和环回
[R6]interface g0/0/0
[R6-GigabitEthernet0/0/0]ip address 12.0.0.2 24


//R1环回
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.33 28
[R1-LoopBack0]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.1.49 28

//R2环回
[R2]interface LoopBack 0
[R2-LoopBack0]ip ad	
[R2-LoopBack0]ip address 192.168.1.65 28
[R2-LoopBack0]interface LoopBack 1
[R2-LoopBack1]ip address 192.168.1.80 28
Error: The specified IP address is invalid.
[R2-LoopBack1]ip address 192.168.1.81 28

//R4环回
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 192.168.1.97 28
[R4-LoopBack0]interface LoopBack 1
[R4-LoopBack1]ip address 192.168.1.113 28

//R5环回
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 192.168.1.129 27

//R6的环回
[R6]interface LoopBack 0
[R6-LoopBack0]ip ad	
[R6-LoopBack0]ip address  1.0.0.1 24

//配置R3的dhcp池
[R3]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
    #配置pool池
[R3]ip pool lxb
Info: It's successful to create an IP address pool.
[R3-ip-pool-lxb]network 192.168.1.160 mask 27
[R3-ip-pool-lxb]gateway-list 192.168.1.161
[R3-ip-pool-lxb]dns-list 114.114.114.114
    #然后配置接口,选择dhcp模式,和端口ip
[R3]interface g0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.1.161 27
[R3-GigabitEthernet0/0/2]dhcp select global 

②配置静态路由:

//R1  --汇总+到达网段,环回
[R1]ip route-static 192.168.1.64 27 192.168.1.2
[R1]ip route-static 192.168.1.96 27 192.168.1.2
[R1]ip route-static 192.168.1.128 27 192.168.1.2
[R1]ip route-static 192.168.1.160 27 192.168.1.14
[R1]ip route-static 192.168.1.4 30 192.168.1.2
[R1]ip route-static 192.168.1.8 30 192.168.1.14
[R1]ip route-static 1.0.0.0 24 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.96 27 192.168.1.6
[R2]ip route-static 192.168.1.160 27 192.168.1.6
[R2]ip route-static 192.168.1.128 27 192.168.1.6
[R2]ip route-static 192.168.1.8 30 192.168.1.6
[R2]ip route-static 192.168.1.12 30 192.168.1.1
[R2]ip route-static 1.0.0.0 24 192.168.1.6

//R3
[R3]ip route-static 192.168.1.32 27 192.168.1.13
[R3]ip route-static 192.168.1.64 27 192.168.1.13
[R3]ip route-static 192.168.1.96 27 192.168.1.10
[R3]ip route-static 192.168.1.128 27 192.168.1.10
[R3]ip route-static 192.168.1.0 30 192.168.1.13
[R3]ip route-static 192.168.1.4 30 192.168.1.10
[R3]ip route-static 1.0.0.0 24 192.168.1.10

//R4  --- 需要设置和R5间的浮动路由
[R4]ip route-static 192.168.1.32 27 192.168.1.5
[R4]ip route-static 192.168.1.64 27 192.168.1.5
[R4]ip route-static 192.168.1.160 27 192.168.1.9
[R4]ip route-static 192.168.1.128 27 192.168.1.22
[R4]ip route-static 192.168.1.128 27 192.168.1.18
[R4]ip route-static 192.168.1.0 30 192.168.1.5
[R4]ip route-static 192.168.1.12 30 192.168.1.5
[R4]ip route-static 12.0.0.0 24 192.168.1.18
[R4]ip route-static 12.0.0.0 24 192.168.1.22 preference 80 
[R4]ip route-static 1.0.0.0 24 192.168.1.18
[R4]ip route-static 1.0.0.0 24 192.168.1.22 preference 80 

//R5  --- 设置优先级 --- R5到各个网段
[R5]ip route-static 192.168.1.4 30 192.168.1.17
[R5]ip route-static 192.168.1.8 30 192.168.1.17
[R5]ip route-static 192.168.1.0 30 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.21 preference 80
[R5]ip route-static 192.168.1.8 30 192.168.1.21 preference 80
[R5]ip route-static 192.168.1.4 30 192.168.1.21 preference 80
[R5]ip route-static 192.168.1.0 30 192.168.1.21 preference 80
[R5]ip route-static 1.0.0.0 30 12.0.0.2

//配置空接口
[R1]ip route-static 192.168.1.32 27 NULL 0
[R2]ip route-static 192.168.1.64 27 NULL 0
[R4]ip route-static 192.168.1.96 27 NULL 0
[R5]ip route-static 192.168.1.128 27 NULL 0

//配置缺省路由
[R1]ip route-static 0.0.0.0 0 192.168.1.2
[R2]ip route-static  0.0.0.0 0 192.168.1.6
[R3]ip route-static 0.0.0.0 0 192.168.1.10
[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 preference 80
[R5]ip route-static 0.0.0.0 0 12.0.0.2

③ 配置NAT指令:动态

[R5]nat address-group 1 1.0.0.5 1.0.0.10
[R5]acl 2000
[R5-acl-basic-2000]rule pe	
[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	
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]nat out	
[R5-GigabitEthernet0/0/1]nat outbound 2000 ad	
[R5-GigabitEthernet0/0/1]nat outbound 2000 address-group 1 no	
[R5-GigabitEthernet0/0/1]nat outbound 2000 address-group 1 no-pat 

 ④配置telent映射:  #用户为lxb ,密码为123456 ---telent端口号为23

[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]na	
[R5-GigabitEthernet0/0/1]nat s	
[R5-GigabitEthernet0/0/1]nat server p	
[R5-GigabitEthernet0/0/1]nat server protocol  t	
[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 ?
  <0-65535>  Global port of NAT
  CHARgen    Character generator (19)
  any        Any protocol (0)
  bgp        Border Gateway Protocol (179)
  cmd        Remote commands (rcmd, 514)
  daytime    Daytime (13)
  discard    Discard (9)
  domain     Domain Name Service (53)
  echo       Echo (7)
  exec       Exec (rsh, 512)
  finger     Finger (79)
  ftp        File Transfer Protocol (21)
  gopher     Gopher (70)
  hostname   NIC hostname server (101)
  irc        Internet Relay Chat (194)
  klogin     Kerberos login (543)
  kshell     Kerberos shell (544)
  login      Login (rlogin, 513)
  lpd        Printer service (515)
  nntp       Network News Transport Protocol (119)
  pop2       Post Office Protocol v2 (109)
  pop3       Post Office Protocol v3 (110)
  smtp       Simple Mail Transport Protocol (25)
  sunrpc     Sun Remote Procedure Call (111)
  tacacs     TAC Access Control System (49)
  talk       Talk (517)
  telnet     Telnet (23)
  time       Time (37)

[R5-GigabitEthernet0/0/1]nat server protocol  tcp global current-interface 23 in
s	
[R5-GigabitEthernet0/0/1]nat server protocol  tcp global current-interface 23 in
side 192.168.1.1 23
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y

⑤:验证! 

//查看dhcp的分配地址
PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:fec5:4671
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.190
Subnet mask.......................: 255.255.255.224
Gateway...........................: 192.168.1.161
Physical address..................: 54-89-98-C5-46-71
DNS server........................: 114.114.114.114


//在R5ping外网 ---R1同理
<R5>ping 1.0.0.1
  PING 1.0.0.1: 56  data bytes, press CTRL_C to break
    Reply from 1.0.0.1: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 1.0.0.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 1.0.0.1: bytes=56 Sequence=3 ttl=255 time=10 ms
    Reply from 1.0.0.1: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 1.0.0.1: bytes=56 Sequence=5 ttl=255 time=10 ms

  --- 1.0.0.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/20/30 ms


//在R6登录R5
<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:lxb
Password:
<R1>
  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值