Pages

Jun 30, 2010

Static routing

Here an example on how to connect routers using static routing, in this example I only use 2 routers (Router A and Router B) and have 3 networks, first one is the Router A LAN network (192.168.1.0/24), second is Router B LAN network (192.168.2.0/24) and the third network is the connection between router A and B which is (192.168.3.0/252). Below shown the network topology



in order routers to routes packets, routers save the network destination in routing table. By default, the network that is directly connected to the router is automatically saved in the routing table of the router.

For router A,network 192.168.1.0/24 and network 192.168.3.0/252 are directly connected to the router A, so these two network does not have to be add in the ip route of router A. Network 192.168.2.0/24 is not directly connected to router A, therefore we want to add this network into routing table of Router A. So, to do so, enter cli of Router A then execute this command:

RouterA(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.2
RouterA(config)#ip default-network 192.168.2.0

explaination:

RouterA(config)#ip route [network that we wanna add in routing table] [its subnet mask] [the exit interface ip address of the router that are connected to the network we want to add in routing table]

RouterA(config)#ip default-network [network that we wanna add in routing table] .

Then for RouterB, the network that is not directly connected to it is the network 192.168.1.0/24. Therefore we have to add this network into the routing table of RouterB, enter this command:

RouterB(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1
RouterB(config)#ip default-network 192.168.1.0

the explaination is same as the RouterA.

Alternatively, you can give the name of the exit interface of the router(refer to the topology above):

RouterA(config)#ip route 192.168.2.0 255.255.255.0 fa0/0

RouterB(config)#ip route 192.168.1.0 255.255.255.0 fa0/0

Now, ping between PC in network 192.168.1.0/24 with 192.168.2.0/24 should be successful.
Static routing is not the only way to connect routers and routes the packets from different network, alternatively you could do dynamic routing that consist of EIGRP,BGP,OSPF and few others.

No comments:

Post a Comment

Related Posts with Thumbnails