Skip to content

set interface method question #5

Description

@PetruGarstea

Greetings,
I am unable to figure out on how to set the NAT network interface for the following pf rule

nat on ${NIC} inet from any to any -> (${NIC}0) round-robin

nat rule code snippet

	var natRule pf.Rule
	natRule.SetAction(pf.ActionNAT)
	natRule.SetDirection(pf.DirectionOut)
	natRule.SetProtocol(pf.ProtocolAny)
	natRule.SetState(pf.StateKeep)
	natRule.SetQuick(true)
	natRule.SetAddressFamily(pf.AddressFamilyInet)
	_ = natRule.ParseDestination("any", "0:65535", false)
        _ = natRule.ParseSource("any", "0:65535", false)

At this moment the library handles the rule as the bellow output, and the network interface part is missing, looking forward to finding the correct method that addresses this issue.
nat out quick inet from 0.0.0.0/32 port 0:65535 to 0.0.0.0/32 port 0:65535 keep state

Thanks,
Petru

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions