yurisk.info

Yuri Slobodyanyuk's blog on IT Security and Networking sharing experience and expertise

Convert Checkpoint SPLAT routes into Gaia configuration commands

Hi there, not much of a script , just the one-liner to turn output of the Secure Platform cli command route/ip route list into the ready for copy&paste list of Gaia clish commands.
Be aware I am not doing any error checking, so examine the final result before applying to a production system.
See ya.
You should run it on SPLAT cli being in expert mode.

ip route list | awk ‘/via/ {print " set static-route ",$1," nexthop gateway address " $3," on "}’

set static-route 172.19.0.0/16 nexthop gateway address 172.12.255.4 on
set static-route 172.20.0.0/16 nexthop gateway address 10.20.20.6 on
set static-route default nexthop gateway address 19.9.15.33 on



3 Comments

  1. Thanks you !!!!!!!!!

  2. Jonas Hauge Jensen

    April 28, 2014 at 12:53 pm

    you can do the same for interface addresses

    ip addr list | grep inet | sed s/\\//’ ‘/ | awk ‘{print “set interface ” $8 ” ipv4-address ” $2 ” mask-length ” $3}’

    and vlan interfaces – this is a dirty hack which also includes interfaces without vlan-tags but are easily removed:

    ip addr list | grep inet | grep -v 127.0.0 | sed s/\\./’ ‘/g | awk ‘{print “add interface ” $13 ” vlan ” $14}’

  3. Yuri

    April 28, 2014 at 9:55 pm

    Thanks Jonas!
    I actually thought of including interfaces but then doubted as not to do any harm – if switching not only to Gaia but also to another machine, names of the NICs will be different and someone just copy-pasting …

Comments are closed.

© 2016 yurisk.info

Theme by Anders NorenUp ↑