gabstopper / smc-python

Forcepoint Security Management Center python library:(Moved to official Forcepoint repo)
https://github.com/Forcepoint/fp-NGFW-SMC-python
Apache License 2.0
29 stars 13 forks source link

AS Path Prepend in RouteMap #59

Closed EtienneMILON closed 5 years ago

EtienneMILON commented 5 years ago

Hi David,

I try to add an AS Path Prepend in a Route Map rule, I cannot find it with smc-python: image image

Is it possible?

Best Regards, Etienne

gabstopper commented 5 years ago

Hi, I will add an interface for this but it is still currently possible to do. Here is an example:

prefix_list = IPPrefixList('testiplist')
routemap = RouteMap('testroutemap')
# Create a route map rule
rule = routemap.route_map_rules.create(name='rule1', access_list=prefix_list)
# Now update
rule.update(route_entry_settings={'as_path_type': 'prepend', 'as_number': [{'expression': '123456789'}]})

as_path_type specifies the action (dont_modify/prepend/exclude). If prepend or exclude are specified you will need the as_number attribute as well.

Let me know if that works for you and I'll add a cleaner way to do this from the route map rule.

David

EtienneMILON commented 5 years ago

Hi David,

Thanks for your answer. It works for me.

Etienne