OSPF/Examples/Example 1:Basic LAN configuration

From ImageStream Router Documentation

< OSPF | Examples(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
:This is meant to be an example, and ''not'' a complete OSPF (Open Shortest Path First) routing configuration.
:This is meant to be an example, and ''not'' a complete OSPF (Open Shortest Path First) routing configuration.
===Scenario===
===Scenario===
-
: You have a main router, connected by fiber to three  
+
: You have a main router, connected by fiber to three satellite routers each of which have a LAN on a different subnet.
===Network Diagram===
===Network Diagram===
Line 7: Line 7:
       |
       |
       | Link to the internet
       | Link to the internet
 +
+--------------+
 +
+ Main Router  +
 +
+--------------+
 +
      | 192.168.1.254/24
       |
       |
-
+--------------+ 192.168.13.0/32    +-------------------+
+
+--------------+     192.168.1.3/24 +-------------------+
-
| Main Router  |--------------------| Site number three |
+
| Switch      |--------------------| Site number three |
-
|              |<-.1          .2 ->|                  |
+
|              |                   |                  |
|              |----------+        |                  |
|              |----------+        |                  |
+--------------+<-.1      |        +-------------------+
+--------------+<-.1      |        +-------------------+
-
.1 ^ |                  |               
+
      |                  |               
-
       | 192.168.11.0/32  | 192.168.11.0/32
+
       |                  | 192.168.1.2/24
-
.2 v |                  |    +-------------------+
+
      |192.168.1.2/24    |    +-------------------+
+-----------------+      +-----| Site number two  |               
+-----------------+      +-----| Site number two  |               
-
| Site number one |       .2 ->|                  |
+
| Site number one |             |                  |
|                |            |                  |
|                |            |                  |
|                |            +-------------------+
|                |            +-------------------+
Line 35: Line 39:
:OSPF service is now enabled on boot and running.
:OSPF service is now enabled on boot and running.
-
:In our example above, we will be configuring the "Main Router". From the Quagga/Zebra menu, choose Option 1 (Quagga configuration). Then select Option 4 (bgp configuration). This will connect to the Quagga command line, the default password is zebra. then type ''en'' to become administrator and type in the following configuration:
+
:In our example above, we will be configuring the "Main Router". From the Quagga/Zebra menu, choose Option 1 (Quagga configuration). Then select Option 3 (ospf configuration). This will connect to the Quagga command line, the default password is zebra. then type ''en'' to become administrator and type in the following configuration:
<pre>
<pre>
 +
# This configuration is for the all four routers.
!
!
-
# This ASN is for testing and internal use *ONLY*
+
hostname ospfd
-
router bgp 64512
+
password zebra
-
bgp router-id 192.168.10.5
+
log stdout
-
bgp log-neighbor-changes
+
-
network 192.168.10.0/24
+
-
 
+
-
# Begin configuration for ISP 1
+
-
neighbor 172.16.96.76 remote-as 64513
+
-
neighbor 172.16.96.76 soft-reconfiguration inbound
+
-
neighbor 172.16.96.76 description ISP 1
+
-
neighbor 172.16.96.76 route-map rm_peer_1_in in
+
-
neighbor 172.16.96.76 route-map rm_peer_1_out out
+
-
 
+
-
# Begin configuration for ISP 2
+
-
neighbor 10.200.10.3 remote-as 514
+
-
neighbor 10.200.10.3 soft-reconfiguration inbound
+
-
neighbor 10.200.10.3 description ISP 2
+
-
neighbor 10.200.10.3 route-map rm_peer_2_in in
+
-
neighbor 10.200.10.3 route-map rm_peer_2_out out
+
-
!
+
-
ip prefix-list pl_peer_1_out seq 5 permit 192.168.10.0/24
+
-
ip prefix-list pl_peer_2_out seq 5 permit 192.168.10.0/24
+
-
!
+
-
route-map rm_peer_1_out permit 5
+
-
match ip address prefix-list pl_peer_1_out
+
-
set as-path prepend 64512
+
-
!
+
-
route-map rm_peer_1_in permit 5
+
-
# Adjust this to favor some peers over others.
+
-
#  Higher number is more preferred
+
-
#  0 - 255 with 100 being the default
+
-
set local-preference 100
+
-
!
+
-
route-map rm_peer_2_out permit 5
+
-
match ip address prefix-list pl_peer_2_out
+
-
set as-path prepend 64512
+
!
!
-
route-map rm_peer_2_in permit 5
+
router ospf
-
  # Adjust this to favor some peers over others.
+
  ospf router-id 192.168.10.1
-
  #  Higher number is more preferred
+
  redistribute connected
-
  0 - 255 with 100 being the default
+
  network 192.168.1.0/24 area 0.0.0.0
-
set local-preference 100
+
!
!
 +
line vty
</pre>
</pre>
'''Remember to save your configurations to flash whenever you are finished configuring your dynamic routing setup!'''
'''Remember to save your configurations to flash whenever you are finished configuring your dynamic routing setup!'''

Latest revision as of 21:39, 1 December 2008

This is meant to be an example, and not a complete OSPF (Open Shortest Path First) routing configuration.

Scenario

You have a main router, connected by fiber to three satellite routers each of which have a LAN on a different subnet.

Network Diagram

      |
      | Link to the internet
+--------------+
+ Main Router  +
+--------------+
      | 192.168.1.254/24
      |
+--------------+     192.168.1.3/24 +-------------------+
| Switch       |--------------------| Site number three |
|              |                    |                   |
|              |----------+         |                   |
+--------------+<-.1      |         +-------------------+
      |                   |              
      |                   | 192.168.1.2/24
      |192.168.1.2/24     |     +-------------------+
+-----------------+       +-----| Site number two   |              
| Site number one |             |                   |
|                 |             |                   |
|                 |             +-------------------+
+-----------------+
Remember to save your configurations to flash whenever you are finished configuring your dynamic routing setup! To enable OSPF, do the following:
  1. At the Login: prompt, enter root.
  2. At the Password: prompt, enter your password.
  3. Choose Option 1 (Configuration and Update Menu) from the Main Menu.
  4. Select Option 6 (Dynamic Routing Configuration).
  5. Select Option 2 (Quagga/Zebra)
  6. Select Option 2 (enable) and enable both Quagga/Zebra and ospfd.
  7. Go back up to the main Quagga/Zebra menu
  8. Select Option 4 (start) and start both Quagga/Zebra and ospfd.
OSPF service is now enabled on boot and running.
In our example above, we will be configuring the "Main Router". From the Quagga/Zebra menu, choose Option 1 (Quagga configuration). Then select Option 3 (ospf configuration). This will connect to the Quagga command line, the default password is zebra. then type en to become administrator and type in the following configuration:
# This configuration is for the all four routers.
!
hostname ospfd
password zebra
log stdout
!
router ospf
 ospf router-id 192.168.10.1
 redistribute connected
 network 192.168.1.0/24 area 0.0.0.0
!
line vty

Remember to save your configurations to flash whenever you are finished configuring your dynamic routing setup!

Personal tools
Router software releases