MCPcopy Index your code
hub / github.com/coder/coder / iptablesMasqueradeNonUDP

Function iptablesMasqueradeNonUDP

tailnet/test/integration/network.go:818–830  ·  view source on GitHub ↗
(t *testing.T, netNS *os.File)

Source from the content-addressed store, hash-verified

816}
817
818func iptablesMasqueradeNonUDP(t *testing.T, netNS *os.File) {
819 t.Helper()
820 _, err := commandInNetNS(netNS, "iptables", []string{
821 "-t", "nat",
822 "-A", "POSTROUTING",
823 // Every interface except loopback.
824 "!", "-o", "lo",
825 // Every protocol except UDP.
826 "!", "-p", "udp",
827 "-j", "MASQUERADE",
828 }).Output()
829 require.NoError(t, wrapExitErr(err), "add iptables non-UDP masquerade rule")
830}
831
832// iptablesNAT sets up iptables rules for NAT forwarding. If destIP is
833// specified, the forwarding rule will only apply to traffic to/from that IP

Callers 1

SetupNetworkingMethod · 0.85

Calls 4

commandInNetNSFunction · 0.85
wrapExitErrFunction · 0.85
HelperMethod · 0.65
OutputMethod · 0.65

Tested by

no test coverage detected