Quantcast
Channel: IEOC - INE's Online Community
Viewing all articles
Browse latest Browse all 10672

Cisco SVI Sequence Configuration Generator

$
0
0

 

Hi.

 

If you ever need to generate a large number of sequential SVI configuration, try this Python script.

It can be easily tweaked for physical interfaces instead of SVIs.

 

 

https://gist.github.com/ArtiomL/5484454

 

 

Usage: ./CONFIG_GEN.py {First SVI Number} {Base IP Address/CIDR} {IP Address Octet Number to Rotate} {Last SVI Number} [Additional Config Lines devided by '+']

 

Examples:

./CONFIG_GEN.py 100 192.168.100.254/24 3 113

./CONFIG_GEN.py 13 10.13.1.254/16 2 17

./CONFIG_GEN.py 13 10.13.1.254/16 2 17 'no ip unreachables'

./CONFIG_GEN.py 13 10.13.1.254/16 2 17 'no ip unreachables+ip router ospf 1 area 0+no shut'

 

Result:

interface Vlan13

ip address 10.13.1.254 255.255.0.0

no ip unreachables

ip router ospf 1 area 0

no shut

 

interface Vlan14

ip address 10.14.1.254 255.255.0.0

no ip unreachables

ip router ospf 1 area 0

no shut

 

interface Vlan15

ip address 10.15.1.254 255.255.0.0

no ip unreachables

ip router ospf 1 area 0

no shut

 

interface Vlan16

ip address 10.16.1.254 255.255.0.0

no ip unreachables

ip router ospf 1 area 0

no shut

 

interface Vlan17

ip address 10.17.1.254 255.255.0.0

no ip unreachables

ip router ospf 1 area 0

no shut

 

 

Enjoy and comment.

 


Viewing all articles
Browse latest Browse all 10672