cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4713
Views
0
Helpful
10
Replies

Static Routes

iifanatic
Level 1
Level 1

I understand that Static routes are configured manually by network administrators.

I have a doubt in the syntax of the static route command.

Please refer to the image attatchment for the network diagram.

(This is from Boson Simulator which I am practicing)

On Router 1 I give the following command:

ip route 192.168.100.0 255.255.255.0 192.168.1.2

Can anyone explain me why is 192.168.1.2 i.e the address of Serial interface needed here?

Also how exactly this command works.

I am confused here with this command.

Waiting for your reply

3 Accepted Solutions

Accepted Solutions

kerek
Level 4
Level 4

Hi,

In static routes you have to give the destination network (192.168.100.0/24) and the next hop (where to forward this subnet) or the outgoing interface (serial 0). The routing table must contain the destination network and respective outgoing interface to be able to succesfully forward the particular network (and of course the outgoing interface must be up). In this case the 192.168.1.2 is the next hop address and actually this address is directly connected to serial 0 interface. So your router knows how to forward this network.

Anyway host B is not on the same subnet as with R2 ethernet 0.

Hope it helps,

Krisztian

View solution in original post

Hi

In addition to Krisztian's reply you can even define the exit interface instead of mentioning the next hop ip address..

If the next hop is reachable via an ethernet interface you need to mention the exit interface followed by the next ip hop to reach the destination..

You can refer the below link fore more info and the options available with the command...

http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124tcr/tiad_r/adressht.htm#wp1136518

regds

View solution in original post

Hi,

No, what is meant by using the physical interface (outgoing interface) is this:

ip route 192.168.100.0 255.255.255.0 serial 0/0.1

192.168.100.0 is the destination

serial 0/0.1 is the outgoing interface (instead of defining the IP address of the next-hop or next router).

HTH, please do rate all helpful replies,

Mohammed Mahmoud.

View solution in original post

10 Replies 10

kerek
Level 4
Level 4

Hi,

In static routes you have to give the destination network (192.168.100.0/24) and the next hop (where to forward this subnet) or the outgoing interface (serial 0). The routing table must contain the destination network and respective outgoing interface to be able to succesfully forward the particular network (and of course the outgoing interface must be up). In this case the 192.168.1.2 is the next hop address and actually this address is directly connected to serial 0 interface. So your router knows how to forward this network.

Anyway host B is not on the same subnet as with R2 ethernet 0.

Hope it helps,

Krisztian

Hi

In addition to Krisztian's reply you can even define the exit interface instead of mentioning the next hop ip address..

If the next hop is reachable via an ethernet interface you need to mention the exit interface followed by the next ip hop to reach the destination..

You can refer the below link fore more info and the options available with the command...

http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124tcr/tiad_r/adressht.htm#wp1136518

regds

Thanks.

One more question in addition to this query.

I have noticed that we can also give the address 0.0.0.0 or

255.255.255.255

What do all these addresses mean?

Say for instance I give the command:

ip route 0.0.0.0 255.255.255.0 192.168.1.2

I dont know if the above command is correct, but what will the 0.0.0.0 do here?

Similary with

ip route 255.255.255.255 255.255.255.0 192.168.1.2

Thanks

hello friend,

The 0.0.0.0 is used for representing any sourse address or any destination address & 255.255.255.255 field means dont mind any octects .That is normally this addresses are used for representing more addresses like wildcard mask

mohammedmahmoud
Level 11
Level 11

Hi,

Yes static routes must be manually configured all the path in both directions, the syntax is as follows:

ip route

From your example:

ip route 192.168.100.0 255.255.255.0 192.168.1.2

192.168.100.0 is the destination

192.168.1.2 is the next-hop

Simply this states that to reach this destination go to the next-hop (next-router) with the following IP, or exit using the following outgoing interface if defined.

I hope that i've been informative, please never hesitate to ask further questions.

HTH, please do rate all helpful replies,

Mohammed Mahmoud.

Thanks Mohammed

Would this command be also correct?

ip route 192.168.1.0 255.255.255.0 192.168.100.1

Now In the above command I am using the serial interface.

Hi,

No, what is meant by using the physical interface (outgoing interface) is this:

ip route 192.168.100.0 255.255.255.0 serial 0/0.1

192.168.100.0 is the destination

serial 0/0.1 is the outgoing interface (instead of defining the IP address of the next-hop or next router).

HTH, please do rate all helpful replies,

Mohammed Mahmoud.

and something more...

if u are using next hop add.,then ur routing table will show entry for the route with "S" tag and via the next hop address,but if u are using exit interface then,the entry for the route will be with "S" tag,but as directly connected.(U can verify it using show ip route)

and more ...u can use both exit interface and next hop address in one command itself .

eg: ip route 192.168.100.0 255.255.255.0 se0/0 192.168.200.1

now the advantage here..

when next hop add. is used in static route cmd,a lookup will be done in routing able for next hop add.Specifying the exit interface avoids this as it is directly connected.But the disadvantage with exit interface is that ,it takes excessive b/w for arp lookups for all ip's on destination subnet.to avoid this both exit interface and next hop add can be specified,which minimize the routing lookup and also the arp need to resolve only for next hop add. ....hope i'amm not confusing.....

............ :)

smothuku
Level 7
Level 7

Hi ,

Details about static route :

To establish static routes, use the ip route command in global configuration mode. To remove static routes, use the no form of this command.

ip route prefix mask {ip-address | interface-type interface-number [ip-address]} [dhcp] [distance] [name] [permanent | track number] [tag tag]

no ip route prefix mask

The establishment of a static route is appropriate when the Cisco IOS software cannot dynamically build a route to the destination.

When you specify a DHCP server to assign a static route, the interface type and number and administrative distance may be configured also.

If you specify an administrative distance, you are flagging a static route that can be overridden by dynamic information. For example, routes derived with Enhanced Interior Gateway Routing Protocol (EIGRP) have a default administrative distance of 100. To have a static route that would be overridden by an EIGRP dynamic route, specify an administrative distance greater than 100. Static routes have a default administrative distance of 1.

Static routes that point to an interface on a connected router will be advertised by way of Routing Information Protocol (RIP) and EIGRP regardless of whether redistribute static commands are specified for those routing protocols. This situation occurs because static routes that point to an interface are considered in the routing table to be connected and hence lose their static nature. Also, the target of the static route should be included in the network (DHCP) command. If this condition is not met, no dynamic routing protocol will advertise the route unless a redistribute static command is specified for these protocols. With the following configuration:

rtr1 (serial 172.16.188.1/30)--------------> rtr2(Fast Ethernet 172.31.1.1/30) ------>

router [rip | eigrp]

network 172.16.188.0

network 172.31.0.0

?RIP and EIGRP redistribute the route if the route is pointing to the Fast Ethernet interface:

ip route 172.16.188.252 255.255.255.252 FastEthernet0/0

RIP and EIGRP do not redistribute the route with the following ip route command because of the split horizon algorithm:

ip route 172.16.188.252 255.255.255.252 serial2/1

?EIGRP redistributes the route with both of the following commands:

ip route 172.16.188.252 255.255.255.252 FastEthernet0/0

ip route 172.16.188.252 255.255.255.252 serial2/1

With the Open Shortest Path First (OSPF) protocol, static routes that point to an interface are not advertised unless a redistribute static command is specified.

Adding a static route to an Ethernet or other broadcast interface (for example, ip route 0.0.0.0 0.0.0.0 Ethernet 1/2) will cause the route to be inserted into the routing table only when the interface is up. This configuration is not generally recommended. When the next hop of a static route points to an interface, the router considers each of the hosts within the range of the route to be directly connected through that interface, and therefore it will send Address Resolution Protocol (ARP) requests to any destination addresses that route through the static route.

smothuku
Level 7
Level 7

The practical implication of configuring the ip route 0.0.0.0 0.0.0.0 ethernet 1/2 command is that the router will consider all of the destinations that the router does not know how to reach through some other route as directly connected to Ethernet interface 1/2. So the router will send an ARP request for each host for which it receives packets on this network segment. This configuration can cause high processor utilization and a large ARP cache (along with memory allocation failures). Configuring a default route or other static route that directs the router to forward packets for a large range of destinations to a connected broadcast network segment can cause your router to reload.

Specifying a numerical next hop that is on a directly connected interface will prevent the router from using proxy ARP. However, if the interface with the next hop goes down and the numerical next hop can be reached through a recursive route, you may specify both the next hop and interface (for example, ip route 0.0.0.0 0.0.0.0 ethernet 1/2 10.1.2.3) with a static route to prevent routes from passing through an unintended interface.

The track number keyword and argument combination specifies that the static route will be installed only if the state of the configured track object is up.

Examples

The following example chooses an administrative distance of 110. In this case, packets for network 10.0.0.0 will be routed to a router at 172.31.3.4 if dynamic information with an administrative distance less than 110 is not available.

ip route 10.0.0.0 255.0.0.0 172.31.3.4 110

Note Specifying the next hop without specifying an interface when configuring a static route can cause traffic to pass through an unintended interface if the default interface goes down.

--------------------------------------------------------------------------------

The following example routes packets for network 172.31.0.0 to a router at 172.31.6.6:

ip route 172.31.0.0 255.255.0.0 172.31.6.6

The following example routes packets for network 192.168.1.0 directly to the next hop at 10.1.2.3. If the interface goes down, this route is removed from the routing table and will not be restored unless the interface comes back up.

ip route 192.168.1.0 255.255.0.0 Ethernet 0 10.1.2.3

Thanks,

Satish

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card