學習新思想,爭做新青年。今天學習的是HCIA綜合實驗!

實驗拓撲

HCIA綜合實驗_IP

實驗需求

總部:

1、除了SW8 SW9是三層交換機,其他交換機均為2層交換機。

2、GW為總部的出口設備,使用單臂路由技術,VLAN10,20,100的網關都在GW上

3、總部、分支8、分支9之間互有專線連接,目標:GW與SW8與SW9三臺建立OSPF

???? 互相宣告互為鄰居,進程號200,區域0,達到企業內網全網互通。

4、在SW8和SW9建立的鄰居中,SW8的互聯接口要永遠成為DR

5、要求DHCP服務器在路由追蹤PC8的時候,路徑中必須包含SW9

特性:

6、VLAN10,20的PC均由DHCP服務器提供IP地址,DHCP服務器的地址池配置如下

???? VLAN10:192.168.10.0/24? GW:192.168.10.254? DNS:8.8.8.8? 租期:8天

???? VLAN20:192.168.20.0/24? GW:192.168.20.254? DNS:8.8.8.8? 租期:8天

???? PC2是老板的PC,老板要求通過DHCP給他固定IP:192.168.20.100/24其他與地址池一致

???? 由于員工區存在打印機,需要排除掉192.168.10.240~254;192.168.20.240~254

7、GW路由器使用NAT技術,配置EASY IP技術讓內部設備可以上網,在Internet路由器上使用

?? 環回接口模擬公網地址,讓所有PC可以Ping通100.1.1.1

8、服務器區有一臺HTTP服務器,將其80端口發布至Internet網絡,在Internet路由器上使用

?? telnet 70.1.1.1 80 來驗證是否成功

分支8:

1、PC8配置靜態IP,PC8可以通過總部GW上網,ping 100.1.1.1

分支9:

1、PC9配置靜態IP,PC9可以通過總部GW上網,ping 100.1.1.1

實驗配置

GW

sysname GW#undo info-center enable#vlan batch 10 20 100 200 to 202#dhcp enable   //使能DHCP#acl number 2000   //創建ACLrule 5 permit#interface Eth-Trunk1   //創建聚合口1undo portswitch           //切換為三層接口#interface Eth-Trunk1.10    //進入聚合口的子接口dot1q termination vid 10  ip address 192.168.10.254 255.255.255.0arp broadcast enable    //使能arp廣播dhcp select relay      //使能子接口DHCP中繼dhcp relay server-ip 192.168.100.100  //配置DHCP服務器地址#interface Eth-Trunk1.20dot1q termination vid 20ip address 192.168.20.254 255.255.255.0arp broadcast enabledhcp select relaydhcp relay server-ip 192.168.100.100#interface Eth-Trunk1.100dot1q termination vid 100ip address 192.168.100.254 255.255.255.0arp broadcast enable#interface Eth-Trunk1.200dot1q termination vid 200ip address 60.30.1.2 255.255.255.248arp broadcast enablenat server protocol tcp global 70.1.1.1 www inside 192.168.100.101 www   //配置NAT轉換nat outbound 2000#interface Eth-Trunk1.201dot1q termination vid 201ip address 192.168.201.1 255.255.255.0ospf cost 3    //修改路徑開銷為3arp broadcast enable#interface Eth-Trunk1.202dot1q termination vid 202ip address 192.168.202.1 255.255.255.0arp broadcast enable#interface GigabitEthernet0/0/0eth-trunk 1#interface GigabitEthernet0/0/1eth-trunk 1#interface LoopBack0ip address 1.1.1.1 255.255.255.255#ospf 100 router-id 1.1.1.1area 0.0.0.0network 1.1.1.1 0.0.0.0network 60.30.1.0 0.0.0.255network 192.168.10.0 0.0.0.255network 192.168.20.0 0.0.0.255network 192.168.100.0 0.0.0.255network 192.168.201.0 0.0.0.255network 192.168.202.0 0.0.0.255#ip route-static 0.0.0.0 0.0.0.0 60.30.1.1#return
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107.
  • 108.
  • 109.
  • 110.
  • 111.
  • 112.
  • 113.
  • 114.
  • 115.
  • 116.
  • 117.
  • 118.
  • 119.
  • 120.
  • 121.
  • 122.
  • 123.
  • 124.
  • 125.
  • 126.
  • 127.
  • 128.
  • 129.
  • 130.
  • 131.
  • 132.
  • 133.
  • 134.
  • 135.
  • 136.
  • 137.
  • 138.
  • 139.
  • 140.
  • 141.
  • 142.
  • 143.
  • 144.
  • 145.

L2-Core-SW

sysname L2-Core-SW#undo info-center enable#vlan batch 10 20 100 200 to 202#interface Eth-Trunk1port link-type trunkport trunk allow-pass vlan 2 to 4094#interface Eth-Trunk2port link-type trunkport trunk allow-pass vlan 2 to 4094#interface GigabitEthernet0/0/1port link-type accessport default vlan 201#interface GigabitEthernet0/0/2eth-trunk 1#interface GigabitEthernet0/0/3eth-trunk 1#interface GigabitEthernet0/0/4eth-trunk 2#interface GigabitEthernet0/0/5eth-trunk 2#interface GigabitEthernet0/0/6port link-type trunkport trunk allow-pass vlan 2 to 4094#interface GigabitEthernet0/0/7port link-type trunkport trunk allow-pass vlan 2 to 4094#interface GigabitEthernet0/0/8port hybrid tagged vlan 100#interface GigabitEthernet0/0/9port link-type accessport default vlan 202
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.

DHCP

sysname DHCP
#undo info-center enable
#
dhcp enable
#
ip pool VLAN10gateway-list 192.168.10.254 network 192.168.10.0 mask 255.255.255.0 excluded-ip-address 192.168.10.240 192.168.10.253 lease day 8 hour 0 minute 0 dns-list 8.8.8.8 
#
ip pool VLAN20gateway-list 192.168.20.254 network 192.168.20.0 mask 255.255.255.0 static-bind ip-address 192.168.20.100 mac-address 5489-9806-68e7 excluded-ip-address 192.168.20.240 192.168.20.253 lease day 8 hour 0 minute 0 dns-list 8.8.8.8 
#
interface GigabitEthernet0/0/0ip address 192.168.100.100 255.255.255.0 dhcp select global
#
ip route-static 0.0.0.0 0.0.0.0 192.168.100.254
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.

ACC_SW

# sysname ACC_SW # undo info-center enable # vlan batch 200 # interface Eth-Trunk1 port link-type trunk port trunk allow-pass vlan 2 to 4094 # interface GigabitEthernet0/0/1 port link-type access port default vlan 200 # interface GigabitEthernet0/0/2 eth-trunk 1 # interface GigabitEthernet0/0/3 eth-trunk 1

ACC-SW-Staff01

#sysname ACC-SW-Staff01#undo info-center enable#vlan batch 10#interface GigabitEthernet0/0/1port link-type accessport default vlan 10#interface GigabitEthernet0/0/2port link-type trunkport trunk allow-pass vlan 2 to 4094
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.

ACC-SW-Staff02

#sysname ACC-SW-Staff02#undo info-center enable#vlan batch 20#interface GigabitEthernet0/0/1port link-type trunkport trunk pvid vlan 20port trunk allow-pass vlan 20#interface GigabitEthernet0/0/2port link-type trunkport trunk allow-pass vlan 2 to 4094
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.

ACC-SW-Server01

#sysname ACC-SW-Server01#undo info-center enable#vlan batch 100#interface GigabitEthernet0/0/1port hybrid pvid vlan 100port hybrid untagged vlan 100#interface GigabitEthernet0/0/2port hybrid pvid vlan 100port hybrid untagged vlan 100#interface GigabitEthernet0/0/3port hybrid tagged vlan 100
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.

SW8

#sysname SW8#undo info-center enable#vlan batch 80 201 203#interface Vlanif80ip address 192.168.80.254 255.255.255.0#interface Vlanif201ip address 192.168.201.2 255.255.255.0#interface Vlanif203ip address 192.168.203.1 255.255.255.0ospf dr-priority 255  //修改ospf優先級#interface GigabitEthernet0/0/1port link-type accessport default vlan 201#interface GigabitEthernet0/0/2port link-type accessport default vlan 80#interface GigabitEthernet0/0/3port link-type accessport default vlan 203#interface LoopBack0ip address 8.8.8.8 255.255.255.255#ospf 100 router-id 8.8.8.8area 0.0.0.0network 8.8.8.8 0.0.0.0network 192.168.201.0 0.0.0.255network 192.168.80.0 0.0.0.255network 192.168.203.0 0.0.0.255#ip route-static 0.0.0.0 0.0.0.0 192.168.201.1#return
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.

SW9

#sysname SW9#undo info-center enable#vlan batch 90 202 to 203#interface Vlanif90ip address 192.168.90.254 255.255.255.0#interface Vlanif202ip address 192.168.202.2 255.255.255.0#interface Vlanif203ip address 192.168.203.2 255.255.255.0#interface MEth0/0/1#interface GigabitEthernet0/0/1port link-type accessport default vlan 202#interface GigabitEthernet0/0/2port link-type accessport default vlan 90#interface GigabitEthernet0/0/3port link-type accessport default vlan 203#interface LoopBack0ip address 9.9.9.9 255.255.255.255#ospf 100 router-id 9.9.9.9area 0.0.0.0network 9.9.9.9 0.0.0.0network 192.168.202.0 0.0.0.255network 192.168.90.0 0.0.0.255network 192.168.203.0 0.0.0.255#ip route-static 0.0.0.0 0.0.0.0 192.168.202.1
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.

Internet

#sysname Internet#undo info-center enable#vlan batch 200#interface GigabitEthernet0/0/0ip address 60.30.1.1 255.255.255.248#interface LoopBack0ip address 100.1.1.1 255.255.255.255#ip route-static 70.1.1.1 255.255.255.255 60.30.1.2
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.

配置完畢,驗證配置

PC1獲取IP地址

HCIA綜合實驗_DHCP_02

?PC2獲取IP地址

HCIA綜合實驗_服務器_03

?PC1 Ping DHCP服務器

HCIA綜合實驗_DHCP_04

PC1 Ping Internet

HCIA綜合實驗_DHCP_05

?PC1 Ping PC8

HCIA綜合實驗_IP_06

?PC1 Ping PC9

HCIA綜合實驗_DHCP_07

驗證完畢,全網互通。