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

masq object+rule not working via confd-client.plx

Previously, we've ocnfigured our UTMs running in Amazon with a post-install script.  This command worked fine when the previous UTMs were built a few months ago, but now there is a new Sophos UTM AMI, and the following attempt to configure masquerading no longer works:

 MASQ=$(cat  '1', 'class' => 'packetfilter', 'data' => { 'additional_address' => '', 'comment' => '', 'name' => 'from VPC CIDR Private to Public-External', 'source' => 'REF_NetNetVpcCidrPriva', 'source_nat_interface' => 'REF_IntCabPublicexte', 'status' => 1 }, 'hidden' => 0, 'lock' => '', 'nodel' => '', 'ref' => 'REF_PacMasFromVpcCidr', 'type' => 'masq' }
EOF
)

... and then the MASQ variable is stuffed into another confd-clientx.plx command to create a masq rule.

Here is the error I get when I execute the above command:

{
          'Aattrs' => [
                        'class',
                        'type',
                        'attr'
                      ],
          'Cattrs' => [
                        'goodclass'
                      ],
          'Oattrs' => [
                        'class',
                        'type'
                      ],
          'attr' => 'source_nat_interface',
          'attrs' => [],
          'badref' => 'REF_IntCabPublicexte',
          'check' => 'input',
          'class' => 'packetfilter',
          'fatal' => 1,
          'format' => 'The %_O object needs %_C objects for the %_A attribute.',
          'goodclass' => 'interface',
          'msgtype' => 'OBJECT_OBJECT_BADREF',
          'name' => 'The masquerading rule object needs interface objects for the outgoing interface attribute.',
          'never_hide' => 0,
          'ref' => 'REF_PacMasFromVpcCidr',
          'type' => 'masq'
        }


Unfortunately, the docs for confd-clientx are sparse, so I am struggling to RTFM.

Thanks,
Pete the Pharmboy


This thread was automatically locked due to age.
  • This problem was due to an unconfigured external interface.  I think the masq config will work when my "Public-External" comes up.  This is the warning msg in confd-debug.log that I'm currently debugging:

    2015:05:27-13:27:50 host confd[6155]: W Message::err_set:1100() => id="3100" severity="warn" sys="System" sub="confd" name="OBJECT_SET_INVALID (Cannot set object, object type does not exist or object data is missing.)" class="interface" type="cable" user="system" srcip="127.0.0.1" facility="system" client="confd-client.pl" call="set_object" objdata="$VAR1 = {'primary_address' => 'REF_ItfPriPublicexte','status' => 1,'itfhw' => 'REF_ItfEthEth1XenNetwo','name' => 'Public-External'};"
  • Found the root cause!  When creating the public, external network interface in the old Sophos AMI, one of the parameter=value pairs in the set_object call was:
              'type' => 'cable'

    This created an object called REF_IntCabPublicexte for this interface that was called "Public-External"

    In the new AMI (ami-3ee3e656), 'type'=>'cable' is not valid, so I switched it to:
                  'type' => 'ethernet'

    ... and that changed the object name.  The new object name is REF_IntEthPublicexte, so now my configuration scripts are happy again.

    Hope this helps anyone in a similar situation.

    -Pharmboy
  • Consider adding checks, and/or error detection, to your scripts.  

    If a command is given to create an object then verify the object is created.