How to Setup Static Routes in RIP and OSPF
Step1 : In inter-networks, Static Routes can be set for any scenario having a minimum of 3 routers, 2 switches and 3 wired nodes. The easiest way to do this is to first run the scenario with routing protocol set as RIP/OSPF and save the Configuration file
Step 2 : Open the Configuration file with Visual studio. Expand the Router configuration and set the Static Routing information in Application Layer property of the device, by enabling the Static routing status. Then set the appropriate Static routing file name and file path.
1. Update this information in any one of the router
2. A sample StaticRouting.txt file will be available inside “C:\Program Files\NetSim standard\Docs\Sample_Configuration\Internetworks”. Appropriately modify it for the scenario.
The StaticRouting.txt file contains
1. Device Id of the Router
2. List of entries to add in the routing table
ip route 192.168.0.0 255.255.255.0 192.168.0.1 
ip route 192.168.1.0 255.255.255.0 192.168.1.1 
ip route 192.168.2.0 255.255.255.0 192.168.2.1 
ip route 192.168.3.0 255.255.255.0 192.168.3.1 
The above format is per standard Cisco command for static routes
ip route dest_ip mask gateway_ip [distance ]
1. The ip route is the Cisco command to add the static route
2. The dest_ip is the Network address for the destination network
3. The mask is the Subnet mask for the destination network
4. The gateway_ip is the IP address of the next-hop router
5. The distance is the administrative distance for the route. The default is 1 .
Step 3 : After this, run this configuration file through CLI and static routes will be used for routing.