• Aucun résultat trouvé

© Computer Networks Research Group Roma Tre

N/A
N/A
Protected

Academic year: 2022

Partager "© Computer Networks Research Group Roma Tre"

Copied!
20
0
0

Texte intégral

(1)

Università degli Studi Roma Tre

Dipartimento di Informatica e Automazione Computer Networks Research Group

netkit lab

static-routing

an example of configuration of static routes Description

http://www.netkit.org/

Web

contact@netkit.org E-mail

G. Di Battista, M. Patrignani, M. Pizzonia, F. Ricci, M. Rimondini

Author(s)

2.2 Version

(2)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

copyright notice

All the pages/slides in this presentation, including but not limited to, images, photos, animations, videos, sounds, music, and text (hereby referred to as

“material”) are protected by copyright.

This material, with the exception of some multimedia elements licensed by other organizations, is property of the authors and/or organizations appearing in the first slide.

This material, or its parts, can be reproduced and used for didactical purposes within universities and schools, provided that this happens for non-profit purposes.

Information contained in this material cannot be used within network design projects or other products of any kind.

Any other use is prohibited, unless explicitly authorized by the authors on the basis of an explicit agreement.

The authors assume no responsibility about this material and provide this material

“as is”, with no implicit or explicit warranty about the correctness and completeness of its contents, which may be subject to changes.

This copyright notice must always be redistributed together with the material, or

its portions.

(3)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 1 – network topology high level view

r1 100.0.0.8/30

195.11.14.0/24 200.1.1.0/24

r2

pc1 pc2

(4)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 1 – network topology configuration details

collision domain A

r1 r2

collision domain C

collision domain B

pc1 pc2

eth0 eth0

eth0

eth1 eth1

eth0

195.11.14.0/24 200.1.1.0/24

100.0.0.8/30

.5 .7

.1 .1

.9 .10

(5)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 2 – the lab

lab directory hierarchy

lab.conf

pc1/

pc1.startup

pc2/

pc2.startup

r1/

r1.startup

r2/

r2.startup

(6)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 2 – the lab

ifconfig eth0 195.11.14.5 netmask 255.255.255.0 broadcast 195.11.14.255 up ifconfig eth0 195.11.14.5 netmask 255.255.255.0 broadcast 195.11.14.255 up

pc1.startup

ifconfig eth0 200.1.1.7 netmask 255.255.255.0 broadcast 200.1.1.255 up ifconfig eth0 200.1.1.7 netmask 255.255.255.0 broadcast 200.1.1.255 up

pc2.startup

r1[0]="A"

r1[1]="B"

r2[0]="C"

r2[1]="B"

pc1[0]="A"

pc2[0]="C"

r1[0]="A"

r1[1]="B"

r2[0]="C"

r2[1]="B"

pc1[0]="A"

pc2[0]="C"

lab.conf

#route add default gw 195.11.14.1 dev eth0

the routing table entries will be added manually the routing table entries will be added manually

#route add default gw 200.1.1.1 dev eth0

(7)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 2 – the lab

ifconfig eth0 195.11.14.1 netmask 255.255.255.0 broadcast 195.11.14.255 up ifconfig eth1 100.0.0.9 netmask 255.255.255.252 broadcast 100.0.0.11 up ifconfig eth0 195.11.14.1 netmask 255.255.255.0 broadcast 195.11.14.255 up ifconfig eth1 100.0.0.9 netmask 255.255.255.252 broadcast 100.0.0.11 up

r1.startup

ifconfig eth0 200.1.1.1 netmask 255.255.255.0 broadcast 200.1.1.255 up ifconfig eth1 100.0.0.10 netmask 255.255.255.252 broadcast 100.0.0.11 up ifconfig eth0 200.1.1.1 netmask 255.255.255.0 broadcast 200.1.1.255 up ifconfig eth1 100.0.0.10 netmask 255.255.255.252 broadcast 100.0.0.11 up

r2.startup

#route add -net 195.11.14.0 netmask 255.255.255.0 gw 100.0.0.9 dev eth1

#route add -net 200.1.1.0 netmask 255.255.255.0 gw 100.0.0.10 dev eth1

the routing table entries

will be added manually

the routing table entries

will be added manually

(8)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 3 – testing connectivity

pc1:~#

pc1:~# pc1:~#

pc1:~# pingpingpingping 195.11.14.1195.11.14.1195.11.14.1195.11.14.1 PING 195.11.14.1 (

PING 195.11.14.1 (PING 195.11.14.1 (

PING 195.11.14.1 (195.11.14.1195.11.14.1195.11.14.1) 56(84) 195.11.14.1) 56(84) ) 56(84) bytes) 56(84) bytesbytes of data.bytes of data.of data.of data.

64 64 64

64 bytesbytesbytesbytes fromfromfrom 195.11.14.1: icmp_seq=1 ttl=64 time=3from 195.11.14.1: icmp_seq=1 ttl=64 time=3195.11.14.1: icmp_seq=1 ttl=64 time=3195.11.14.1: icmp_seq=1 ttl=64 time=3.17.17.17.17 msmsmsms 64

64 64

64 bytesbytesbytesbytes fromfromfrom 195.11.14.1: icmp_seq=2 ttl=64 time=0from 195.11.14.1: icmp_seq=2 ttl=64 time=0195.11.14.1: icmp_seq=2 ttl=64 time=0195.11.14.1: icmp_seq=2 ttl=64 time=0.371.371.371.371 msmsmsms 64

64 64

64 bytesbytesbytesbytes fromfromfrom 195.11.14.1: icmp_seq=3 ttl=64 time=0from 195.11.14.1: icmp_seq=3 ttl=64 time=0195.11.14.1: icmp_seq=3 ttl=64 time=0195.11.14.1: icmp_seq=3 ttl=64 time=0.308.308.308.308 msmsmsms ---

--- 195.11.14.1 195.11.14.1 195.11.14.1 195.11.14.1 pingpingpingping statisticsstatisticsstatistics ---statistics --- 3 3 3

3 packetspacketspacketspackets transmittedtransmittedtransmittedtransmitted, 3 , 3 , 3 received, 3 receivedreceived, 0% received, 0% , 0% packet, 0% packetpacket losspacket lossloss, time 2019msloss, time 2019ms, time 2019ms, time 2019ms rtt

rttrtt

rtt minminminmin////avgavgavgavg////maxmaxmaxmax////mdevmdevmdevmdev = 0.308/1.285/3.176/1.337 = 0.308/1.285/3.176/1.337 = 0.308/1.285/3.176/1.337 ms= 0.308/1.285/3.176/1.337 msmsms pc1:~#

pc1:~# pc1:~#

pc1:~# ████

pc1 pc1

r1 r2

pc1

eth0 eth0

eth0

eth1 eth1

eth0 195.11.14.5

100.0.0.9 195.11.14.1

200.1.1.7

200.1.1.1 100.0.0.10

pc2

interfaces on the same

domain can reach each other

interfaces on the same

domain can

reach each

other

(9)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 3 – testing connectivity

r1 r2

pc1

eth0 eth0

eth0

eth1 eth1

eth0 195.11.14.5

100.0.0.9 195.11.14.1

200.1.1.7

200.1.1.1 100.0.0.10

pc2

pc1:~#

pc1:~# pc1:~#

pc1:~# ping ping ping 100.0.0.9 ping 100.0.0.9 100.0.0.9 100.0.0.9 connect

connect connect

connect: Network : Network : Network is : Network is is is unreachable unreachable unreachable unreachable pc1:~#

pc1:~# pc1:~#

pc1:~# █ █ █ █

pc1 pc1

interfaces on different domains cannot be reached

can you tell why?

interfaces on different domains cannot be reached

can you tell why?

(10)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 3 – inspecting routing tables

both routers and pcs don’t know how to reach networks that are not directly connected to them

directly connected networks are automatically inserted into the routing table when the corresponding interface is brought up

this is a common behavior of all ip devices (even real-world routers!)

pc1:~# route pc1:~# route pc1:~# route pc1:~# route Kernel

Kernel Kernel

Kernel IP IP IP routingIP routingrouting tablerouting tabletabletable Destination

Destination Destination

Destination GatewayGatewayGatewayGateway GenmaskGenmaskGenmaskGenmask FlagsFlags MetricFlagsFlags MetricMetricMetric RefRefRefRef UseUse IfaceUseUse IfaceIfaceIface 195.11.14.0 * 255.255.255.0 U 0 0

195.11.14.0 * 255.255.255.0 U 0 0 195.11.14.0 * 255.255.255.0 U 0 0

195.11.14.0 * 255.255.255.0 U 0 0 0 eth00 eth00 eth00 eth0 pc1:~#

pc1:~#

pc1:~#

pc1:~# ████

pc1 pc1

r1:~# route r1:~# route r1:~# route r1:~# route Kernel

Kernel Kernel

Kernel IP IP IP routingIP routingrouting tablerouting tabletabletable Destination

Destination Destination

Destination GatewayGatewayGatewayGateway GenmaskGenmaskGenmaskGenmask FlagsFlags MetricFlagsFlags MetricMetricMetric RefRefRefRef UseUse IfaceUseUse IfaceIfaceIface 100.0.0.8 * 255.255.255.252 U 0 0

100.0.0.8 * 255.255.255.252 U 0 0 100.0.0.8 * 255.255.255.252 U 0 0

100.0.0.8 * 255.255.255.252 U 0 0 0 eth10 eth10 eth10 eth1 195.11.14.0 * 255.255.255.0 U 0 0

195.11.14.0 * 255.255.255.0 U 0 0 195.11.14.0 * 255.255.255.0 U 0 0

195.11.14.0 * 255.255.255.0 U 0 0 0 eth00 eth00 eth00 eth0 r1:~#

r1:~#

r1:~#

r1:~# ████

r1 r1

(11)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 4 – default routes on pcs

to fix the problem we could specify the default route on the pcs: “through this gateway (ip number) you can reach all the other networks”

pc1:~# route pc1:~# route pc1:~# route

pc1:~# route addaddadd defaultadd defaultdefault gwdefault gwgw 195.11.14.1gw 195.11.14.1195.11.14.1195.11.14.1 pc1:~# route

pc1:~# routepc1:~# route pc1:~# route Kernel

KernelKernel

Kernel IP IP IP IP routingroutingroutingrouting tabletabletabletable Destination

DestinationDestination

Destination GatewayGatewayGatewayGateway GenmaskGenmaskGenmaskGenmask FlagsFlagsFlagsFlags MetricMetricMetric RefMetric RefRefRef UseUseUseUse IfaceIfaceIfaceIface 195.11.14.0 * 255.255.255.0 U 0 0

195.11.14.0 * 255.255.255.0 U 0 0 195.11.14.0 * 255.255.255.0 U 0 0

195.11.14.0 * 255.255.255.0 U 0 0 0 eth00 eth00 eth00 eth0 default

defaultdefault

default 195.11.14.1 0.0.0.0 UG 0 0 0195.11.14.1 0.0.0.0 UG 0 0 0195.11.14.1 0.0.0.0 UG 0 0 0195.11.14.1 0.0.0.0 UG 0 0 0 eth0eth0eth0eth0 pc1:~#

pc1:~# pc1:~#

pc1:~# ████

pc1 pc1

pc2:~# route pc2:~# route pc2:~# route

pc2:~# route addaddadd defaultadd defaultdefault gwdefault gwgw 200.1.1.1gw 200.1.1.1200.1.1.1200.1.1.1 pc2:~# route

pc2:~# routepc2:~# route pc2:~# route Kernel

KernelKernel

Kernel IP IP IP IP routingroutingroutingrouting tabletabletabletable Destination

DestinationDestination

Destination GatewayGatewayGatewayGateway GenmaskGenmaskGenmaskGenmask FlagsFlagsFlagsFlags MetricMetricMetric RefMetric RefRefRef UseUseUseUse IfaceIfaceIfaceIface 200.1.1.0 * 255.255.255.0 U 0 0

200.1.1.0 * 255.255.255.0 U 0 0 200.1.1.0 * 255.255.255.0 U 0 0

200.1.1.0 * 255.255.255.0 U 0 0 0 eth00 eth00 eth00 eth0 default

defaultdefault

default 200.1.1.1 0.0.0.0 UG 0 0 0200.1.1.1 0.0.0.0 UG 0 0 0200.1.1.1 0.0.0.0 UG 0 0 0200.1.1.1 0.0.0.0 UG 0 0 0 eth0eth0eth0eth0 pc2:~#

pc2:~# pc2:~#

pc2:~# ████

pc2 pc2

(12)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 4 – default routes on pcs: test

pc1:~#

pc1:~# pc1:~#

pc1:~# pingpingpingping 100.0.0.9100.0.0.9100.0.0.9100.0.0.9 PING 100.0.0.9 (

PING 100.0.0.9 (PING 100.0.0.9 (

PING 100.0.0.9 (100.0.0.9100.0.0.9100.0.0.9100.0.0.9) 56(84) ) 56(84) ) 56(84) bytes) 56(84) bytesbytes of data.bytes of data.of data.of data.

64 64 64

64 bytesbytesbytesbytes fromfromfrom 100.0.0.9: icmp_seq=1 ttl=64 time=0from 100.0.0.9: icmp_seq=1 ttl=64 time=0100.0.0.9: icmp_seq=1 ttl=64 time=0100.0.0.9: icmp_seq=1 ttl=64 time=0.451.451.451.451 msmsmsms 64

64 64

64 bytesbytesbytesbytes fromfromfrom 100.0.0.9: icmp_seq=2 ttl=64 time=0from 100.0.0.9: icmp_seq=2 ttl=64 time=0100.0.0.9: icmp_seq=2 ttl=64 time=0100.0.0.9: icmp_seq=2 ttl=64 time=0.299.299.299.299 msmsmsms 64

64 64

64 bytesbytesbytesbytes fromfromfrom 100.0.0.9: icmp_seq=3 ttl=64 time=0from 100.0.0.9: icmp_seq=3 ttl=64 time=0100.0.0.9: icmp_seq=3 ttl=64 time=0100.0.0.9: icmp_seq=3 ttl=64 time=0.320.320.320.320 msmsmsms ---

--- 100.0.0.9 100.0.0.9 100.0.0.9 100.0.0.9 pingpingpingping statisticsstatisticsstatisticsstatistics --- 3 3 3

3 packetspacketspacketspackets transmittedtransmittedtransmittedtransmitted, 3 , 3 , 3 received, 3 receivedreceived, 0% received, 0% , 0% packet, 0% packetpacket losspacket lossloss, time 2003msloss, time 2003ms, time 2003ms, time 2003ms rtt

rttrtt

rtt minminminmin////avgavgavgavg////maxmaxmaxmax////mdevmdevmdevmdev = 0.299/0.356/0.451/0.070 = 0.299/0.356/0.451/0.070 = 0.299/0.356/0.451/0.070 ms= 0.299/0.356/0.451/0.070 msmsms pc1:~#

pc1:~# pc1:~#

pc1:~# ████

pc1 pc1

r1 r2

pc1

eth0 eth0

eth0

eth1 eth1

eth0 195.11.14.5

100.0.0.9 195.11.14.1

200.1.1.7

200.1.1.1 100.0.0.10

pc2

the

“backbone interface” of r1 is

reachable the

“backbone interface” of r1 is

reachable

(13)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 4 – default routes on pcs: test

pc1:~# ping 100.0.0.10 pc1:~# ping 100.0.0.10 pc1:~# ping 100.0.0.10 pc1:~# ping 100.0.0.10

PING 100.0.0.10 (100.0.0.10) 56(84) bytes of data.

PING 100.0.0.10 (100.0.0.10) 56(84) bytes of data.

PING 100.0.0.10 (100.0.0.10) 56(84) bytes of data.

PING 100.0.0.10 (100.0.0.10) 56(84) bytes of data.

--- --- ---

--- 100.0.0.10 ping statistics 100.0.0.10 ping statistics 100.0.0.10 ping statistics 100.0.0.10 ping statistics ---

7 packets transmitted, 0 received, 100% packet loss, time 6105ms 7 packets transmitted, 0 received, 100% packet loss, time 6105ms 7 packets transmitted, 0 received, 100% packet loss, time 6105ms 7 packets transmitted, 0 received, 100% packet loss, time 6105ms pc1:~#

pc1:~#

pc1:~#

pc1:~# ████

pc1 pc1

r1 r2

pc1

eth0 eth0

eth0

eth1 eth1

eth0 195.11.14.5

100.0.0.9 195.11.14.1

200.1.1.7

200.1.1.1 100.0.0.10

pc2

interfaces on r2 seem

unreachable!

can you tell why?

interfaces on r2 seem

unreachable!

can you tell

why?

(14)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 4 – let’s inspect the network

do echo request packets reach r2 ?

let’s check...

while pinging from pc1 100.0.0.10 sniff on interface eth1 of r2

r2:~#

r2:~# r2:~#

r2:~# tcpdumptcpdumptcpdump -tcpdump ---i eth1i eth1i eth1i eth1 tcpdump

tcpdumptcpdump

tcpdump: verbose output : verbose output : verbose output : verbose output suppressedsuppressedsuppressedsuppressed, , , use, useuseuse ----v or v or v or v or ---vv-vvvvvv forforfor full for full full protocolfull protocolprotocolprotocol decodedecodedecodedecode listening

listeninglistening

listening on eth1, on eth1, on eth1, on eth1, linklinklinklink----typetypetypetype EN10MB (EN10MB (EN10MB (EthernetEN10MB (EthernetEthernet), Ethernet), ), capture), capturecapturecapture sizesizesizesize 96 96 96 96 bytesbytesbytesbytes 16:06:58.977851

16:06:58.977851 16:06:58.977851

16:06:58.977851 arparparparp whowhowhowho----hashashashas 100.0.0.10 100.0.0.10 100.0.0.10 100.0.0.10 telltelltelltell 100.0.0.9100.0.0.9100.0.0.9100.0.0.9 16:06:59.088906

16:06:59.088906 16:06:59.088906

16:06:59.088906 arparparparp replyreplyreplyreply 100.0.0.10 100.0.0.10 100.0.0.10 is100.0.0.10 isis-is---atatatat fefefefe:::fd:fdfd:64:00:fd:64:00::64:00::64:00:00000000:0a:0a:0a:0a 16:06:59.089990 IP 195.11.14.5 > 100.0.0.10:

16:06:59.089990 IP 195.11.14.5 > 100.0.0.10: 16:06:59.089990 IP 195.11.14.5 > 100.0.0.10:

16:06:59.089990 IP 195.11.14.5 > 100.0.0.10: icmpicmpicmp 64: icmp 64: 64: echo64: echoecho requestecho requestrequestrequest seqseqseqseq 1111 16:06:59.989368 IP 195.11.14.5 > 100.0.0.10:

16:06:59.989368 IP 195.11.14.5 > 100.0.0.10: 16:06:59.989368 IP 195.11.14.5 > 100.0.0.10:

16:06:59.989368 IP 195.11.14.5 > 100.0.0.10: icmpicmpicmp 64: icmp 64: 64: echo64: echoecho requestecho requestrequestrequest seqseqseqseq 2222 16:07:01.001888 IP 195.11.14.5 > 100.0.0.10:

16:07:01.001888 IP 195.11.14.5 > 100.0.0.10: 16:07:01.001888 IP 195.11.14.5 > 100.0.0.10:

16:07:01.001888 IP 195.11.14.5 > 100.0.0.10: icmpicmpicmp 64: icmp 64: 64: echo64: echoecho requestecho requestrequestrequest seqseqseqseq 3333 5 5 5

5 packetspacketspacketspackets capturedcapturedcapturedcaptured 5

5 5

5 packetspacketspacketspackets receivedreceivedreceivedreceived bybybyby filterfilterfilterfilter 0

0 0

0 packetspacketspacketspackets droppeddroppeddroppeddropped bybyby kernelby kernelkernelkernel r2:~#

r2:~# r2:~#

r2:~# ████

r2 r2

echo requests are arriving!

echo requests are arriving!

© Computer Networks Research Group Roma Tre

(15)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 4 – r2 ’s routing table

pc1 ’s address is 195.11.14.5

r2 does not know how to reach such an address.

echo requests arrive to r2 but r2 does not know where echo replies should be forwarded!

somebody should teach r2 how to reach pc1

we may insert a static route into the routing table of r2

r2:~# route r2:~# router2:~# route r2:~# route Kernel

KernelKernel

Kernel IP IP IP IP routingroutingroutingrouting tabletabletabletable Destination

DestinationDestination

Destination GatewayGatewayGatewayGateway GenmaskGenmaskGenmaskGenmask FlagsFlagsFlagsFlags MetricMetricMetric RefMetric RefRefRef UseUseUseUse Iface

IfaceIface Iface

100.0.0.8 * 255.255.255.252 U 0 0 100.0.0.8 * 255.255.255.252 U 0 0 100.0.0.8 * 255.255.255.252 U 0 0

100.0.0.8 * 255.255.255.252 U 0 0 0 eth10 eth10 eth10 eth1 200.1.1.0 * 255.255.255.0 U 0 0

200.1.1.0 * 255.255.255.0 U 0 0 200.1.1.0 * 255.255.255.0 U 0 0

200.1.1.0 * 255.255.255.0 U 0 0 0 eth00 eth00 eth00 eth0 r2:~#

r2:~# r2:~#

r2:~# ████

r2 r2

(16)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 5 – configuring a static route

r2:~# route r2:~# route r2:~# route

r2:~# route add add add add - - -net 195.11.14.0 - net 195.11.14.0 net 195.11.14.0 net 195.11.14.0 netmask netmask netmask netmask 255.255.255.0 255.255.255.0 255.255.255.0 gw 255.255.255.0 gw gw 100.0.0.9 gw 100.0.0.9 100.0.0.9 100.0.0.9 dev dev dev dev eth1 eth1 eth1 eth1

r2:~# route r2:~# route r2:~# route r2:~# route Kernel

Kernel Kernel

Kernel IP IP IP IP routing routing routing routing table table table table Destination

Destination Destination

Destination Gateway Gateway Gateway Gateway Genmask Genmask Genmask Genmask Flags Flags Metric Flags Flags Metric Metric Metric Ref Ref Ref Ref Use Use Use Use Iface Iface Iface Iface 100.0.0.8 * 255.255.255.252 U 0 0

100.0.0.8 * 255.255.255.252 U 0 0 100.0.0.8 * 255.255.255.252 U 0 0

100.0.0.8 * 255.255.255.252 U 0 0 0 eth1 0 eth1 0 eth1 0 eth1 200.1.1.0 * 255.255.255.0 U 0 0

200.1.1.0 * 255.255.255.0 U 0 0 200.1.1.0 * 255.255.255.0 U 0 0

200.1.1.0 * 255.255.255.0 U 0 0 0 eth0 0 eth0 0 eth0 0 eth0 195.11.14.0 100.0.0.9 255.255.255.0 UG 0 0

195.11.14.0 100.0.0.9 255.255.255.0 UG 0 0 195.11.14.0 100.0.0.9 255.255.255.0 UG 0 0

195.11.14.0 100.0.0.9 255.255.255.0 UG 0 0 0 eth1 0 eth1 0 eth1 0 eth1 r2:~#

r2:~#

r2:~#

r2:~# █ █ █ █

r2 r2

network 195.11.14.0 ...

network 195.11.14.0 ...

...with netmask

255.255.255.0 ...

...with netmask

255.255.255.0 ... …is reachable via 100.0.0.9…

…is reachable via 100.0.0.9…

…on interface eth1

…on interface eth1

(17)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 5 – configuring a static route

a similar configuration should be deployed on r1

r1:~# route r1:~# route r1:~# route

r1:~# route add add add add - - -net 200.1.1.0 - net 200.1.1.0 net 200.1.1.0 net 200.1.1.0 netmask netmask netmask netmask 255.255.255.0 255.255.255.0 255.255.255.0 gw 255.255.255.0 gw gw 100.0.0.10 gw 100.0.0.10 100.0.0.10 100.0.0.10 dev dev dev eth1 dev eth1 eth1 eth1 r1:~# route

r1:~# route r1:~# route r1:~# route Kernel

Kernel Kernel

Kernel IP IP IP IP routing routing routing routing table table table table Destination

Destination Destination

Destination Gateway Gateway Gateway Gateway Genmask Genmask Genmask Genmask Flags Flags Metric Flags Flags Metric Metric Metric Ref Ref Ref Ref Use Use Use Use Iface Iface Iface Iface 100.0.0.8 * 255.255.255.252 U 0 0

100.0.0.8 * 255.255.255.252 U 0 0 100.0.0.8 * 255.255.255.252 U 0 0

100.0.0.8 * 255.255.255.252 U 0 0 0 eth1 0 eth1 0 eth1 0 eth1 200.1.1.0 100.0.0.10 255.255.255.0 UG 0 0

200.1.1.0 100.0.0.10 255.255.255.0 UG 0 0 200.1.1.0 100.0.0.10 255.255.255.0 UG 0 0

200.1.1.0 100.0.0.10 255.255.255.0 UG 0 0 0 eth1 0 eth1 0 eth1 0 eth1 195.11.14.0 * 255.255.255.0 U 0 0

195.11.14.0 * 255.255.255.0 U 0 0 195.11.14.0 * 255.255.255.0 U 0 0

195.11.14.0 * 255.255.255.0 U 0 0 0 eth0 0 eth0 0 eth0 0 eth0 r1:~#

r1:~#

r1:~#

r1:~# █ █ █ █

r1 r1

(18)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

step 5 – testing static routes

the pcs can reach each other

pc1:~#

pc1:~#

pc1:~#

pc1:~# pingpingpingping 200.1.1.7200.1.1.7200.1.1.7200.1.1.7 PING 200.1.1.7 (

PING 200.1.1.7 ( PING 200.1.1.7 (

PING 200.1.1.7 (200.1.1.7200.1.1.7200.1.1.7200.1.1.7) 56(84) ) 56(84) ) 56(84) ) 56(84) bytesbytesbytes of data.bytes of data.of data.of data.

64 64 64

64 bytesbytesbytesbytes fromfromfrom 200.1.1.7: icmp_seq=1 ttl=62 time=111 from 200.1.1.7: icmp_seq=1 ttl=62 time=111 200.1.1.7: icmp_seq=1 ttl=62 time=111 200.1.1.7: icmp_seq=1 ttl=62 time=111 msmsmsms 64

64 64

64 bytesbytesbytesbytes fromfromfrom 200.1.1.7: icmp_seq=2 ttl=62 time=1from 200.1.1.7: icmp_seq=2 ttl=62 time=1200.1.1.7: icmp_seq=2 ttl=62 time=1200.1.1.7: icmp_seq=2 ttl=62 time=1.05.05.05.05 msmsmsms 64

64 64

64 bytesbytesbytesbytes fromfromfrom 200.1.1.7: icmp_seq=3 ttl=62 time=0from 200.1.1.7: icmp_seq=3 ttl=62 time=0200.1.1.7: icmp_seq=3 ttl=62 time=0200.1.1.7: icmp_seq=3 ttl=62 time=0.820.820.820.820 msmsmsms ---

--- 200.1.1.7 200.1.1.7 200.1.1.7 200.1.1.7 pingpingpingping statisticsstatisticsstatisticsstatistics --- 3 3

3 3 packetspacketspacketspackets transmittedtransmittedtransmitted, 3 transmitted, 3 , 3 , 3 receivedreceivedreceivedreceived, 0% , 0% , 0% , 0% packetpacketpacket losspacket losslossloss, time 2042ms, time 2042ms, time 2042ms, time 2042ms rttrtt

rttrtt minminminmin////avgavgavgavg////maxmaxmaxmax////mdevmdevmdevmdev = 0.820/37.779/111.467/52.105 = 0.820/37.779/111.467/52.105 = 0.820/37.779/111.467/52.105 = 0.820/37.779/111.467/52.105 msmsmsms pc1:~#

pc1:~#

pc1:~#

pc1:~# ████

pc1 pc1

pc2:~#

pc2:~#

pc2:~#

pc2:~# pingpingpingping 195.11.14.5195.11.14.5195.11.14.5195.11.14.5 PING 195.11.14.5 (

PING 195.11.14.5 ( PING 195.11.14.5 (

PING 195.11.14.5 (195.11.14.5195.11.14.5195.11.14.5) 56(84) 195.11.14.5) 56(84) ) 56(84) bytes) 56(84) bytesbytes of data.bytes of data.of data.of data.

64 64 64

64 bytesbytesbytesbytes fromfromfrom 195.11.14.5: icmp_seq=1 ttl=62 time=0from 195.11.14.5: icmp_seq=1 ttl=62 time=0195.11.14.5: icmp_seq=1 ttl=62 time=0195.11.14.5: icmp_seq=1 ttl=62 time=0.954.954.954.954 msmsmsms 64

64 64

64 bytesbytesbytesbytes fromfromfrom 195.11.14.5: icmp_seq=2 ttl=62 time=0from 195.11.14.5: icmp_seq=2 ttl=62 time=0195.11.14.5: icmp_seq=2 ttl=62 time=0195.11.14.5: icmp_seq=2 ttl=62 time=0.947.947.947.947 msmsmsms 64

64 64

64 bytesbytesbytesbytes fromfromfrom 195.11.14.5: icmp_seq=3 ttl=62 time=1from 195.11.14.5: icmp_seq=3 ttl=62 time=1195.11.14.5: icmp_seq=3 ttl=62 time=1195.11.14.5: icmp_seq=3 ttl=62 time=1.27.27.27.27 msmsmsms ---

--- 195.11.14.5 195.11.14.5 195.11.14.5 195.11.14.5 pingpingpingping statisticsstatisticsstatisticsstatistics --- 3 3

3 3 packetspacketspacketspackets transmittedtransmittedtransmitted, 3 transmitted, 3 , 3 , 3 receivedreceivedreceivedreceived, 0% , 0% , 0% , 0% packetpacketpacket losspacket losslossloss, time 2049ms, time 2049ms, time 2049ms, time 2049ms rttrtt

rttrtt minminminmin////avgavgavgavg////maxmaxmaxmax////mdevmdevmdevmdev = 0.947/1.057/1.271/0.153 = 0.947/1.057/1.271/0.153 = 0.947/1.057/1.271/0.153 = 0.947/1.057/1.271/0.153 msmsmsms pc2:~#

pc2:~#

pc2:~#

pc2:~# ████

pc2 pc2

©Computer Networks Research Group Roma Tre

(19)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

proposed exercises

the default route can be statically configured by using

route add default gw 195.11.14.1 dev eth0

can you give a command to configure a static route that is equivalent to the default route?

route add -net __ netmask __ gw __ dev __

(20)

last update: Apr 2007 netkit – [ lab: static routing ]

© Computer Networks Research Group Roma Tre

proposed exercises

not all the routing tables contain a default route

the network of this lab is so simple that

routers r1 and r2 can be also configured to exclusively use default routes

try such a configuration and test it

Références

Documents relatifs

Given that most of the widely used Internet protocols such as SMTP, NNTP and FTP are all based on commands which are given via ASCII strings, there seems no reason why

Assuming that the home-address test dominates the care-of-address test in terms of latency, a Mobile IPv6 handoff takes one round-trip time between the mobile node and the

communication in general, the case of multicast listener mobility, and problems for mobile senders using Any Source Multicast and Source-Specific Multicast..

Preserving integrity of routing and data, or, in other words, preventing peers from returning corrupt responses to queries and routing through malicious peers, is an

the separation between identifier and locator (which is to meet end- users’ needs including mobility) and the separation between local and global locator (which makes the

The PHIB is inserted into a bundle by a forwarding node to provide the endpoint identifier (EID) of an endpoint of which the forwarding node is a member so that this EID may

Each of these decisions, resolutions, and suggestions of the Regional Committee on Human Settlements basically derives from and strengthens General Assembly resolution

Disclaimer: layout of this document may differ from the published version. 1