Notes - Computer Network
  • 計算機網路
  • 期中
    • 20200916 Introduction
    • 20200923 Introduction Routing
    • 20200930 Introduction Router Setting
    • 20201007 Introduction DHCP
    • 20201014 Introduction IPV6
    • 20201021 cisco RIP
    • 20201104 cisco EIGRP (一)
    • 20201111 期中週
  • 期末
    • 20201118 cisco EIGRP (二)
    • 20201125 cisco EIGRP (三)
    • 20201202 cisco KDLinux
    • 20201209 cisco VRF & OSPF
    • 20201216 cisco VLAN
    • 20201223 cisco 單臂路由
    • 20201230 cisco STP
    • 20210106 cisco GRE
  • 參考資料
Powered by GitBook
On this page
  • 課堂練習
  • Part 01.
  • Part 02. Ping IP Address
  • Part 03. Setting DHCP
  • Part 04.

Was this helpful?

  1. 期中

20201007 Introduction DHCP

Previous20200930 Introduction Router SettingNext20201014 Introduction IPV6

Last updated 4 years ago

Was this helpful?

課堂練習

Part 01.

conf t
hostname R1
do writ
int s1/0
ip addr 12.1.1.1 255.255.255.252
no shut
clock rate 64000
conf t
hostname R2
do writ
int s1/0
ip addr 12.1.1.2 255.255.255.252
no shut
clock rate 64000
do sh ip int brief
exit
int lo 0
ip addr 1.1.1.1 255.255.255.255
int lo 0
do sh ip int brief
int lo 0
ip addr 2.2.2.2 255.255.255.255
no shut
do sh ip int brief
exit
do sh ip ro
do sh ip ro 12.1.1.2
ip route 2.2.2.0 255.255.255.0 ?
ip route 2.2.2.0 255.255.255.0 s1/0 12.1.1.2
do sh ip ro
do sh ip ro 2.2.2.2
do ping 2.2.2.2
do ping 2.2.2.2 source 1.1.1.1
do sh ip ro 12.1.1.1
ip route 1.1.1.0 255.255.255.0 ?
ip route 1.1.1.0 255.255.255.0 s1/0 12.1.1.1
do sh ip ro
do sh ip ro 1.1.1.1
do ping 1.1.1.1
do ping 1.1.1.1 source 2.2.2.2

Part 02. Ping IP Address

hostname R3
do writ
int e0/0
ip addr 192.168.1.1 255.255.255.0
no shut
exit
int lo 0
ip addr 3.3.3.3 255.255.255.255
no shut
do sh ip int brief
exit
ip route 4.4.4.0 255.255.255.0 192.168.1.2
do sh ip ro
do sh ip ro 4.4.4.4
do ping 4.4.4.4
hostname R4
do writ
int e0/0
ip addr 192.168.1.2 255.255.255.0
no shut
exit
int lo 0
ip addr 4.4.4.4 255.255.255.255
no shut
do sh ip int brief
exit
ip route 5.5.5.0 255.255.255.0 192.168.1.3
do sh ip ro
do sh ip ro 5.5.5.5
do ping 5.5.5.5
hostname R5
do wirt
int e0/0
ip addr 192.168.1.3 255.255.255.0
no shut
exit
int lo 0
ip addr 5.5.5.5 255.255.255.255
no shut
do sh ip int brief
exit
ip route 3.3.3.0 255.255.255.0 192.168.1.1
do sh ip ro
do sh ip ro 3.3.3.3
do ping 3.3.3.3

Part 03. Setting DHCP

hostname R1
do writ
int e0/0
ip addr 12.1.1.1 255.255.255.0
no shut
int e0/1
ip addr 192.168.1.1 255.255.255.0
no shut
exit
ip dhcp pool DHCP
network 192.168.1.0 /24
default-router 192.168.1.1
dns-server 8.8.8.8
ip route 23.1.1.0 255.255.255.0 e0/0 12.1.1.2
ip route 192.168.2.0 255.255.255.0 e0/0 12.1.1.2
hostname R3
do writ
int e0/0
ip addr 23.1.1.3 255.255.255.0
no shut
int e0/1
ip addr 192.168.2.1 255.255.255.0
no shut
exit
ip dhcp pool DHCP2
network 192.168.2.0 /24
default-router 192.168.2.1
dns-server 8.8.8.8
ip route 192.168.1.0 255.255.255.0 e0/0 23.1.1.2
hostname R2
do writ
int e0/0
ip addr 12.1.1.2 255.255.255.0
no shut
int e0/1
ip addr 23.1.1.2 255.255.255.0
no shut
ip route 192.168.1.0 255.255.255.0 e0/0 12.1.1.1
ip route 192.168.2.0 255.255.255.0 e0/0 23.1.1.3
ip route 192.168.2.0 255.255.255.0 e0/1 23.1.1.3
ip dhcp
sh ip
ping 192.168.1.1

設定完 R3 和 R2 的 IP 後:

ping 12.1.1.1
ping 12.1.1.2

將 R2 設置 router 後重 ping 12.1.1.2:

ping 12.1.1.2
ping 23.1.1.2
ping 23.1.1.3
ping 192.168.2.1

R3 重設後:

ping 192.168.2.1

R2重設後:

ping 192.168.2.2
ip dhcp
sh ip
ping 192.168.2.1

Part 04.

hostname R1
do writ
int e0/0
ip addr 12.1.1.1 255.255.255.0
no shut
ip route 0.0.0.0 0.0.0.0 e0/0 12.1.1.2
do sh ip ro
do ping 3.3.3.3
do sh ip static ro
hostname R2
do writ
int e0/0
ip addr 12.1.1.2 255.255.255.0
no shut
int lo 0
ip addr 2.2.2.2 255.255.255.255
int lo 1
ip addr 3.3.3.3 255.255.255.255