一夏志、給路由器安裝上模塊
路由器0害碾、1喻括、2都接上模塊TX
二楞泼、端口IP配置
路由器2:
Router>enable
Router#configure terminal
Enter configuration commands, one per line.? End with CNTL/Z.
Router(config)#interface fa0/1
Router(config-if)#ip address 172.16.10.254 255.255.255.0
Router(config-if)#no shut
路由器1:
Router>enable
Router#configure terminal
Enter configuration commands, one per line.? End with CNTL/Z.
Router(config)#interface fa0/0
Router(config-if)#ip addr 192.168.10.254 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#interface fa0/1
Router(config-if)#ip addr 172.16.10.253 255.255.255.0
Router(config-if)#no shut
路由器0:
Router>enable
Router#config t
Enter configuration commands, one per line.? End with CNTL/Z.
Router(config)#interface fa0/0
Router(config-if)#ip address dhcp(打開dhcp端口)
Router(config-if)#no shut
此時端口綠了
三炮捧、配置dhcp服務(wù)器
Router(config)#ip dhcp pool pool1(地址池取名為pool1)
Router(dhcp-config)#network 192.168.10.0 255.255.255.0(給192.168.10.1地址段分配IP)
Router(dhcp-config)#default-router 192.168.10.254(網(wǎng)關(guān))
Router(dhcp-config)#dns-server 10.10.10.1(dns服務(wù)器隨便設(shè)一個)
Router(config)#ip dhcp excluded-address 192.168.10.250 192.168.10.254(10.250-254網(wǎng)段不分配IP)
四庶诡、配置dhcp助手
路由器1:
Router>enable
Router#configure terminal
Router(config)#interface fa0/0
Router(config-if)#ip helper-address 172.16.10.254(路由器1的0/0對應(yīng)dhcp服務(wù)器的IP地址)
Router(config-if)#exit
Router(config)#ip forward-protocol udp(用udp協(xié)議轉(zhuǎn)發(fā))
五、給路由器設(shè)置下一跳
路由器2:
Router(config)#ip route 192.168.10.0 255.255.255.0 172.16.10.253
路由器0:
Router(config)#ip route 172.16.10.0 255.255.255.0 192.168.10.254
六咆课、查看是否可以自動獲取到IP地址
路由器0:
Router#show ip interface brief
查看獲取到了IP地址為192.168.10.4