20201111 期中週

第一題

Static Routing
R1
R2
R3
R4
VPC1
VPC2
int e0/0
ip add 12.1.1.1 255.255.255.0
no shut
int e0/1
ip add 45.1.1.1 255.255.255.0
no shut
int e0/2
ip add 192.168.1.1 255.255.255.0
no shut
exit
ip route 192.168.2.0 255.255.255.0 e0/0 12.1.1.2
ip route 192.168.2.0 255.255.255.0 e0/1 45.1.1.3 10
int e0/0
ip add 12.1.1.2 255.255.255.0
no shut
int e0/1
ip add 23.1.1.2 255.255.255.0
no shut
int e0/2
ip add 192.168.2.1 255.255.255.0
no shut
exit
ip route 192.168.1.0 255.255.255.0 e0/0 12.1.1.1 10
ip route 192.168.1.0 255.255.255.0 e0/1 23.1.1.4
int e0/0
ip add 34.1.1.3 255.255.255.0
no shut
int e0/1
ip add 45.1.1.3 255.255.255.0
no shut
exit
ip route 192.168.1.0 255.255.255.0 e0/1 45.1.1.1
int e0/0
ip add 34.1.1.4 255.255.255.0
no shut
int e0/1
ip add 23.1.1.4 255.255.255.0
no shut
exit
ip route 192.168.1.0 255.255.255.0 e0/0 34.1.1.3
ip 192.168.1.2 255.255.0.0
ping 192.168.2.2
ip 192.168.2.2 255.255.0.0
ping 192.168.1.2

結果

  • H1-->H2
  • H2-->H1

第二題

讓 h1、h2 透過 DHCP Server取得 IP 和相關資訊,h1 可 Ping h2
R1
R2
VPC1
VPC2
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
int e0/0
ip addr 12.1.1.2 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 dhcp
ping 192.168.2.2
ip dhcp
ping 192.168.1.2

結果

第三題

分別使用 RIP 和 EIGRP 讓 192.168.1.1 可 Ping 192.168.2.1

RIP

R1
R2
R3
int e0/0
ip add 12.1.1.1 255.255.255.0
no shut
int lo 0
ip add 192.168.1.1 255.255.255.0
no shut
exit
router rip
ver 2
no auto-summary
network 12.1.1.0
network 23.1.1.0
network 192.168.1.0
do sh run
do ping 192.168.2.1
int e0/0
ip add 12.1.1.2 255.255.255.0
no shut
int e0/1
ip add 23.1.1.2 255.255.255.0
no shut
exit
router rip
ver 2
no auto-summary
network 12.1.1.0
network 23.1.1.0
do sh run
int e0/0
ip add 23.1.1.3 255.255.255.0
no shut
int lo 0
ip add 192.168.2.1 255.255.255.0
no shut
exit
router rip
ver 2
no auto-summary
network 12.1.1.0
network 23.1.1.0
network 192.168.2.0
do sh run

EIGRP

R1
R2
R3

IP

int e0/0
ip addr 12.1.1.1 255.255.255.0
no shut
int lo 0
ip add 192.168.1.1 255.255.255.0
no shut
exit

router

router eigrp 1
auto-summary
network 12.1.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
do sh ip ro eigrp

IP

int e0/0
ip add 12.1.1.2 255.255.255.0
no shut
int e0/1
ip add 23.1.1.2 255.255.255.0
no shut
exit

router

router eigrp 1
auto-summary
network 12.1.1.0 0.0.0.255
network 23.1.1.0 0.0.0.255
do sh ip ro eigrp

IP

int e0/0
ip add 23.1.1.3 255.255.255.0
no shut
int lo 0
ip add 192.168.2.1 255.255.255.0
no shut
exit

router

router eigrp 1
auto-summary
network 23.1.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
do sh ip ro eigrp

結果

RIP
EIGRP

第四題

使用浮動路由,讓 R1 和 R2 斷線後:h1 --> R1 --> R3 --> R2 --> h2

R1
R2
R3
VPC1
VPC2
int e0/0
ip add 12.1.1.1 255.255.255.0
no shut
int e0/1
ip add 34.1.1.1 255.255.255.0
no shut
int e0/2
ip add 192.168.1.1 255.255.255.0
no shut
exit
ip route 192.168.2.0 255.255.255.0 e0/0 12.1.1.2
ip route 192.168.2.0 255.255.255.0 e0/1 34.1.1.3 10
int e0/0
ip add 12.1.1.2 255.255.255.0
no shut
int e0/1
ip add 23.1.1.2 255.255.255.0
no shut
int e0/2
ip add 192.168.2.1 255.255.255.0
no shut
exit
ip route 192.168.1.0 255.255.255.0 e0/0 12.1.1.1
ip route 192.168.1.0 255.255.255.0 e0/1 23.1.1.2 10
int e0/0
ip add 34.1.1.3 255.255.255.0
no shut
int e0/1
ip add 23.1.1.3 255.255.255.0
no shut
exit
ip route 192.168.1.0 255.255.255.0 e0/1 34.1.1.1
ip route 192.168.2.0 255.255.255.0 e0/1 23.1.1.2
ip 192.168.1.2 255.255.0.0
ip 192.168.1.2 255.255.255.0 192.168.1.1
ping 192.168.2.2
ip 192.168.2.2 255.255.0.0
ip 192.168.2.2 255.255.255.0 192.168.2.1
ping 192.168.1.2

結果