1.R1配置OSPF
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
2.R2配置OSPF
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
3.R2配置DHCP方法一:基于地址池方式
[R2]dhcp enable
[R2]ip pool dsrw
[R2-ip-pool-dsrw]network 192.168.1.0 mask 255.255.255.0
[R2-ip-pool-dsrw]gateway-list 192.168.1.254
[R2-ip-pool-dsrw]dns-list 114.114.114.114 8.8.8.8
[R2-ip-pool-dsrw]domain-name dsrw.com
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]dhcp select global
4.R2配置DHCP方法二:基于接口方式
[R2]dhcp enable
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]dhcp select interface
[R2-GigabitEthernet0/0/1]dhcp server dns-list 114.114.114.114 8.8.8.8
[R2-GigabitEthernet0/0/1]dhcp server domain-name dsrw.com
5.PC1设置自动获取IP地址,查看获取IP地址。
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fed9:1a54
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.254
Physical address..................: 54-89-98-D9-1A-54
DNS server........................: 114.114.114.114
8.8.8.8
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容