Cisco设备;静态路由;DHCP的基础配置

静态路由配置:服务器

blob.png


配置思路以及步骤:ide

    一、配置主机 PC-1 的 IP地址与网关IP地址;测试

blob.png

 二、配置路由器 R1 的 互联端口 IP 地址;spa

blob.png


 三、配置主机 PC-2 的 IP地址与网关IP地址;命令行

blob.png


  四、配置路由器 R2 的 互联端口 IP 地址;router

blob.png

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

R1(config)# ip route 192.168.20.0 255.255.255.0 192.168.12.2dns

    六、在 R2 配置去往 192.168.10.0 /24的路由;接口

R2(config)# ip route 192.168.10.0 255.255.255.0 192.168.12.1ip

    七、验证与 测试 :

        路由条目验证,

           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

一、配置 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

四、配置 DHCP 客户端 :

     点击 - ”DHCP“ ;

blob.png

五、验证命令:

       在服务器端的验证命令:

                   GateWay# show ip dhcp binding

blob.png


 GateWay# show running-config

       在客户端的验证:

                    运行--> cmd ---> ipconfig /all       


blob.png



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

Switch 做为 DHCP 服务器:

一、配置交换机的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

二、启动 DHCP 服务 :

  Switch(config)# service dhcp

三、配置 DHCP 的排除地址:

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

                                          

四、配置 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

五、配置 DHCP 客户端 ;

六、验证:

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

相关文章
相关标签/搜索