Home arrow Security arrow Security arrow Modifying Huge ACL & prefix- list ?

Google Translation


Login Form






Lost Password?
No account yet? Register

Advertisements


Who's Online

Modifying Huge ACL & prefix- list ? PDF Print E-mail
Written by Chris   


Probably, there are multiple way to achieve your goal.
Here is one of simple way that I knew and used in my work. (using vi editor)


For example, you have IP blocks below. Current prefix list name = Hello

-- Raw list --
1.1.1.1/24
2.2.2.2/23
3.3.3.3/22
4.4.4.4/21
5.5.5.5/20
6.6.6.6/19
:
:
:



1. Create new file with vi editor = from prompt "vi acl" (on unix or linux)
2. Copy and paste entire list of new IP blocks into the new file just created
3. To add "ip prefix-list Hello permit" in front of raw IP blocks, follow below steps


:%s/^/ip prefix-list Hello permit /g
(If you are not familiar with vi editor, search 'vi editor' on Internet)


Now, you will see the below

ip prefix-list Hello permit 1.1.1.1/24
ip prefix-list Hello permit 2.2.2.2/23
ip prefix-list Hello permit 3.3.3.3/22
ip prefix-list Hello permit 4.4.4.4/21
ip prefix-list Hello permit 5.5.5.5/20
ip prefix-list Hello permit 6.6.6.6/19
:
:


4. To add "le 32" or any option, follow below steps

:%s/\/24/\/24 le 32/g <------- it will modify /24 IP block



ip prefix-list Hello permit 1.1.1.1/24 le 32
ip prefix-list Hello permit 2.2.2.2/23
ip prefix-list Hello permit 3.3.3.3/22
ip prefix-list Hello permit 4.4.4.4/21
ip prefix-list Hello permit 5.5.5.5/20
ip prefix-list Hello permit 6.6.6.6/19



5. Using the blow commands, complete modifying entire IP blocks.


:%s/\/32/\/32 orlonger;/g
:%s/\/30/\/30 orlonger;/g
:%s/\/29/\/29 orlonger;/g
:%s/\/28/\/28 orlonger;/g
:%s/\/27/\/27 orlonger;/g
:%s/\/26/\/26 orlonger;/g
:%s/\/25/\/25 orlonger;/g
:%s/\/24/\/24 orlonger;/g
:%s/\/23/\/23 orlonger;/g
:%s/\/22/\/22 orlonger;/g
:%s/\/21/\/21 orlonger;/g
:%s/\/20/\/20 orlonger;/g
:%s/\/19/\/19 orlonger;/g
:%s/\/18/\/18 orlonger;/g
:%s/\/17/\/17 orlonger;/g
:%s/\/16/\/16 orlonger;/g
:%s/\/15/\/15 orlonger;/g
:%s/\/14/\/14 orlonger;/g
:%s/\/13/\/13 orlonger;/g
:%s/\/12/\/12 orlonger;/g
:%s/\/11/\/11 orlonger;/g
:%s/\/10/\/10 orlonger;/g



Final IP blocks look like below

ip prefix-list Hello permit 1.1.1.1/24 le 32
ip prefix-list Hello permit 2.2.2.2/23 le 32
ip prefix-list Hello permit 3.3.3.3/22 le 32
ip prefix-list Hello permit 4.4.4.4/21 le 32
ip prefix-list Hello permit 5.5.5.5/20 le 32
ip prefix-list Hello permit 6.6.6.6/19 le 32



It is help only huge huge huge list of access list or prefix list.
After modifed raw IP list, add it to current access list or prefix





Add as favourites (20) | Views: 217 | E-mail

  Be first to comment this article
RSS comments

Write Comment
  • Please keep the topic of messages relevant to the subject of the article.
  • Personal verbal attacks will be deleted.
  • Please don't use comments to plug your web site. Such material will be removed.
  • Just ensure to *Refresh* your browser for a new security code to be displayed prior to clicking on the 'Send' button.
  • Keep in mind that the above process only applies if you simply entered the wrong security code.
Name:
E-mail
Title:
BBCode:Web AddressEmail AddressBold TextItalic TextUnderlined TextQuoteCodeOpen ListList ItemClose List
Comment:



Code:* Code

Powered by AkoComment Tweaked Special Edition v.1.4.3




Please share this article with ;
Reddit!Del.icio.us!Google!Live!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!Spurl!Wists!Simpy!Newsvine!Blinklist!Fark!Yahoo!Netvouz!RawSugar!Ma.gnolia!Squidoo!Free social bookmarking plugins and extensions for Joomla! websites!
 
< Prev   Next >

Sponsored Links


Sponsor II


What's your IP?

You are connecting to this site from: 38.103.63.16

Related Articles