国产宅男网站在线|亚洲A级性爱免费视频|亚洲中精品级在线|午夜福利AA毛

  • <dd id="gf5jf"><th id="gf5jf"></th></dd>

    <cite id="gf5jf"><label id="gf5jf"></label></cite>
  • <div id="gf5jf"><listing id="gf5jf"></listing></div>
    學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 網(wǎng)絡(luò)知識 > 路由器 > 路由器設(shè)置 > cisco思科 > cisco dhcp服務(wù)器設(shè)置

    cisco dhcp服務(wù)器設(shè)置

    時間: 春健736 分享

    cisco dhcp服務(wù)器設(shè)置

      網(wǎng)絡(luò)交換機(jī)的設(shè)置方法那是比較多的,要視具體情況而定,有不少網(wǎng)友不知道cisco dhcp服務(wù)器怎么設(shè)置?下面學(xué)習(xí)啦小編為大家講解具體設(shè)置方法,供你參考!

      cisco dhcp服務(wù)器設(shè)置具體操作

      配置DHCP服務(wù)器實例網(wǎng)絡(luò)環(huán)境:一臺2811路由,一臺2950交換機(jī),一臺3560交換機(jī),三臺自動獲取IP地址的PC。

      劃分三個vlan1,vlan2,vlan3。拓?fù)淙缦?/p>

      配置命令及步驟如下:

      第一步:配置路由成為DHCP服務(wù)器

      1、設(shè)置地址池 /*有幾個VLAN要設(shè)幾個地址池,我們有3個vlan所以要設(shè)3個地址池*/

      /*第一個地址池*/

      Switch(Config)#ip dhcp pool test01

      /*建立地址池,test01為名稱~~名字可自己設(shè)置

      Switch(Config-pool)#network 192.168.1.0 255.255.255.0

      /*此處為設(shè)置要分配的子網(wǎng),可根據(jù)自己喜好設(shè)置

      Switch(Config-pool)#Default-router 192.168.1.254

      /*此處為設(shè)置上面分配子網(wǎng)IP的網(wǎng)關(guān),此處和下面要設(shè)置的vlan ip相關(guān)聯(lián),你想讓哪個vlan分配什么IP子網(wǎng)段

      就要把vlan的IP地址設(shè)成該子網(wǎng)的網(wǎng)關(guān)

      Switch(Config-pool)#lease 30

      /*租期為30天,可自己改

      Switch(Config-pool)#exit

      /*第二個地址池*/

      Switch(Config)#ip dhcp pool test02

      Switch(Config-pool)#network 192.168.2.0 255.255.255.0

      Switch(Config-pool)#Default-router 192.168.2.254

      Switch(Config-pool)#lease 30

      Switch(Config-pool)#exit

      /*同上

      /*第三個地址池*/

      Switch(Config)#ip dhcp pool test03

      Switch(Config-pool)#network 192.168.3.0 255.255.255.0

      Switch(Config-pool)#Default-router 192.168.3.254

      Switch(Config-pool)#lease 30

      Switch(Config-pool)#exit

      /*同上

      PS:Switch(Config-pool)#domain-name XXXX

      /*此命令是為客戶機(jī)配置域后綴,XX為域后綴~比如yonghu.com,這里不使用該命令

      Switch(Config-pool)#Dns-server x.x.x.x

      /*這是設(shè)置DNS服務(wù)器地址,我們在這里不使用該命令

      Switch(Config-pool)#netbios-name-server x.x.x.x

      /*為客戶機(jī)配置wins服務(wù)器地址,我們在這里不使用該命令

      Switch(Config-pool)#netbios-node-type h-node

      /*為客戶機(jī)配置h節(jié)點(diǎn)模式,我們在這里不使用該命令

      Switch(Config-pool)#ip dhcp pool XXX

      /*此命令為在當(dāng)前地址池下創(chuàng)建一個子地址池,這個子地址池將繼承域后綴、DNS服務(wù)器、

      wins服務(wù)器等可繼承的參數(shù) ,一個地址池可以設(shè)置多個子池,這樣可以減少很多麻煩,我們在這里不使用該命令

      2、設(shè)置DHCP保留不分配的地址 /*可以理解為設(shè)置不分配的IP地址,這里可以根據(jù)環(huán)境情況來設(shè)置,也可不設(shè)置,在此我只是舉例以說明命令作用*/

      Switch(Config)Ip Dhcp Excluded-address 192.168.1.2 192.168.1.10

      /* ip 192.168.1.2至192.168.1.10這9個IP地址服務(wù)器不分配出去

      Switch(Config)Ip Dhcp Excluded-address 192.168.2.2 192.168.2.10

      /*同上 192.168.2.2至192.168.2.10不分配

      Switch(Config)Ip Dhcp Excluded-address 192.168.3.2 192.168.3.10

      /*同上 192.168.3.2至192.168.3.10不分配

      PS:一般要把網(wǎng)關(guān)地址設(shè)成不分配~~比如我們剛才設(shè)的子網(wǎng)網(wǎng)關(guān)192.168.1.254

      3、設(shè)置連接端口IP

      Switch(Config)#fastEthernet 0/4

      Switch(Config-if)#switchport address 192.168.4.2 255.255.255.0

      Switch(Config-if)#no shutdown

      Switch(Config-if)#exit

      4、配置路由表

      Switch(Config)#ip route 192.168.1.0 255.255.255.0 192.168.4.1

      /*要送到192.168.1.0網(wǎng)段的數(shù)據(jù)發(fā)往192.168.4.1 ip地址

      Switch(Config)#ip route 192.168.2.0 255.255.255.0 192.168.4.1

      Switch(Config)#ip route 192.168.3.0 255.255.255.0 192.168.4.1

      Switch(Config)#ip route 192.168.4.0 255.255.255.0 192.168.4.1

      Switch(Config)#exit

      Switch#show ip route

      /*會看到路由表上已經(jīng)更新:

      PS:這里使用的時靜態(tài)路由~~但是本人推薦用動態(tài)路由~這里只是因為需要設(shè)置的IP段比較少所以才選用靜態(tài)路由設(shè)置

      但是一般情況下是不會選擇靜態(tài)路由的,特別是IP段特別多得時候,不然設(shè)置很麻煩~所以推薦使用動態(tài)路由!命令如下

      Switch(Config)#router rip

      Switch(Config-router)#network x.x.x.x /* x.x.x.x為地址段~~如192.168.1.0

      5、開啟DHCP服務(wù)

      Switch(Config)#Service Dhcp

      Switch(Config)#ip dhcp relay information option

      /*這個命令現(xiàn)在很少使用了,個人感覺可有可無,因為已經(jīng)

      設(shè)置helper-address了(下面的三層交換機(jī)里設(shè)置),但是保險起見打吧- -

      第二步:配置三層交換機(jī)3560

      1、創(chuàng)建VLAN:

      Switch>en

      Switch#configure terminal

      Switch(config)#vlan 2

      Switch(config-vlan)#vlan 3

      Switch(config-vlan)#exit

      2、設(shè)置vlan的IP 以及相關(guān)參數(shù)

      Switch(config)#interface vlan 1

      Switch(config-if)#ip add 192.168.1.254 255.255.255.0

      Switch(config-if)#ip helper-address 192.168.4.2

      Switch(config-if)#no shutdown

      Switch(config-if)#exit

      Switch(config)#interface vlan 2

      Switch(config-if)#ip add 192.168.2.254 255.255.255.0 //IP地址要和DHCP設(shè)置子網(wǎng)的網(wǎng)關(guān)一樣,

      Switch(config-if)#ip helper-address 192.168.4.2 否則PC無法獲取IP地址且無法通信

      Switch(config-if)#no shutdown

      Switch(config-if)#exit

      Switch(config)#interface vlan 3

      Switch(config-if)#ip address 192.168.3.254 255.255.255.0

      Switch(config-if)#ip helper-address 192.168.4.2 //此處為設(shè)置指定dhcp服務(wù)器的地址,

      Switch(config-if)#no shutdown 表示通過Ethernet0向該服務(wù)器發(fā)送DHCP請求包

      3、設(shè)置各個連接端口參數(shù)

      Switch(Config)#Interface fastEthernet 0/4

      Switch(Config)#switchport trunk encapsulation dot1q //二層交換機(jī)和三層不一樣,必須先設(shè)置數(shù)據(jù)封裝格式

      Switch(Config)#switchport mode trunk //對應(yīng)二層交換機(jī),形成trunk口實現(xiàn)多vlan通信

      Switch(Config)#Interface fastEthernet 0/1

      Switch(config-if)#no switchport //使端口開啟三層功能,可以理解為變成路由端口

      Switch(config-if)#ip address 192.168.4.1 255.255.255.0

      Switch(config-if)#no shutdown

      Switch(config-if)#exit

      Switch(config)#ip routing //開啟路由功能

      4、設(shè)置路由表

      Switch(Config)#router rip //進(jìn)入動態(tài)路由模式

      Switch(Config-router)#network 192.168.1.0 //自動學(xué)習(xí) 192.168.1.0網(wǎng)段地址

      Switch(Config-router)#network 192.168.2.0 //同上

      Switch(Config-router)#network 192.168.3.0

      Switch(Config-router)#network 192.168.4.0

      Switch(Config-router)#exit

      /*配置動態(tài)路由后,記得要在特權(quán)模式下查看路由表,確保要學(xué)的IP地址都已學(xué)到

      第三步:配置二層交換機(jī)2950

      1、創(chuàng)建VLAN:

      Switch1>en

      Switch1#configure terminal

      Switch1(config)#vlan 2

      Switch1(config-vlan)#vlan 3

      Switch1(config-vlan)#exit

      2、設(shè)置端口全局參數(shù)

      Switch1(Config)#Interface Range fastEthernet 0/1 - 3

      /*注意:哪些端口連接PC就設(shè)置哪個端口,如果設(shè)置的端口是連接交換機(jī)或者路由的就有可能造成環(huán)路

      Switch1(Config-if-range)#switchport mode access

      /*此處把端口設(shè)成為portfast模式~即不在不再使用STP的算法,也就是說端口從堵塞直接變?yōu)檗D(zhuǎn)發(fā)

      3、將端口添加到VLAN2,3中(PS:所有端口默認(rèn)VLAN1~~這個都知道吧~~)

      Switch1(Config)#interface fastethernet 0/2

      Switch1(Config)#switchport access Vlan 2

      Switch1(Config)interface fastethernet 0/3

      Switch1(Config-if-range)#switchport access vlan 3

      4、將F0/4端口設(shè)成trunk模式

      Switch1(Config)#interface fastethernet 0/4

      Switch1(Config)#switchport mode trunk

      第四步:設(shè)置PC機(jī)

      1、 這步很簡單只要吧PC 設(shè)成自動獲取IP就好,如下圖

      2、更新DHCP

      打開開始菜單>運(yùn)行>輸入CMD然后回車,出現(xiàn)命令窗口>輸入ipconfig/renew,然后你就可以看到服務(wù)器分給這臺PC的ip地址了:

      PS:到這里就結(jié)束了~~本章講得是用路由做DHCP~但其實只要有三層交換機(jī)就可以了~~不需要用路由~~在三層交換機(jī)做DHCP中繼和在路由上配置命令是一樣的

      學(xué)習(xí)啦小編分享了cisco dhcp服務(wù)器設(shè)置的解決方法,希望大家喜歡。

    567015