單臂路由和DHCP實驗_第1頁
單臂路由和DHCP實驗_第2頁
單臂路由和DHCP實驗_第3頁
單臂路由和DHCP實驗_第4頁
單臂路由和DHCP實驗_第5頁
已閱讀5頁,還剩1頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、需求一:實施單臂路由實驗(小型網(wǎng)絡)通過在交換鏈路實施trunk和路由器的子接口功能,實現(xiàn)屬于小型網(wǎng)絡中,屬于不同vlan的 兩臺PC的通信PC之間是通過兩臺交換機的e0/2 口來通信的,sw2的e0/3 口為BLK狀態(tài);(我沒有修改到達e0/3的開銷,故e0/2 口是根端口,可以接收和轉發(fā)數(shù)據(jù))1)那么首先,交換之間(2 口之間)配置trunk鏈路:先封裝dotlq,再劃到trunk上,但不劃具體的vlan (這里不是配置本征vlan實驗,不要配置允許通過哪些個vlan的流量)sw1到Branch之間也實施trunk,即交換機上一端封裝dot1q,并劃到trunk上,也不劃vlan;路由器上

2、也封裝dot1q,這一步是關鍵,路由器會通過dot1q封裝來識別流量,配置的方式 和交換機上不同再分別將 sw1 和 sw2 的 1 口 access 到 vlan10 和 vlan202)然后,切記,PC1和PC2的網(wǎng)關的設置,如果不關閉PC的路由功能,那么pc1(路由器)到pc2 (路由器)是沒有路由的(需要配置路由,可能是靜態(tài)),數(shù)據(jù)包是不通的設置完畢后,需要測試網(wǎng)關是否可以ping通,這一步也是非常重要3)最后,測試PC1到PC2是否可以ping通1)sw1(config)#int e0/2sw1(config-if)#switchport trunk encapsulation do

3、t1qsw1(config-if)#switchport mode trunksw2(config)#int e0/2sw2(config-if)#switchport trunk encapsulation dot1qsw2(config-if)#switchport mode trunkBranch(config)#default int e0/0Interface Ethernet0/0 set to default configurationBranch(config)#do sh run int e0/0Building configuration.Current configura

4、tion : 44 bytes!interface Ethernet0/0no ip addressendBranch(config)#int e0/0.10Branch(config-subif)#encapsulation dotlQ 10Branch(config-subif)#ip address 10.1.10.254 255.255.255.0Branch(config-subif)#exiBranch(config)#int e0/0.20Branch(config-subif)#encapsulation dot1Q 20Branch(config-subif)#ip addr

5、ess 10.1.20.254 255.255.255.0 sw1(config)#int e0/1sw1(config-if)#switchport mode accesssw1(config-if)#switchport access vlan 10sw2(config)#int e0/1sw2(config-if)#switchport mode accesssw2(config-if)#switchport access vlan 20PC1(config)#int e0/1PC1(config-if)#ip address 10.1.10.100PC1(config-if)#ip a

6、ddress 10.1.10.100 255.255.255.0PC1(config-if)#exiPC1(config)#no ip routingPC1(config)#default gateway 10.1.10.254pc2(config)#default int e0/1Interface Ethernet0/1 set to default configuration pc2(config)#no ip routingpc2(config)#default gateway 10.1.20.254 pc2(config)#int e0/1pc2(config-if)#ip addr

7、ess 10.1.20.100 255.255.255.0 3)測試ping網(wǎng)關一開始ping2個網(wǎng)關均沒ping通檢查,pc1設置,沒問題路由器設置也沒問題最后發(fā)現(xiàn),問題出在將sw1的e0/1劃到trunk去了(應該劃到vlan10的),并且e0/0 口也 沒有配置任何東西;清除這2個端口上的所有配置,重新操作后,發(fā)現(xiàn)可以ping通了sw1(config)#default int e0/1Interface Ethernet0/1 set to default configuration*Mar 7 09:25:03.528: %LINK-3-UPDOWN: Interface Ethern

8、et0/1, changed state to up*Mar 7 09:25:04.529: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to upsw1(config)#int e0/1sw1(config-if)#switchport mode accesssw1(config-if)#switchport access vlan 10sw1(config-if)#exisw1(config)#default int e0/0Interface Ethernet0/0 set to d

9、efault configuration*Mar 7 09:26:27.190: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet。/。, changed state to down*Mar 7 09:26:30.194: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up sw1(config)#int e0/0sw1(config-if)#switchport trunk encapsulation dot1qsw1(

10、config-if)#switchport mode trunkPC1#ping 10.1.20.254Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.1.20.254, timeout is 2 seconds:.!Success rate is 20 percent (1/5), round-trip min/avg/max = 5023/5023/5023 msPC1#ping 10.1.10.254Type escape sequence to abort.Sending 5, 100-byte IC

11、MP Echos to 10.1.10.254, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms這里我有疑問,求解析:pc1 為什么可以 ping 通 10.1.20.254pc1上的arp表象中為什么不會有10.1.20.254需求二:在小型網(wǎng)絡里實施DHCPBranch作為DHCP服務器,并為PC1和PC2都分配ip在小型網(wǎng)絡中,配置靜態(tài)IP地址,有很多缺點,比如可能會出現(xiàn)地址沖突(兩臺設備配置 了同一個ip);工作量很大并且沒有擴展性可言;于是,在網(wǎng)絡中需

12、要動態(tài)主機控制協(xié)議(DHCP),它可以根據(jù)用戶的vlan屬性,分配ip地址1)首先,cisco設備中DHCP是默認開啟的,關閉是Branch(config)#no service dhcpBranch(config)#ip dhcp pool yanghaibo配置 vlan10 的地址池Branch(dhcp-config)#network 10.1.10.0 /24/配置子網(wǎng)Branch(dhcp-config)#default-router 10.1.10.254/配置默認網(wǎng)關Branch(dhcp-config)#dns-server 114.114.114.114/配置 DNS 服務

13、器Branch(dhcp-config)#lease 1 16/配置租用日期Branch(dhcp-config)#exiBranch(config)#ip dhcp excluded-address 10.1.10.101 10.1.10.254/排除一些地址Pc1上這樣配置PC1#conftEnter configuration commands, one per line. End with CNTL/Z.PC1(config)#int e0/1PC1(config-if)#ip address dhcpPC1(config-if)#在 Branch 上敲了 debug DHCP det

14、ail,結果在 pc1 上有調(diào)試信息,由于(PC1(config-if)#ip address dhcp)敲了 2次,pc1被自動分配了 2次地址:*Mar 7 10:11:46.172: %DHCP-6-ADDRESS_ASSIGN: Interface Ethernet0/1 assigned DHCPaddress 10.1.10.1, mask 255.255.255.0, hostname PC1PC1(config-if)#ip address dhcpPC1(config-if)#*Mar 7 10:12:08.463: %DHCP-6-ADDRESS_ASSIGN: Inter

15、face Ethernet0/1 assigned DHCPaddress 10.1.10.2, mask 255.255.255.0, hostname PC1上面是vlan1的地址池Branch(config)#ip dhcp pool yanghaibo 2Branch(dhcp-config)#network 10.1.20.0 /24Branch(dhcp-config)#default-router 10.1.20.254Branch(dhcp-config)#dns-server 114.114.114.114Branch(dhcp-config)#lease 1 16Branc

16、h(dhcp-config)#exiBranch(config)#ip dhcp excluded-address 10.1.20.101 10.1.20.254 pc2enpc2#conf tEnter configuration commands, one per line. End with CNTL/Z.pc2(config)#int e0/1pc2(config-if)#ip address dhcppc2(config-if)#*Mar 7 10:18:18.537: %DHCP-6-ADDRESS_ASSIGN: Interface Ethernet0/1 assigned DH

17、CP address 10.1.20.1, mask 255.255.255.0, hostname pc2在pc2上開啟debug dhcp再次敲自動分配地址的命令,得到如下調(diào)試信息:pc2#debug dhcpDHCP client activity debugging is on pc2(config-if)#ip address dhcp*Mar 7 10:20:31.942: DHCP: Sending notification of TERMINATION:*Mar 7 10:20:31.942: Address 10.1.20.1 mask 255.255.255.0*Mar 7

18、 10:20:31.942: DHCP: Client socket is opened*Mar 7 10:20:31.942: DHCP: SRelease attempt # 1 for entry:*Mar 7 10:20:31.942: DHCP: SRelease placed Server ID option: 10.1.20.254*Mar 7 10:20:31.942: DHCP: SRelease: 279 bytes*Mar 7 10:20:33.108: DHCP: SRelease attempt # 2 for entry:*Mar 7 10:20:33.108: D

19、HCP: SRelease placed Server ID option: 10.1.20.254*Mar 7 10:20:33.108: DHCP: SRelease: 279 bytes*Mar 7 10:20:35.129: DHCP: SRelease attempt # 3 for entry:*Mar 7 10:20:35.129: DHCP: SRelease placed Server ID option: 10.1.20.254*Mar 7 10:20:35.129: DHCP: SRelease: 279 bytes pc2(config-if)#*Mar 7 10:20

20、:37.489: RAC: DHCP stopped on interface Ethernet0/1*Mar 7 10:20:37.489: DHCP: DHCP client process started: 10*Mar 7 10:20:37.494: RAC: Starting DHCP discover on Ethernet0/1*Mar 7 10:20:37.494: DHCP: Try 1 to acquire address for Ethernet0/1*Mar 7 10:20:37.507: DHCP: allocate request*Mar 7 10:20:37.50

21、7: DHCP: zapping entry in DHC_PURGING state for Et0/1*Mar 7 10:20:37.507: DHCP: deleting entry B4406420 10.1.20.1 from list*Mar 7 10:20:37.507: DHCP: new entry. add to queue, interface Ethernet0/1*Mar 7 10:20:37.507: DHCP: SDiscover attempt # 1 for entry:*Mar 7 10:20:37.507: DHCP: SDiscover: sending

22、 292 byte length DHCP packet pc2(config-if)#*Mar 7 10:20:37.507: DHCP: SDiscover 292 bytes*Mar 7 10:20:37.507:Bcast on Ethernet0/1 interface from 0.0.0.0pc2(config-if)#*Mar 7 10:20:39.538: DHCP: Received a BOOTREP pkt*Mar 7 10:20:39.538: DHCP: offer received from 10.1.20.254*Mar 7 10:20:39.538: DHCP: SRequest attempt # 1 for entry:*Mar 7 10:20:39.538: DHCP:

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論