Exemplo n.º 1
0
        /// <summary>
        /// Disable a SNAT Rule.
        /// </summary>
        /// <param name="networkRule"></param>
        /// <exception cref="Exception"></exception>
        public void DisableSourceNetworkAddressTranslation(NetworkRule networkRule)
        {
            // Check if we have the right rule.
            if (networkRule.Type != NetworkRuleType.SourceNetworkAddressTranslation)
            {
                throw FirewallExceptions.NetworkRuleMismatchException();
            }

            // Safely delete the rule.
            DeleteRule(networkRule);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Disable a MASQ rule.
        /// </summary>
        /// <param name="networkRule"></param>
        /// <exception cref="Exception"></exception>
        public void DisableMasquerade(NetworkRule networkRule)
        {
            // Check if we have the right rule.
            if (networkRule.Type != NetworkRuleType.Masquerade)
            {
                throw FirewallExceptions.NetworkRuleMismatchException();
            }

            // Delete the rule
            DeleteRule(networkRule);
        }