(t *testing.T, netNS *os.File)
| 816 | } |
| 817 | |
| 818 | func 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 |
no test coverage detected