HCIP第一次实验

 

第一步配置路由器及交换机(ip vlan)

[r1]interface LoopBack 0

[r1-LoopBack0]ip address 192.168.0.1 30                      

[r1]interface LoopBack 1     

[r1-LoopBack1]ip address 192.168.0.5 30

[r1]interface LoopBack 2     

[r1-LoopBack2]ip address 192.168.0.9 30

[r1-GigabitEthernet0/0/0]ip address 192.168.0.17 28

[r1-GigabitEthernet0/0/1]ip address 192.168.0.98 28

[r2]interface g0/0/1

[r2-GigabitEthernet0/0/1]ip address 192.168.0.18 28

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

[r2-GigabitEthernet0/0/0]ip address 192.168.0.33 28

[r3]int g0/0/0

[r3-GigabitEthernet0/0/0]ip address 192.168.0.97 28

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

[r3-GigabitEthernet0/0/1]ip address 192.168.0.82 28

[r3]int g0/0/2.1

[r3-GigabitEthernet0/0/2.1]dot1q termination vid 2

[r3-GigabitEthernet0/0/2.1]ip address 192.168.0.113 28

[r3-GigabitEthernet0/0/2.1]arp broadcast enable

[r3]int g0/0/2.2

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

[r3-GigabitEthernet0/0/2.2]ip address 192.168.0.129 28

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

[r3]int g0/0/2.1

[r3-GigabitEthernet0/0/2.1]dot1q termination vid 2

[r3-GigabitEthernet0/0/2.1]ip address 192.168.0.113 28

[r3-GigabitEthernet0/0/2.1]arp broadcast enable

[r3]int g0/0/2.2

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

[r3-GigabitEthernet0/0/2.2]ip address 192.168.0.129 28

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

[r3]ip pool jiji

[r3-ip-pool-jiji]netbios-type

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

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

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

[r3]ip pool sese

[r3-ip-pool-sese]netbios-type

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

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

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

[r3]dhcp enable

[r3]int g0/0/2.1

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

[r3]int g0/0/2.2

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

[r4]int g0/0/2

[r4-GigabitEthernet0/0/2]ip address 192.168.0.34 28

[r4-GigabitEthernet0/0/2]int g0/0/0

[r4-GigabitEthernet0/0/0]ip address 192.168.0.49 28

[r4-GigabitEthernet0/0/0]int g0/0/1

[r4-GigabitEthernet0/0/1]ip address 192.168.0.66 28

[r4-GigabitEthernet0/0/1]int g4/0/0

[r4-GigabitEthernet4/0/0]ip address 192.168.0.81 28

[r5]int g0/0/0

[r5-GigabitEthernet0/0/0]ip address 192.168.0.50 28

[r5-GigabitEthernet0/0/0]int g0/0/1

[r5-GigabitEthernet0/0/1]ip address 192.168.0.65 28

[r5-GigabitEthernet0/0/1]int g0/0/2

[r5-GigabitEthernet0/0/2]ip address 100.1.1.1 24

[r6]int g0/0/0

[r6-GigabitEthernet0/0/0]ip address 100.1.1.2 24

[sw1]vlan batch 2 3

[sw1]int e0/0/1    

[sw1-Ethernet0/0/1]port link-type trunk

[sw1-Ethernet0/0/1]port trunk allow-pass vlan all                       

[sw1-Ethernet0/0/1]int e0/0/2

[sw1-Ethernet0/0/2]port link-type trunk          

[sw1-Ethernet0/0/2]port trunk allow-pass vlan all

[sw1]int e0/0/4

[sw1-Ethernet0/0/4]port link-type access

[sw1-Ethernet0/0/4]port default vlan 2

[sw1-Ethernet0/0/4]int e0/0/3

[sw1-Ethernet0/0/3]port link-type access

[sw1-Ethernet0/0/3]port default vlan 3  

[sw2]vlan batch 2 3

[sw2]int e0/0/1

[sw2-Ethernet0/0/1]port link-type trunk

[sw2-Ethernet0/0/1]port trunk allow-pass vlan all

[sw2]int e0/0/2

[sw2-Ethernet0/0/2]port link-type access  

[sw2-Ethernet0/0/2]port default vlan 2

[sw2]int e0/0/3           

[sw2-Ethernet0/0/3]port link-type access

[sw2-Ethernet0/0/3]port default vlan 3  

静态路由

[r1]ip route-static 192.168.0.32 28 192.168.0.18

[r1]ip route-static 192.168.0.48 28 192.168.0.18

[r1]ip route-static 192.168.0.64 28 192.168.0.18

[r1]ip route-static 192.168.0.80 28 192.168.0.97     

[r1]ip route-static 192.168.0.112 28 192.168.0.97

[r1]ip route-static 192.168.0.128 28 192.168.0.97

[r2]ip route-static 192.168.0.96 28 192.168.0.17

[r2]ip route-static 192.168.0.48 28 192.168.0.34

[r2]ip route-static 192.168.0.64 28 192.168.0.34

[r2]ip route-static 192.168.0.80 28 192.168.0.34

[r2]ip route-static 192.168.0.112 28 192.168.0.34

[r2]ip route-static 192.168.0.128 28 192.168.0.34

[r3]ip route-static 192.168.0.16 28 192.168.0.98

[r3]ip route-static 192.168.0.48 28 192.168.0.81

[r3]ip route-static 192.168.0.64 28 192.168.0.81

[r3]ip route-static 192.168.0.32 28 192.168.0.81

[r4]ip route-static 192.168.0.16 28 192.168.0.33

[r4]ip route-static 192.168.0.96 28 192.168.0.82

[r4]ip route-static 192.168.0.112 28 192.168.0.82

[r4]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

[r5]ip route-static 192.168.0.32 28 192.168.0.49

[r5]ip route-static 192.168.0.80 28 192.168.0.49

[r5]ip route-static 192.168.0.96 28 192.168.0.49

[r5]ip route-static 192.168.0.112 28 192.168.0.49

[r5]ip route-static 192.168.0.128 28 192.168.0.49

[r5]ip route-static 192.168.0.16 28 192.168.0.66

[r5]ip route-static 192.168.0.32 28 192.168.0.66

[r5]ip route-static 192.168.0.80 28 192.168.0.66

[r5]ip route-static 192.168.0.96 28 192.168.0.66

[r5]ip route-static 192.168.0.112 28 192.168.0.66

[r5]ip route-static 192.168.0.128 28 192.168.0.66

汇总

[r2]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

[r4]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

[r5]ip route-static 192.168.0.0 28 192.168.0.66

空接口

[r1]ip route-static 192.168.0.0 28 NULL 0

缺省

[r1]ip route-static 0.0.0.0 0 192.168.0.18

[r1]ip route-static 0.0.0.0 0 192.168.0.97

[r2]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

[r4]ip route-static 0.0.0.0 0 192.168.0.65

[r4]ip route-static 0.0.0.0 0 192.168.0.50 preference 80(将线路优先级改为80)

[r5]ip route-static 0.0.0.0 0 100.1.1.2

做NET

[r5]acl 2000

[r5-acl-basic-2000]rule 1 permit source any

[r5]int g0/0/2

[r5-GigabitEthernet0/0/2]nat outbound 2000

检测用PC1去PING100.1.1.2

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值