static routing exercise

21
Static Routing Exercise AFNOG 2003/ Track 2 # 1 Static Routing Exercise Unix network interface configuration Cisco network interface configuration Static routes Default route Testing

Upload: nissim-lambert

Post on 13-Mar-2016

44 views

Category:

Documents


2 download

DESCRIPTION

Unix network interface configuration Cisco network interface configuration Static routes Default route Testing. Static Routing Exercise. Routing. Routing is done based on destination IP address Without routing, interface can only reach destinations via ARP - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 1

Static Routing Exercise Unix network interface configuration Cisco network interface configuration Static routes Default route Testing

Page 2: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 2

Routing Routing is done based on destination IP address Without routing, interface can only reach

destinations via ARP Cannot reach a destination on another separate

network without going through an intermediate device

A device with at least 2 interfaces can route

Page 3: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 3

Routing Static routes

– specifically instructs router on which route to take to a particular destination network

dynamic routes– learnt via routing protocols implemented on routers

default routes– route that instructs a machine where to send packets

for destinations that are not on the routing table

Page 4: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 4

Static Routing Advantages

Simple to configure and maintain Secure as only defined routes can be

accessed Bandwidth is not used for sending routing

updates Disadvantages

Manual update of routes after changes Explicit addition of routes for all networks

Page 5: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 5

IP Routing ConfigurationStatic/default route example

172.16.3.2

ip route 172.16.1.0 255.255.255.0 172.16.2.1 - STATIC

172.16.2.1

172.16.1.0255.255.255.0

To Internet

ip route 0.0.0.0 0.0.0.0 172.16.3.1 - DEFAULT

172.16.2.2172.16.3.1

Page 6: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 6

A

C

B

FE

I

G

D

H

J

RouterPC

HUB

RouterPC

HUB

RouterPC

HUB

RouterPC

HUB

RouterPC

HUB

Router PC

HUB

Router PC

HUB

Router PC

HUB

Router PC

HUB

Router PC

HUB

SWITCH

Classroom Layout

Page 7: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 7

SWITCH

A

C

E

I

G

81.199.108.80/28

81.199.108.112/28

81.199.108.144/28

81.199.108.176/28

81.199.108.208/28

B

F

D

H

J

81.199.108.96/28

81.199.108.128/28

81.199.108.160/28

81.199.108.192/28

81.199.108.224/28

Address Allocation

81.1

99.1

08.0

/28

.1

.3

.5

.7

.9

.2

.4

.6

.8

.10

Page 8: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 8

Address Allocation You already have an IP address for your

router’s backbone link (A=.1, B=.2, …) You have a /28 for your local network (PC

and router connected to hub) Allocate your own host addresses from

your local /28 network

Page 9: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 9

Network interface configuration - FreeBSD

configure interface on Unix hostifconfig fxp0 inet n.n.n.n netmask m.m.m.m

– fxp0 is interface name– n.n.n.n is IP address– m.m.m.m is netmask

Page 10: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 10

Connect PC to router console Connect cable to console port on router,

serial port on FreeBSD box Use the tip command to connect your

keyboard and screen to the serial port– e.g. bash$ tip cuaa0c

You may have to edit /etc/remote See man pages for tip(1) and remote(5)

Page 11: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 11

Network interface configuration - Cisco

configure backbone interface on cisco routerconf tinterface ethernet0/0ip address n.n.n.n m.m.m.m

– ethernet0/0 is interface name– n.n.n.n is IP address– m.m.m.m is netmask

configure local interface on cisco router– ethernet0/1

Page 12: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 12

Network interface configuration - Cisco

Cisco global config should always include:ip classlessip subnet-zerono ip domain-lookup

Cisco interface config should usually include:no shutdownno ip proxy-arpno ip redirects

Page 13: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 13

Test connectivity PC can ping local interface of router Router can ping PC PC cannot ping backbone interface of

router Router can ping other routers PC cannot ping other routers or other PCs

Page 14: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 14

Add default route Add route on PC

route add default g.g.g.g– g.g.g.g is IP address of gateway (which is on

cisco router) Display forwarding table

netstat -f inet -rn

Page 15: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 15

Test connectivity All PCs can now reach backbone IP address

of own row Still can’t reach other rows

– why?– Do a traceroute to troubleshoot

Page 16: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 16

Add static routes to other rows On router, add static routes to other rows

– next hop is backbone interface of other row’s router

ip route n.n.n.n m.m.m.m g.g.g.g Repeat many times

Page 17: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 17

Test connectivity All routers can reach all PCs All PCs can reach all backbone IP

addresses All PCs can reach PCs in other rows Test with traceroute

Page 18: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 18

SWITCH

A

C

E

I

G

81.199.108.80/28

81.199.108.112/28

81.199.108.144/28

81.199.108.176/28

81.199.108.208/28

B

F

D

H

J

81.199.108.96/28

81.199.108.128/28

81.199.108.160/28

81.199.108.192/28

81.199.108.224/28

Address Allocation

81.1

99.1

08.0

/28

.1

.3

.5

.7

.9

.2

.4

.6

.8

.10

81.199.108.14/28T2 router

Page 19: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 19

Add static routes to classroom router On router, remove all static routes

no ip route n.n.n.n m.m.m.m g.g.g.g Repeat many times Add default route to classroom router

– next hop is backbone routerip route 0.0.0.0 0.0.0.0 g.g.g.g

Page 20: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 20

Test connectivity All routers can reach all PCs All PCs can reach all backbone IP

addresses All PCs can reach PCs in other rows Test with traceroute All static routes have now been added on

classroom router

Page 21: Static Routing Exercise

Static Routing Exercise AFNOG 2003/ Track 2 # 21

Edit FreeBSD /etc/rc.conf On production machines, add lines to

/etc/rc.conf to configure network on reboothostname="porcupine.tomato.example"ifconfig_fxp0="inet X.X.X.X netmask Y.Y.Y.Y"

defaultrouter=”G.G.G.G" See /etc/default/rc.conf for more

information