Cắm dây cho đúng port và đặt hostname các thiết bị như hình vẽ.. Router#configure terminal2[r]
(1)DHCP
A DHCP
1 Cắm dây cho port đặt hostname thiết bị hình vẽ Router#configure terminal
Router(config)#hostname R1
2 Đặt IP thích hợp cho interface Router PC R1#configure terminal
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0 R1(config-if)#no shutdown
3 Cấu hình tránh trơi theo trỏ chuột thông báo R1#configure terminal
R1(config)#line console
R1(config-line)#logging synchronous Tắt chế độ phân giải tên miền (domain-lookup)
R1#configure terminal
R1(config)#no ip domain-lookup
5 Cài đặt DHCP R1 để cấp IP cho máy tính Dãy IP: 192.168.1.0 /24
Default Gateway: 192.168.1.1 DNS: 8.8.8.8 8.8.4.4 Domain name: vnpro.org
Dãy IP dành riêng, không cấp cho máy tính: 192.168.1.2 192.168.1.10 Thời hạn sử dụng IP ngày 20 phút
R1(config)#service dhcp
R1(config)#ip dhcp pool Mang_192.168.1.0
R1(dhcp-config)#network 192.168.1.0 255.255.255.0 R1(dhcp-config)#default-router 192.168.1.1
R1(dhcp-config)#dns-server 8.8.8.8 8.8.4.4 R1(dhcp-config)#domain-name vnpro.org R1(dhcp-config)#lease 20
R1(dhcp-config)#exit
(2)6 Kiểm tra lại thông tin IP cấp
B.DHCP Relay Agent:
1 R2 có IP 2.2.2.2 mở Cấu hình để R1 truy cập đến IP 2.2.2.2 R2# configure terminal
R2(config)#interface loopback
R2(config-if)#ip address 2.2.2.2 255.255.255.0 R2(config-if)#exit
R2(config)#interface fa0/0
R2(config-if)#ip add 192.168.12.2 255.255.255.0 R2(config-if)#no shutdown
R1#configure terminal R1(config)#interface fa0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0 R1(config-if)#no shutdown
R1(config)#interface fa0/1
R1(config-if)#ip address 192.168.1.1 255.255.255.0 R1(config-if)#no shutdown
(3)R1(config)#router rip
R1(config-router)#version
R1(config-router)#network 192.168.1.0 R1(config-router)#network 192.168.12.0 R2(config)#router rip
R2(config-router)#version
R2(config-router)#network 192.168.12.0 R2(config-router)#network 2.0.0.0 R1#show ip route
……… Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, FastEthernet0/0 R 2.0.0.0/8 [120/1] via 192.168.12.2, 00:00:11, FastEthernet0/0 C 192.168.1.0/24 is directly connected, FastEthernet0/1
R1#ping 2.2.2.2
Type escape sequence to abort
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is seconds: !!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/36/60 ms Cấu hình để R2 cấp IP cho máy tính bên cổng Fa0/1 R1
R2(config)#service dhcp
R2(config)#ip dhcp pool Cap_IP_cho_mang_cua_R1 R2(dhcp-config)#network 192.168.1.0 /24
R2(dhcp-config)#default-router 192.168.1.1 255.255.255.0 R2(dhcp-config)#dns-server 203.162.4.190 203.162.4.191 R1(config)#interface fa0/1
R1(config-if)#ip helper-address 2.2.2.2 Kiểm tra, chụp bắt gói tin DHCP
R1#debug ip dhcp server packet R1#
*Mar 00:15:14.583: DHCPD: Finding a relay for client c808.0420.0000 on interface FastEthernet0/1
*Mar 00:15:14.583: DHCPD: setting giaddr to 192.168.1.1
*Mar 00:15:14.587: DHCPD: BOOTREQUEST from c808.0420.0000 forwarded to 2.2.2.2 *Mar 00:15:17.731: DHCPD: forwarding BOOTREPLY to client c808.0420.0000
*Mar 00:15:17.731: DHCPD: creating ARP entry (192.168.1.2, c808.0420.0000)
*Mar 00:15:17.731: DHCPD: unicasting BOOTREPLY to client c808.0420.0000 (192.168.1.2) R1#
*Mar 00:15:19.747: DHCPD: forwarding BOOTREPLY to client c808.0420.0001 *Mar 00:15:19.747: DHCPD: creating ARP entry (192.168.1.3, c808.0420.0001)