HCIA复习实验

 

  1. 子网划分

内网部分总共需要九个网段

所以

192.168.0.0/24

192.168.0.0/28  r2的3个环回接口地址

192.168.0.0/30

192.168.0.4/30

192.168.0.8/30

192.168.0.16/28

192.168.0.32/28

192.168.0.48/28

192.168.0.64/28

192.168.0.80/28

192.168.0.96/28

192.168.0.112/28  vlan2

192.168.0.128/28  vlan3

2.给各接口配置ip地址

 

其中r3上要配置子接口

G0/0/2.1 vlan2  g0/0/2.2 vlan3

[router]interface g0/0/2.1  创建子接口

[router-GigabitEthernet0/0/2.1]dot1q termination vid 2  定义其管理的vlan

[router-GigabitEthernet0/0/2.1]ip address 192.168.0.112 28

[router-GigabitEthernet0/0/2.1]arp broadcast enable   开启子接口ARP功能

[router-GigabitEthernet0/0/2.1]q

[router]interface g0/0/2.2

[router-GigabitEthernet0/0/2.2]dot1q  termination vid 3

[router-GigabitEthernet0/0/2.2]ip address  192.168.0.128 28

[router-GigabitEthernet0/0/2.2]arp broadcast enable

再配置两个pool

r3]ip pool aaa  valn2

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

[r3-ip-pool-aaa]network 192.168.0.112 mask 255.255.255.240

[r3-ip-pool-aaa]gateway-list 192.168.0.129

Error:The network section should be within the subnet of the pool.

[r3-ip-pool-aaa]gateway-list 192.168.0.113

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

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

[r3-GigabitEthernet0/0/2.1]

r3]ip pool bbb  vlan3

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

[r3-ip-pool-bbb]network 192.168.0.128 mask 255.255.255.240

[r3-ip-pool-bbb]gateway-list 192.168.0.129

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

[r3-ip-pool-bbb]qu

[r3]interface g0/0/2.2

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

3.在交换机上配置vlan

Sw1上:配置vlan2,vlan3  e0/0/1和e0/0/4为trunk干道

Sw2:配置vlan2,vlan3  e0/0/1为trunk干道

 

 此时在pc1和pc2上可查看分配的ip地址

 

 

4.设置静态路由

R1:

ip route-static 192.168.0.48 28 192.168.0.34

ip route-static 192.168.0.64 28 192.168.0.34

ip route-static 192.168.0.80 28 192.168.0.34

ip route-static 192.168.0.96 28 192.168.0.17

ip route-static 192.168.0.112 28 192.168.0.17

ip route-static 192.168.0.128 28 192.168.0.17

R2:

ip route-static 192.168.0.32 28 192.168.0.18

ip route-static 192.168.0.48 28 192.168.0.18

ip route-static 192.168.0.64 28 192.168.0.18

ip route-static 192.168.0.80 28 192.168.0.97

ip route-static 192.168.0.112 28 192.168.0.97

ip route-static 192.168.0.128 28 192.168.0.97

 

R3:

ip route-static 192.168.0.16 28 192.168.0.98

ip route-static 192.168.0.32 28 192.168.0.81

ip route-static 192.168.0.48 28 192.168.0.81

ip route-static 192.168.0.64 28 192.168.0.81

 

R4:

ip route-static 192.168.0.16 28 192.168.0.33

ip route-static 192.168.0.96 28 192.168.0.82

ip route-static 192.168.0.112 28 192.168.0.82

ip route-static 192.168.0.128 28 192.168.0.82

 

R5:

ip route-static 192.168.0.16 28 192.168.0.49

ip route-static 192.168.0.32 28 192.168.0.49

ip route-static 192.168.0.80 28 192.168.0.49

ip route-static 192.168.0.96 28 192.168.0.49

ip route-static 192.168.0.112 28 192.168.0.49

ip route-static 192.168.0.128 28 192.168.0.49

环回接口后面再配置

此时测试PC1能否ping到192.168.0.49

可以ping通 设置没有问题

5.环回接口地址的汇总

R1: ip route-static 192.168.0.0 28 192.168.0.17

R3:ip route-static 192.168.0.0 28 192.168.0.98

R4:ip route-static 192.168.0.0 28 192.168.0.33

ip route-static 192.168.0.0 28 192.168.0.82

R5:ip route-static 192.168.0.0 28 192.168.0.49

ip route-static 192.168.0.0 28 192.168.0.65
6.在R2上配置空接口 防止出现环路

[r2]ip route-static 192.168.0.0 28 NULL 0

7.为环回接口配置缺省路由

R2:ip route-static 0.0.0.0 0 192.168.0.18

ip route-static 0.0.0.0 0 192.168.0.97

R1:ip route-static 0.0.0.0 0 192.168.0.34

R3:ip route-static 0.0.0.0 0 192.168.0.81

R4:ip route-static 0.0.0.0 0 192.168.0.50 preference 61 设置浮动静态

ip route-static 0.0.0.0 0 192.168.0.66

 

R5:ip route-static 0.0.0.0 0 100.1.1.2 

此时pc1还无法ping到isp

所以还需要nat来让访问成功

8.Nat

在r5上:

Acl 2000

Rule 1 permit source any

进入g0/0/2接口:

Nat outbound 2000

9.测试

Pc1ping ISP

能够Ping通 满足所以条件

、、、、、、、、、、、

End

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值