静态路由综合实验

本文展示了多个路由器(R1, R2, R3, R4, R5)的IP地址分配、子网划分及静态路由配置,包括VLAN、DHCP服务器配置和SNMP设置。详细记录了每个路由器的接口状态、IP地址、子网掩码以及静态路由条目,揭示了网络连接和管理的实现细节。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

192.168.1.0/24   划分8个网段

192.168.1.000 00000/27   ---骨干

192.168.1.000 000 00/30   192.168.1.0/30

192.168.1.000 001 00/30   192.168.1.4/30

192.168.1.000 010 00/30   192.168.1.8/30

192.168.1.000 011 00/30   192.168.1.12/30

192.168.1.000 100 00/30   192.168.1.16/30

192.168.1.000 101 00/30   192.168.1.20/30

192.168.1.000 110 00/30

192.168.1.000 111 00/30

192.168.1.001 00000/27   ---R1

    192.168.1.001 0 0000/28   192.168.1.32/28

192.168.1.001 1 0000/28   192.168.1.48/28

192.168.1.001 00000/27   ---R2

192.168.1.001 0 0000/28   192.168.1.64/28

192.168.1.001 1 0000/28   192.168.1.80/28

    192.168.1.011 00000/27   ---R3  192.168.1.96/27

192.168.1.100 00000/27   ---R4

    192.168.1.100 0 0000/28   192.168.1.128/28

    192.168.1.100 1 0000/28   192.168.1.144/28

    192.168.1.101 00000/27   ---R5  192.168.1.160/27

   

192.168.1.110 00000/27   

192.168.1.111 00000/27

R1

[r1]int g 0/0/0

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

Mar 24 2022 14:16:45-08:00 r1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.

[r1-GigabitEthernet0/0/0]int g 0/0/1

[r1-GigabitEthernet0/0/1]ip address 192.168.1.5 30

Mar 24 2022 14:17:07-08:00 r1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.

[r1-GigabitEthernet0/0/1]q

[r1]int l0

[r1-LoopBack0]ip address 192.168.1.33 28

[r1-LoopBack0]int l1

[r1-LoopBack1]ip address 192.168.1.49 28

[r1-LoopBack1]q

[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]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 19.168.1.12 30 192.168.1.6

[r1]ip route-static 192.168.1.96 27 192.168.1.6

[r1]display this

[V200R003C00]

#

 sysname r1

#

 snmp-agent local-engineid 800007DB03000000000000

 snmp-agent

#

 clock timezone China-Standard-Time minus 08:00:00

#

portal local-server load portalpage.zip

#

 drop illegal-mac alarm

#

 set cpu-usage threshold 80 restore 75

#

ip route-static 0.0.0.0 0.0.0.0 192.168.1.2

ip route-static 0.0.0.0 0.0.0.0 192.168.1.6

ip route-static 19.168.1.12 255.255.255.252 192.168.1.6

ip route-static 192.168.1.8 255.255.255.252 192.168.1.2

ip route-static 192.168.1.64 255.255.255.224 192.168.1.2

ip route-static 192.168.1.96 255.255.255.224 192.168.1.6

#

return

[r1]ip route-static 192.168.1.32 27 NULL 0

[r1]aaa

[r1-aaa]local-user zyy

  access-limit   Set access limit of user(s)

  ftp-directory  Set user(s) FTP directory permitted

  idle-timeout   Set the timeout period for terminal user(s)

  password        Set password

  privilege       Set admin user(s) level

  service-type   Service types for authorized user(s)

  state            Activate/Block the user(s)

  user-group      User group

[r1-aaa]local-user zyy privilege level 15 password cipher 021117

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

[r1-aaa]q

[r1]user-interface vty 0 4

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

[r1-ui-vty0-4]q

R2

[r2]int g 0/0/0

[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30

Mar 24 2022 14:18:24-08:00 r2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.

[r2-GigabitEthernet0/0/0]int g 0/0/1

[r2-GigabitEthernet0/0/1]ip address 192.168.1.9 30

Mar 24 2022 14:18:49-08:00 r2 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.

[r2-GigabitEthernet0/0/1]int l0

[r2-LoopBack0]ip address 192.168.1.65 28

[r2-LoopBack0]int l1

[r2-LoopBack1]ip address 192.168.1.81 28

[r2-LoopBack1]q

[r2]ip route-static 0.0.0.0 0 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]display this

[V200R003C00]

#

 sysname r2

#

 snmp-agent local-engineid 800007DB03000000000000

 snmp-agent

#

 clock timezone China-Standard-Time minus 08:00:00

#

portal local-server load portalpage.zip

#

 drop illegal-mac alarm

#

 set cpu-usage threshold 80 restore 75

#

ip route-static 0.0.0.0 0.0.0.0 192.168.1.10

ip route-static 192.168.1.4 255.255.255.252 192.168.1.1

ip route-static 192.168.1.32 255.255.255.224 192.168.1.1

ip route-static 192.168.1.96 255.255.255.224 192.168.1.1

ip route-static 192.168.1.96 255.255.255.224 192.168.1.10

#

return

[r2] ip route-static 192.168.1.64 27 NULL 0

R3

[r3]int g 0/0/0

[r3-GigabitEthernet0/0/0]ip address 192.168.1.6 30

Mar 24 2022 14:20:10-08:00 r3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.

[r3-GigabitEthernet0/0/0]int g 0/0/1

[r3-GigabitEthernet0/0/1]ip address 192.168.1.13 30

Mar 24 2022 14:20:34-08:00 r3 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.

[r3-GigabitEthernet0/0/1]int g 0/0/2

[r3-GigabitEthernet0/0/2]ip address 192.168.1.97 27

[r3-GigabitEthernet0/0/2]q

[r3]dhcp enable ip pool aa

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

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

[r3-ip-pool-aa]q

[r3]int g 0/0/2

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

[r3]ip route-static 0.0.0.0 0 192.168.1.14

[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] display this

[V200R003C00]

#

 sysname r3

#

 snmp-agent local-engineid 800007DB03000000000000

 snmp-agent

#

 clock timezone China-Standard-Time minus 08:00:00

#

portal local-server load portalpage.zip

#

 drop illegal-mac alarm

#

 set cpu-usage threshold 80 restore 75

#

ip route-static 0.0.0.0 0.0.0.0 192.168.1.14

ip route-static 192.168.1.32 255.255.255.252 192.168.1.5

ip route-static 192.168.1.0 255.255.255.224 192.168.1.5

ip route-static 192.168.1.64 255.255.255.224 192.168.1.5

ip route-static 192.168.1.64 255.255.255.224 192.168.1.14

#

return

[r3]

R4

[r4]int g 0/0/0

[r4-GigabitEthernet0/0/0]ip address 192.168.1.10 30

Mar 24 2022 14:26:58-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 g 0/0/1

[r4-GigabitEthernet0/0/1]ip address 192.168.1.14 30

Mar 24 2022 14:27:26-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 g 0/0/2

[r4-GigabitEthernet0/0/2]ip address 192.168.1.17 30

[r4-GigabitEthernet0/0/2]int g 4/0/0

[r4-GigabitEthernet4/0/0]ip address 192.168.1.21 30

[r4-GigabitEthernet4/0/0]int l0

[r4-LoopBack0]ip address 192.168.1.129 28

[r4-LoopBack0]int l1

[r4-LoopBack1]ip address 192.168.1.145 28

[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 61

[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] display this

[V200R003C00]

#

 sysname r4

#

 snmp-agent local-engineid 800007DB03000000000000

 snmp-agent

#

 clock timezone China-Standard-Time minus 08:00:00

#

portal local-server load portalpage.zip

#

 drop illegal-mac alarm

#

 set cpu-usage threshold 80 restore 75

#

ip route-static 0.0.0.0 0.0.0.0 192.168.1.18

ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 preference 61

ip route-static 192.168.1.0 255.255.255.252 192.168.1.9

ip route-static 192.168.1.4 255.255.255.252 192.168.1.13

ip route-static 192.168.1.32 255.255.255.224 192.168.1.13

ip route-static 192.168.1.32 255.255.255.224 192.168.1.9

ip route-static 192.168.1.64 255.255.255.224 192.168.1.9

ip route-static 192.168.1.96 255.255.255.224 192.168.1.13

#

return

[r4]ip route-static 192.168.1.0 24 NULL 0

[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 preference 61

[r4]ip route-static 0.0.0.0 0 GigabitEthernet 0/0/2 192.168.1.18

R5

[r5]int g 0/0/0

[r5-GigabitEthernet0/0/0]ip address 192.168.1.18 30

Mar 24 2022 14:32:27-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 g 0/0/2

[r5-GigabitEthernet0/0/2]ip address 192.168.1.22 30

[r5-GigabitEthernet0/0/2]int l0

[r5-LoopBack0]ip address 192.168.1.161 27

[r5]ip route-static 0.0.0.0 0 12.0.0.2

[r5]ip route-static 192.168.1.0 24 192.168.1.17

[r5]ip route-static 192.168.1.0 24 192.168.1.21 preference

[r5]ip route-static 192.168.1.

[r5]acl 2000

[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 outbound 2000

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

R6

<Huawei>sys

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

[Huawei]sys isp

[isp]int g 0/0/0

[isp-GigabitEthernet0/0/0]ip address 12.0.0.2 24

Mar 24 2022 14:44:02-08:00 isp %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.

[isp-GigabitEthernet0/0/0]int l0

[isp-LoopBack0]ip address 1.1.1.1 24

[isp-LoopBack0]q

[isp]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:zyy

Password:

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

User last login information:

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

Access Type:Telnet

  IP-Address :192.168.1.2

Time        :2022-03-23 09:43:07-08:00

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

<r1>

### 静态路由实验报告及相关资料 静态路由是一种手动配置的路由方式,通常在网络管理员了解网络拓扑的情况下使用。它不需要复杂的协议支持,也不消耗额外带宽来维护路由表,因此适用于小型或稳定的网络环境[^1]。 以下是关于静态路由的一些关键点以及其实验配置方法: #### 1. 静态路由的基本概念 静态路由是由网络管理员手动定义的一组规则,用于指定数据包如何从源地址传输到目标地址。其主要特点是没有自动调整能力,在网络拓扑发生变化时需要重新配置。 #### 2. 配置命令示例 在实际操作中,可以通过以下命令实现静态路由的配置: ```bash [r4]ip route-static 192.168.1.32 255.255.255.240 192.168.1.13 [r4]ip route-static 192.168.1.48 255.255.255.240 192.168.1.13 ``` 上述命令表示将子网 `192.168.1.32/28` 和 `192.168.1.48/28` 的流量转发至下一跳地址 `192.168.1.13`[^2]。 对于其他设备,也可以采用类似的配置形式: ```bash [R1]ip route-static 0.0.0.0 0.0.0.0 192.169.1.5 [R1]ip route-static 0.0.0.0 0.0.0.0 192.169.1.18 ``` 这里设置了两条默认路由,分别指向不同的下一跳地址[^3]。 #### 3. 路由优先级与匹配原则 路由器在选择路径时会遵循最长前缀匹配的原则,并考虑优先级参数(如 `preference`)。例如: ```bash [R5]ip route-static 192.168.1.0 255.255.255.252 192.168.1.2 preference 61 [R5]ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 preference 61 ``` 以上配置表明,针对特定目的地址的数据流会选择具有更高优先级 (`preference`) 的路由条目[^4]。 #### 4. 实验验证过程 为了测试静态路由的有效性,可以利用抓包工具或者 ping 命令观察数据流向是否符合预期。例如,在 eNSP 平台上完成如下配置后,应能成功访问远程主机: ```bash ip route 192.168.1.0 255.255.255.0 192.168.1.6 metric 20 ``` 此语句指定了通往 `192.168.1.0/24` 子网的最佳路径及其代价值 (metric)[^5]。 --- ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值