DBSET=/bin/dbset DBGET=/bin/dbget ........... # configure new ip for interface # $1 - interface name # $2 - ip # $3 - mask set_ip() { local cip # get current ip cip=$(dbget -c interface:$1:ipaddr) # if interface configured, delete old ip first if [[ ! -z $cip ]]; then log "Configure IPv4 - remove old ip:$cip from $1" $DBSET interface:$1:ipaddr:$cip $DBSET interface:$1:ipaddr:$cip:mask fi # now configure new ip/mask log "Configure IPv4 - interface:$1, new ip:$2, mask:$3" $DBSET interface:$1:state on $DBSET interface:$1:ipaddr:$2 t $DBSET interface:$1:ipaddr:$2:mask $3 } ........ $DBSET :save
[Expert@Gaia_R77.10_test:0]# cat /config/db/initial | grep eth0 management:interface eth0 interface:eth0 t interface:eth0:link_speed 1000M/full interface:eth0:state on interface:eth0:ipaddr:192.168.1.2 t interface:eth0:ipaddr:192.168.1.2:mask 24 interface:eth0:duplicity full interface:eth0:speed 1000M interface:eth0:auto_negotiation on
[Expert@Gaia_R77.10_test:0]# dbget -c interface:eth0:ipaddr 192.168.1.2
[Expert@Gaia_R77.10_test:0]# dbget -cv interface:eth0:ipaddr 192.168.1.2 t
[Expert@Gaia_R77.10_test:0]# dbset interface:eth0:ipaddr:192.168.1.2 [Expert@Gaia_R77.10_test:0]# dbset interface:eth0:ipaddr:192.168.1.2:mask
[Expert@Gaia_R77.10_test:0]# dbset interface:eth0:ipaddr:192.168.1.1 t
[Expert@Gaia_R77.10_test:0]# dbset interface:eth0:ipaddr:192.168.1.1:mask 24
[Expert@Gaia_R77.10_test:0]# dbset :save
Gaia_R77.10_test> config_system "hostname=myhost&domainname=somedomain.com&timezone='UTC-3'&ftw_sic_key=aaaa&install_security_gw=true&gateway_daip=false&install_ppak=true&gateway_cluster_member=true&install_security_managment=false"
[Expert@Gaia_R77.10_test:0]# config_system -t /home/admin/initial.conf
######################################################################### # # # Products configuration # # # # For keys below set "true"/"false" after '=' within the quotes # ######################################################################### # Install Security Gateway. install_security_gw= # Install Acceleration Blade (aka Performance Pack). install_ppak= # Enable DAIP (dynamic ip) gateway. # Should be "false" if CXL or Security Management enabled gateway_daip="false" # Enable/Disable CXL. gateway_cluster_member= # Install Security Management. install_security_managment= # Optional parameters, only one of the parameters below can be "true". # If no primary of secondary specified, log server will be installed. # Requires Security Management to be installed. install_mgmt_primary= install_mgmt_secondary= # Provider-1 paramters # eg: install_mds_primary=true # install_mds_secondary=false # install_mlm=false # install_mds_interface=eth0 install_mds_primary= install_mds_secondary= install_mlm= install_mds_interface= # Automatically download Blade Contracts and other important data (highly recommended) # It is highly recommended to keep this setting enabled, to ensure smooth operation of Check Point products. # for more info see sk94508 # # possible values: "true" / "false" download_info="true" # Improve product experience by sending data to Check Point # If you enable this setting, the Security Management Server and Security Gateways may upload data that will # help Check Point provide you with optimal services. # for more info see sk94509 # # possible values: "true" / "false" upload_info="false" # In case of Smart1 SmartEvent appliance, choose # Security Management only, log server will be installed automatically ######################################################################### # # # Products Parameters # # # # For keys below set value after '=' # ######################################################################### # Management administrator name # Must be provided, if Security Management installed mgmt_admin_name= # Management administrator password # Must be provided, if Security Management installed mgmt_admin_passwd= # Management GUI client allowed eg any, 1.2.3.4, 192.168.0.0/24 # Set to "any" if any host allowed to connect to managment # Set to "range" if range of IPs allowed to connect to management # Set to "network" if IPs from specific network allowed to connect # to management # Set to "this" if it' a single IP # Must be provided if Security Management installed mgmt_gui_clients_radio= # # In case of "range", provide the first and last IPs in dotted format mgmt_gui_clients_first_ip_field= mgmt_gui_clients_last_ip_field= # # In case of "network", provide IP in dotted format and netmask length # in range 0-32 mgmt_gui_clients_ip_field= mgmt_gui_clients_subnet_field= # # In case of a single IP mgmt_gui_clients_hostname= # Secure Internal Communication key, eg "aaaa" # Must be provided, if primary Security Management not installed ftw_sic_key= ######################################################################### # # # Operating System configuration - optional section # # # # For keys below set value after '=' # ######################################################################### # Password (hash) of user admin. # To get hash of admin password from configured system: # dbget passwd:admin:passwd # OR # grep admin /etc/shadow | cut -d: -f2 # # IMPORTANT! In order to preserve the literal value of each character # in hash, inclose hash string within the quotes. # eg admin_hash='put_here_your_hash_string' # # Optional parameter admin_hash='' # Interface name, optional parameter iface= # Management interface IP in dotted format (eg 1.2.3.4), # management interface mask length (in range 0-32, e,g 24 ) and # default gateway. # Pay attention, that if you run first time configuration remotely # and you change IP, in order to maintain the connection, # an old IP address will be retained as a secondary IP address. # This secondary IP address can be delete later. # Your session will be disconnected after first time condiguration # process. # Optional prameter, requires "iface" to be specified # IPv6 address format: 0000:1111:2222:3333:4444:5555:6666:7777 # ipstat_v4 manually/off ipstat_v4= ipaddr_v4= masklen_v4= default_gw_v4= ipstat_v6= ipaddr_v6= masklen_v6= default_gw_v6= # Host Name eg host123, optional parameter hostname= # Domain Name eg checkpoint.com, optional parameter domainname= # Time Zone in format Area/Region (eg America/New_York or Etc/GMT-5) # Pay attention that GMT offset should be in classic UTC notation: # GMT-5 is 5 hours behind UTC (ie west to Greenwich) # Inclose time zone string within the quotes. # Optional parameter timezone='' # NTP servers # NTP parameters are optional ntp_primary= ntp_primary_version= ntp_secondary= ntp_secondary_version= # DNS - IP address of primary, secondary, tertiary DNS servers # DNS parameters are optional. primary= secondary= tertiary=
install_security_managment="true" mgmt_admin_name=admin mgmt_admin_passwd=password mgmt_gui_clients_radio="network" mgmt_gui_clients_ip_field=192.168.1.0 mgmt_gui_clients_subnet_field=24 admin_hash='HASH_OF_ADMIN_PASSWORD' install_mgmt_primary="true" iface=eth0 ipstat_v4=manual ipaddr_v4=192.168.1.1 masklen_v4=24 default_gw_v4=192.168.1.254 ipstat_v6=off hostname=Gaia_R77.10_MGMT timezone='Etc/GMT+3' primary=8.8.8.8
install_security_gw="true" admin_hash='HASH_OF_ADMIN_PASSWORD' iface=eth0 ipstat_v4=manual ipaddr_v4=192.168.1.2 masklen_v4=24 default_gw_v4=192.168.1.254 ipstat_v6=off hostname=Gaia_R77.10_FW1 timezone='Etc/GMT+3' ftw_sic_key='onetimepassword' primary=8.8.8.8
[Expert@Gaia_R77.10_test:0]# config_system -f /home/admin/initial.conf
Source: https://habr.com/ru/post/259821/
All Articles