标签:实验环境 sha 步骤 net jpg abi 接口 table lob
DHCP的作用:用于实现企业用户IP地址动态分配和集中管理,避免繁琐的手工配置,快速适应网络的变化。[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0]un shutdown
[R1-GigabitEthernet0/0/0]dhcp select global
配置池子2
配置2.0网段
配置网关2.254
配置DNS 3.3.3.3
配置租期 3
进入接口0/0/1设置为192.168.2.254 掩码24 接口激活:un shudown
[R1]ip pool 2
[R1-ip-pool-2]network 192.168.2.0 mask 255.255.255.0
[R1-ip-pool-2]gateway-list 192.168.2.254
[R1-ip-pool-2]dns-list 3.3.3.3
[R1-ip-pool-2]lease day 3
[R1]interface g0/0/1
[R1-GigabiEthert0/0/1]ip add 192.168.2.1 24
[R1-GigabiEthert0/0/1]un shutdown
[R1-GigabiEthert0/0/1]dncp select global
实验结果证明1:pc4不设IP地址可以通过R1路由器的DHCP设置自动获得IP地址如下图:下面继续对R3路由器中继的设置:下面将R3路由器设置为中继:
[R3]dhcp enable
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]dhcp select relay
[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]dhcp relay server-ip 192.168.2.1
[R3-GigabitEthernet0/0/0]ip address 192.168.3.2 24
[R3-GigabitEthernet0/0/0]un shutdown
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.4.254 24
[R3-GigabitEthernet0/0/1]undo shutdown
[R3]display current-configuration 查看一下配置
[R3]IP route-static 192.168.2.0 24 192.168.3.1
[R3] ip route-static 192.168.1.0 24 192.168.3.1
R3中继已经配置完成,下面对R2路由器进行配置
[R2]dhcp enable
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.2.24
[R2-GigabitEthernet0/0/0]undo shutdown
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.3.1 24
[R2-GigabitEthernet0/0/1]undo shu down
[R2]display current-configurtion
下面设置下一跳:
[R2]IP route-static 192.168.4.0 24 192.168.3.2
[R2] IP route-static 192.168.1.0 24 192.168.2.1
[R2]display ip routing-table
下面进行对R1路由器的吓一跳配置
[R1]ip route-static 192.168.3.0 24 192.168.2.2
[R1]ip route-static 192.168.4.0 24 192.168.2.2
下面将两台pc机的基础配置IPv4配置静态改成DHCP然后在命令行模式中输入:ipconfig 重新获取IP地址
实验结果证明两台PC机通过DHCP技术,以及交换机中继技术和吓一跳技术,可以实现全网互通。如下图:如果步骤都对,由于路比较远要多Pingl两次才能ping通。
标签:实验环境 sha 步骤 net jpg abi 接口 table lob
原文地址:http://blog.51cto.com/13935936/2174957