0% found this document useful (0 votes)
2 views

NEES Lab06 Routing

The document outlines the steps to add static routes for a network configuration involving two subnets, 192.168.10.0 and 172.16.10.0, using Docker containers. It provides specific commands to be executed on different machines and routers to establish connectivity between the two networks, culminating in a successful ping test. The setup includes using tcpdump to capture packets and verify the routing configuration.

Uploaded by

giahanthcstmt
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

NEES Lab06 Routing

The document outlines the steps to add static routes for a network configuration involving two subnets, 192.168.10.0 and 172.16.10.0, using Docker containers. It provides specific commands to be executed on different machines and routers to establish connectivity between the two networks, culminating in a successful ping test. The setup includes using tcpdump to capture packets and verify the routing configuration.

Uploaded by

giahanthcstmt
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Fullname: Huỳnh Gia Hân

Student ID: 23110019


LAB #06: ROUTING

Đề:

Router hiện ko có đường đi từ 192… sang 172…nhiệm vụ là add đường đi tĩnh cho bảng định
tuyến, sao cho đi được từ mạng 192 sang 172

Cú pháp gợi ý là ip route add

Cuối cùng là máy 192.168.10.10 ping gói tin được sang 172.10.10.10 kia là hoàn thành.

Setup môi trường:


- Mở docker -> run
- cd Networking-Essentials\Routing
- thiết lập các container: docker compose up -d
- attach từng máy (4 terminal) cd -> docker exec:
+ docker exec -it host-192.168.10.10
+ docker exec -it router-r1 sh -l
+...
Setup cụ thể:
Trên máy 192.168.10.10: ip route add 172.16.10.0/24 via 192.168.10.100

Trên router r1: ip route add 172.16.10.0/24 via 10.5.6.100

Trên router r2: ip route add 192.168.10.0/24 via 10.5.6.10

Trên máy 172.16.10.10: ip route add 192.168.10.0/24 via 172.16.10.100

Sau khi cấu hình, kiểm tra bằng các lệnh sau theo thứ tự:
1. Trên máy 172.16.10.10: tcpdump -i eth0 icmp and host 192.168.10.10 -c 4 -w capt
ure.pcap
-> xong lệnh để bắt đầu chờ (ví dụ bắt 4 gói)
2. Trên máy 192.168.10.10: mới bắt đầu ping 172.16.10.10
-> chờ một chút rồi Ctrl + C

=> Qua máy 172.16.10.10 thì thấy đã bắt được 4 gói, rồi làm ngược lại

host-192.168.10.10

Microsoft Windows [Version 10.0.26100.3476]

(c) Microsoft Corporation. All rights reserved.

C:\Users\huynh>cd Networking-Essentials\Routing

C:\Users\huynh\Networking-Essentials\Routing>docker compose up -d

time="2025-03-20T08:27:18+07:00" level=warning msg="C:\\Users\\huynh\\


Networking-Essentials\\Routing\\docker-compose.yml: the attribute `version` is obsolete,
it will be ignored, please remove it to avoid potential confusion"
time="2025-03-20T08:27:18+07:00" level=warning msg="a network with name net-
172.16.10.0 exists but was not created for project \"routing\".\nSet `external: true` to use
an existing network"

[+] Running 4/4

✔ Container host-172.16.10.10 Started


0.4s

✔ Container router-r1 Started 1.1s

✔ Container router-r2 Started 1.1s

✔ Container host-192.168.10.10 Started


0.8s

C:\Users\huynh\Networking-Essentials\Routing>docker exec -it host-192.168.10.10

sh -l

72e04b3f42a7:/# route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 192.168.10.1 0.0.0.0 UG 0 0 0 eth0

72e04b3f42a7:/# ping 172.16.10.10

PING 172.16.10.10 (172.16.10.10): 56 data bytes

^C

--- 172.16.10.10 ping statistics ---

154 packets transmitted, 0 packets received, 100% packet loss

72e04b3f42a7:/# ip route add 172.16.10.0/24 via 192.168.10.100

72e04b3f42a7:/# ping 172.16.10.10

PING 172.16.10.10 (172.16.10.10): 56 data bytes


64 bytes from 172.16.10.10: seq=0 ttl=62 time=0.440 ms

64 bytes from 172.16.10.10: seq=1 ttl=62 time=0.144 ms

64 bytes from 172.16.10.10: seq=2 ttl=62 time=0.128 ms

64 bytes from 172.16.10.10: seq=3 ttl=62 time=0.164 ms

64 bytes from 172.16.10.10: seq=4 ttl=62 time=0.188 ms

64 bytes from 172.16.10.10: seq=5 ttl=62 time=0.142 ms

^C

--- 172.16.10.10 ping statistics ---

6 packets transmitted, 6 packets received, 0% packet loss

round-trip min/avg/max = 0.128/0.201/0.440 ms

72e04b3f42a7:/#

host-172.16.10.10

Windows PowerShell

Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements!


https://aka.ms/PSWindows

PS C:\Users\huynh> cd Networking-Essentials\Routing

PS C:\Users\huynh\Networking-Essentials\Routing> docker exec -it host-172.16.10.10 sh


-l

a672288ea50f:/# route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 172.16.10.1 0.0.0.0 UG 0 0 0 eth0


172.16.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

a672288ea50f:/# ip route add 192.168.10.0/24 via 172.16.10.100

a672288ea50f:/# tcpdump -i eth0 icmp and host 192.168.10.10 -c 4 -w capt

ure.pcap

tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes

4 packets captured

4 packets received by filter

0 packets dropped by kernel

a672288ea50f:/#

Router-r1

Windows PowerShell

Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements!


https://aka.ms/PSWindows

PS C:\Users\huynh> cd Networking-Essentials\Routing

PS C:\Users\huynh\Networking-Essentials\Routing> docker exec -it router-r1 sh -l

eefbbf4343e5:/# route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 10.5.6.1 0.0.0.0 UG 0 0 0 eth0

10.5.6.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0


192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

eefbbf4343e5:/# ip route add 172.16.10.0/24 via 10.5.6.100

eefbbf4343e5:/# route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 10.5.6.1 0.0.0.0 UG 0 0 0 eth0

10.5.6.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

172.16.10.0 10.5.6.100 255.255.255.0 UG 0 0 0 eth0

192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

eefbbf4343e5:/#

Router-r2

Windows PowerShell

Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements!


https://aka.ms/PSWindows

PS C:\Users\huynh> cd Networking-Essentials\Routing

PS C:\Users\huynh\Networking-Essentials\Routing> docker exec -it router-r2 sh -l

ca566ad8ce52:/# route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 10.5.6.1 0.0.0.0 UG 0 0 0 eth0

10.5.6.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0


172.16.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

ca566ad8ce52:/# ip route add 192.168.10.0/24 via 10.5.6.10

ca566ad8ce52:/# route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 10.5.6.1 0.0.0.0 UG 0 0 0 eth0

10.5.6.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

172.16.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

192.168.10.0 10.5.6.10 255.255.255.0 UG 0 0 0 eth0

ca566ad8ce52:/#

You might also like