This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Modify Host Definition and enable/disable NAT rule via command line

Hi,

is it possible to modify the IP address of an existing host definition via command line? 
Additionally is it possible to enable/disable NAT rules via command line?
Could it be done via cc?

EDIT: Reason: I need to change these values automatically through a script.


Thanks in advance

Dino


This thread was automatically locked due to age.
Parents
  • Proceed at your own risk, or at the very least none to me.  Make backups, work within your change management processes and maintenance windows after testing in an appropriate environment.

    Changing host definition IP address from the command line.

    Find the desired REF by IP address (10.0.0.1 used as example)
    cc get_objects_filtered '$_->{data}->{address} eq "10.0.0.1"'


    Change IP for desired REF (10.0.0.2 used as example address).
    cc change_object REF_NetHosWhatever address '10.0.0.2'



    NAT rule enabling/disabling from the command line.

    Get the REFs for your NAT rules.
    cc get nat rules


    Verify each NAT REF is what you think it is.
    cc get_object REF_PacNatWhatever


    Disable desired NAT rule by REF:
    cc change_object REF_PacNatWhatever status 0


    Enable desired NAT rule by REF:
    cc change_object REF_PacNatWhatever status 1



    Please let me know how these work for you.
Reply
  • Proceed at your own risk, or at the very least none to me.  Make backups, work within your change management processes and maintenance windows after testing in an appropriate environment.

    Changing host definition IP address from the command line.

    Find the desired REF by IP address (10.0.0.1 used as example)
    cc get_objects_filtered '$_->{data}->{address} eq "10.0.0.1"'


    Change IP for desired REF (10.0.0.2 used as example address).
    cc change_object REF_NetHosWhatever address '10.0.0.2'



    NAT rule enabling/disabling from the command line.

    Get the REFs for your NAT rules.
    cc get nat rules


    Verify each NAT REF is what you think it is.
    cc get_object REF_PacNatWhatever


    Disable desired NAT rule by REF:
    cc change_object REF_PacNatWhatever status 0


    Enable desired NAT rule by REF:
    cc change_object REF_PacNatWhatever status 1



    Please let me know how these work for you.
Children
No Data