[Xorp-users] help, about OSPF configuration

Ray Soucy rps at maine.edu
Thu Sep 9 08:12:50 PDT 2010


One thing to watch out for when just advertising all "connected"
routes is that you don't inadvertently advertise networks that you
don't want to (e.g. RFC 1918, Loopback, Default, etc.)

So you could do something like:

protocols {
    ospf4 {
		/* Snip. */
        export: "OSPF_Export"
    }
}
policy {
    policy-statement "OSPF_Export" {
        term 100 {
            from {
                protocol: "connected"
                network4-list: "Loopback"
            }
            then {
                reject {
                }
            }
        }
        term 101 {
            from {
                protocol: "connected"
                network4-list: "RFC_1918"
            }
            then {
                reject {
                }
            }
        }
        term 102 {
            from {
                protocol: "connected"
                network4-list: "Default_Route"
            }
            then {
                reject {
                }
            }
        }
        term 103 {
            from {
                protocol: "connected"
            }
            then {
                accept {
                }
            }
        }
        then {
            reject {
            }
        }
    }
	network4-list "Loopback" {
        network 127.0.0.0/8 {
            modifier: "orlonger"
        }		
	}
    network4-list "RFC_1918" {
        network 10.0.0.0/8 {
            modifier: "orlonger"
        }
        network 172.16.0.0/12 {
            modifier: "orlonger"
        }
        network 192.168.0.0/16 {
            modifier: "orlonger"
        }
    }
    network4-list "Default_Route" {
        network 0.0.0.0/0
    }
}

But a cleaner way might be to make a network4-list of the prefixes you
_do_ want advertised, and only export connected routes that match that
list.  Really depends on your operational model.

The policy code is a bit buggy in 1.6, so be careful... you'll want to
run some packet captures and make sure that what you tell XORP to do
is actually being done.  I haven't tested it much in the CT branch
yet, but it's on my to-do list.

On Tue, Sep 7, 2010 at 4:35 PM, Jeff Mitchell <jmitchell at ll.mit.edu> wrote:
> On 09/07/2010 01:55 PM, Jeff Mitchell wrote:
>> On 05/27/2010 01:14 PM, Ben Greear wrote:
>>> On 05/27/2010 08:01 AM, wubaochuan wrote:
>>>> hello everyone,
>>>> When I configure OSPF, I have the following problems.
>>>>
>>>> All the following four machine run Fedora 12, and the first one and the
>>>> fourth one run as hosts, the second and
>>>> the third run as routers.
>>>
>>> I think you just need to add a policy to export connected routes
>>> to OSPF.  I'll post an example later today if you don't find something
>>> sooner.
>>
>> I didn't see a reply to this and currently have the same trouble. I'd
>> like to distribute my local (kernel) routes through OSPF. I managed to
>> create an export policy that will distribute them one-hop ("blah" below)
>> but I can't seem to get them distributed more than one hop away ("blah2"
>> below was an attempt at that).
>>
>> In the following configs, this router is in the middle between two other
>> routers; it correctly sees the locally-connected routes from both of the
>> two end-routers, but the two end-routers do not see the routes to each
>> others' locally connected routes.
>
> After restarting xorp on all boxes, this now seems to be working fine
> with only the first bit ("blah") below. Not sure why it didn't work the
> first time, but sorry for the noise.
>
> --Jeff
>
>> policy {
>>       policy-statement blah {
>>           term blah {
>>               from {
>>                   protocol: "connected"
>>               }
>>               to {
>>                   network4: 128.0.0.0/8
>>               }
>>               then {
>>                   accept {
>>                   }
>>               }
>>           }
>>       }
>> }
>
> _______________________________________________
> Xorp-users mailing list
> Xorp-users at xorp.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-users
>



-- 
Ray Soucy

Epic Communications Specialist

Phone: +1 (207) 561-3526

Networkmaine, a Unit of the University of Maine System
http://www.networkmaine.net/



More information about the Xorp-users mailing list