Cisco設備;靜態路由;DHCP的基礎配置

靜態路由配置:

blob.png


配置思路以及步驟:

    1、配置主機 PC-1 的 IP地址與網關IP地址;

blob.png

 2、配置路由器 R1 的 互聯端口 IP 地址;

blob.png


 3、配置主機 PC-2 的 IP地址與網關IP地址;

blob.png


  4、配置路由器 R2 的 互聯端口 IP 地址;

blob.png

5、在 R1 配置去往 192.168.20.0 /24的路由;

R1(config)# ip route 192.168.20.0 255.255.255.0 192.168.12.2

    6、在 R2 配置去往 192.168.10.0 /24的路由;

R2(config)# ip route 192.168.10.0 255.255.255.0 192.168.12.1

    7、驗證與 測試 :

        路由條目驗證,

           R1#show ip route //查看 R1 的路由表;

blob.png

 R2#show ip route //查看 R2 的路由表;

blob.png

PC-1與PC-2之間進行互相 ping 通測試;

          PC-1> ping 192.168.20.1

          PC-2> ping 192.168.10.1     

blob.png

實驗結果 :終端主機互相Ping通;



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

DHCP配置實驗:

Router 作爲 DHCP 服務器:

blob.png

1、配置 Router 地址:

    Router(config)#hostname GateWay

    GateWay(config)#interface gi0/0

    GateWay(config-if)# no shutdown

    GateWay(config-if)# ip address 192.168.1.1 255.255.255.0

blob.png

blob.png

blob.png

4、配置 DHCP 客戶端 :

     點擊 - ”DHCP“ ;

blob.png

5、驗證命令:

       在服務器端的驗證命令:

                   GateWay# show ip dhcp binding

blob.png


 GateWay# show running-config

       在客戶端的驗證:

                    運行--> cmd ---> ipconfig /all       


blob.png



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

Switch 作爲 DHCP 服務器:

1、配置交換機的IP地址;

  Switch(config)# interface vlan 1

  Switch(config-if)# no shutdown

  Switch(config-if)# ip address 192.168.1.250 255.255.255.0    

blob.png

2、啓動 DHCP 服務 :

  Switch(config)# service dhcp

3、配置 DHCP 的排除地址:

  Switch(config)# ip dhcp excluded-address 192.168.1.1  192.168.1.99  

                                          

4、配置 DHCP 地址池 :

   Switch(config)# ip dhcp pool CCNP

    Switch(dhcp-config)# network 192.168.1.0 255.255.255.0

    Switch(dhcp-config)# default-router 192.168.1.1

    Switch(dhcp-config)# dns-server  8.8.6.6

blob.png

5、配置 DHCP 客戶端 ;

6、驗證:

Switch#show ip interface brief  // 查看交換機接口IP地址配置;

Switch#show running-config     //查看 DHCP 的相關配置命令;

Switch#show ip dhcp binding //查看DHCP服務器分配成功的IP地址

  

    在 PC 上 :

     ipconfig /all   // 在 PC 的命令行中查看自動獲取的IP地址

blob.png





blob.png















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