HCIP - static routing experiment

 1. Experimental requirements

1. R6 is an ISP, and the interface IP addresses are all public addresses, and no further configuration can be performed on them;
2. R1-R5 are LANs, with private IP addresses 192.168.1.0/24, please allocate them reasonably.
3. Therefore, the route is looped back , both represent the interface connecting the user;
4. The two PCs under R3 automatically obtain IP addresses through DHCP 5.
The optimal routing table for route selection should be as small as possible to avoid loops
;
.R6telnetR5's public IP address, actually log in to R1.
8. R4 and R5 normally pass through the 1000 link, and pass through the 100M link in case of failure;

2. Topology 

 3. IP planning

192.168.1.0/24
5 users + 1 backbone
192.168.1.0/27 (backbone): 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 1912.208/30 30 192.168.1.24/30 192.168.1.28/30

 (Two more backbone network segments are used for later upgrades)

R1:192.168.1.32/27(192.168.1.32/28 192.168.48/28)
R2:192.168.1.64/27(192.168.1.64/28 192.168.80/28)
R3:192.168.1.96/27
R4:192.168.1.64/28 /27(192.168.1.128/28 192.168.1.144/28)
R5:192.168.1.160/27

4. Experimental process - equipment configuration

  1. Topology Design—IP Address Planning
  2. Implementation: (1) topology construction (2) configuration

  Configuration:

  1. IP configuration 2. Routing configuration 3. Strategy - rules, optimization, security 4. Testing 5. Troubleshooting

 R1:

1.配置接口IP
<Huawei>system-view 	
[Huawei]sysname R1	//改名
[R1]interface LoopBack 0//创建环回接口0
[R1-LoopBack0]ip address 192.168.1.33 28//配环回接口网关IP
[R1-LoopBack0]quit 
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.1.49 28
 
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30//配置骨干接口的IP
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.9 30

2.配置缺省路由(先配置缺省路由再进行路由补缺)
[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//负载均衡

3.配置静态路由
[R1]ip route-static 192.168.1.64 27 192.168.1.2
[R1]ip route-static 192.168.1.4 30 192.168.1.2
[R1]ip route-static 192.168.1.96 27 192.168.1.10
[R1]ip route-static 192.168.1.12 27 192.168.1.10

4.对进行了汇总操作的路由设备配置空接口(避免出现环路)
[R1]ip route-static 192.168.1.32 27 NULL 0

5.配置远程登录服务
[R1]aaa//启动远程登录服务
[R1-aaa]local-user panlin privilege level 15 password cipher 123456	//定义用户名为panlin 权限设置为15 密码为123456
[R1-aaa]local-user panlin service-type telnet //定义远程登录账号用于telnet服务
[R1-aaa]q
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa

 R2:


1.配置路由接口IP:
<Huawei>system-view 	
[Huawei]sysname R2
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 192.168.1.65 28
[R2]interface LoopBack 1
[R2-LoopBack1]ip address 192.168.1.81 28
 
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[R2]interface GigabitEthernet 0/0/1 
[R2-GigabitEthernet0/0/1]ip address 192.168.1.5 30

2.配置缺省路由
[R3]ip route-static 0.0.0.0 0 192.168.1.14

3.配置静态路由
[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.96 27 192.168.1.1
[R2]ip route-static 192.168.1.96 27 192.168.1.6//负载均衡

4.对进行了汇总操作的路由设备配置空接口(避免出现环路)
[R2]ip route-static 192.168.1.64 27 NULL 0

 R3:


1.配置路由接口IP
<R3>system-view 
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.13 30

[R3]dhcp enable
[R3]ip pool pl
[R3-ip-pool-pl]network 192.168.1.96 mask 255.255.255.224//关联接口,定义该池塘可分配ip地址的范围;
[R3-ip-pool-pl]getway-list 192.168.1.97//该网段网关
[R3]interface g0/0/2
[R3-GigabitEthernet0/0/0]dhcp select global//在该接口启动DHCP服务 

2.配置缺省路由
[R2]ip route-static 0.0.0.0 0 192.168.1.6

3.配置静态路由
[R3]ip route-static 192.168.1.32 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.9
[R3]ip route-static 192.168.1.64 27 192.168.1.14//负载均衡

R4:


1.配置路由接口IP
<Huawei>system-view 
[Huawei]sysname R4
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 192.168.1.129 28
[R4]interface LoopBack 1
[R4-LoopBack1]ip address 192.168.1.145 28
 
 
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[R4]interface GigabitEthernet 0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[R4]interface GigabitEthernet 0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[R4]interface Ethernet2/0/0
[R4-Ethernet2/0/0]ip address 192.168.1.21 30

2.配置缺省路由
[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//配置缺省路由并修改优先级

3.配置静态路由
[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.0 30 192.168.1.5
[R4]ip route-static 192.168.1.8 30 192.168.1.13
[R4]ip route-static 192.168.1.64 27 192.168.1.5
[R4]ip route-static 192.168.1.96 27 192.168.1.13//负载均衡

4.对进行了汇总操作的路由设备配置空接口(避免出现环路)
[R4]ip route-static 192.168.1.128 27 NULL 0

R5:


1.配置路由接口IP
<Huawei>system-view 
[Huawei]sysname R4
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 192.168.1.161 28

 
[R5]interface GigabitEthernet 0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.1.22 30
[R5]interface GigabitEthernet 0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.1.18 30
[R5]interface GigabitEthernet 0/0/2
[R5-GigabitEthernet0/0/1]ip address 56.1.1.1 24

2.配置缺省路由
[R5]ip route-static 0.0.0.0 0 56.1.1.2//配置缺省路由访问公网

3.配置静态路由
配置1000兆干道路由
[R5]ip route-static 192.168.1.32 27 192.168.1.17 
[R5]ip route-static 192.168.1.64 27 192.168.1.17
[R5]ip route-static 192.168.1.96 27 192.168.1.17
[R5]ip route-static 192.168.1.0 30 192.168.1.17
[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.12 30 192.168.1.17
[R5]ip route-static 192.168.1.128 27 192.168.1.17
配置100兆干道路由
[R5]ip route-static 192.168.1.0 255.255.255.252 192.168.1.21 permanent 61//修改优先级
[R5]ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 permanent 61
[R5]ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 permanent 61
[R5]ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 permanent 61
[R5]ip route-static 192.168.1.32 255.255.255.224 192.168.1.21 permanent 61
[R5]ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 permanent 61
[R5]ip route-static 192.168.1.96 255.255.255.224 192.168.1.21 permanent 61
[R5]ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 permanent 61
[R5]ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 permanent 61

4.配置nat使R6能返回信号
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255//规则
[R5-acl-basic-2000]int g0/0/2
[R5-GigabitEthernet0/0/2]nat outbound 2000

5.配置端口映射使R6通过R5远程登录R1
[R5]interface g0/0/2	
[R5-GigabitEthernet0/0/2]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.33 23//将R5的g0/0/2的23口映射为R1的192.168.1.33的23口

R6:


<Huawei>system-view 
[Huawei]sysname R6
[R6]interface LoopBack 0	
[R6-LoopBack0]ip address 6.6.6.1 24	

[R6]interface g0/0/0
[R6-GigabitEthernet0/0/0]ip address 56.1.1.2 24

5. Experimental results - test

1. The whole network is reachable, R1-R5 can access the loopback of R6

 2. When using the public IP address of R6telnetR5, actually log in to R1

 

 

 

Guess you like

Origin blog.csdn.net/qq_63099085/article/details/128526739