交換機 DHCP 協議與配置


DHCP

   dynamic host configuration protocol 

   動態的 主機配置協議

   靜態的

   

              -配置內容

          IP  

    -作用

   自動的爲終端設備,分配IP地址;

    -角色

        DHCP 服務器

DHCP 客戶端


    -配置:

   1、配置DHCP客戶端

     -將網關的IP地址獲取方式配置爲:DHCP

2、配置DHCP服務器

    Server-PC:

     -配置服務器的IP地址: 192.168.1.100/24

 -開啓DHCP服務 : server -> dhcp -> on 

 -配置DHCP的 IP 地址池:

     pool name : serverPool

 start ip  : 192.168.1.0

             255.255.255.0

 -保存地址池 : save ;

           

             Router:

                -配置IP地址:

                      interface fas0/1

                        no shutdown

                        ip address 192.168.1.100 /24

                -開啓DHCP服務 

                      Router(config)#service dhcp 

                -配置 DHCP 地址池 

                      Router(config)# ip dhcp pool Linux

                      Router(dhcp-config)#network 192.168.1.0 255.255.255.0

                      Router(dhcp-config)#default-router 192.168.1.100

                      Router(dhcp-config)#dns-server 8.8.8.8  

3、驗證與測試

    Router#show ip dhcp binding //查看的是已經分配出去

                              的IP地址;

 

             PC>ipconfig   //驗證獲得的IP地址;

PC>

   ping x.x.x.x 

-------------------------------------------------

DHCP 地址排除:

       這些地址,是不會被 DHCP 服務器自動的分配給

   DHCP 客戶端的。

    配置命令:

Router(config)# 

   ip dhcp excluded-addres 192.168.1.1 192.168.1.10

             //排除一段連續的IP地址;

    ip dhcp excluded-addres 192.168.1.29 

             //排除不連續的單個地址;


=====================================================


VLAN間路由:

  -多層交換機

   1、配置網關IP

        interface vlan 10   //配置 vlan 10 的網關IP;

  no shutdown 

  ip address 192.168.10.254 255.255.255.0

interface vlan 20 

  no shutdown 

  ip address 192.168.20.254 255.255.255.0

interface vlan 30 

  no shutdown 

  ip address 192.168.30.254 255.255.255.0

   2、啓用路由功能

        GW(config)# ip routing 

        

   3、配置多層交換機與普通交換機的級聯鏈路 

       GW(config)#interface fas0/3 

  GW(config-if)#switchport trunk encap dot1q

  GW(config-if)#switchport mode trunk 

  

  SW1(config)#interface fas0/3 

  SW1(config-if)#switchport mode trunk 


    4、驗證與測試

   GW# show ip interface brief

GW# show ip route 

GW# show interface trunk 


注意:

    任何一個 VLAN 都對應一個 SVI(交換虛擬端口);

該VLAN中的所有的成員主機的網關IP地址都爲該 SVI 

口配置的 IP 地址;


SVI:switch virtual interface ;


====================================================



動態路由協議 

    -路由類型

   C

非C 

   Static

Dynamic

  IGP(internal gateway protocol)

        Distance Vector

     -RIP

 -IGRP

 -EGIRP

    Links State

                          -ISIS

                          -OSPF(open shortest path first)  

  EGP(external gateway protocol)

             -BGP

  


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章