istio.io/istio@v0.0.0-20240520182934-d79c90f27776/tools/istio-iptables/pkg/capture/testdata/tproxy.golden (about)

     1  iptables -t nat -N ISTIO_INBOUND
     2  iptables -t nat -N ISTIO_REDIRECT
     3  iptables -t nat -N ISTIO_IN_REDIRECT
     4  iptables -t mangle -N ISTIO_DIVERT
     5  iptables -t mangle -N ISTIO_TPROXY
     6  iptables -t mangle -N ISTIO_INBOUND
     7  iptables -t nat -N ISTIO_OUTPUT
     8  iptables -t raw -N ISTIO_OUTPUT
     9  iptables -t nat -A PREROUTING -i not-istio-nic -j RETURN
    10  iptables -t nat -A OUTPUT -o not-istio-nic -j RETURN
    11  iptables -t mangle -A PREROUTING -i not-istio-nic -j RETURN
    12  iptables -t mangle -A OUTPUT -o not-istio-nic -j RETURN
    13  iptables -t nat -A ISTIO_INBOUND -p tcp --dport 15008 -j RETURN
    14  iptables -t nat -A ISTIO_REDIRECT -p tcp -j REDIRECT --to-ports 15001
    15  iptables -t nat -A ISTIO_IN_REDIRECT -p tcp -j REDIRECT --to-ports 15006
    16  iptables -t mangle -A ISTIO_DIVERT -j MARK --set-mark 1337
    17  iptables -t mangle -A ISTIO_DIVERT -j ACCEPT
    18  iptables -t mangle -A ISTIO_TPROXY ! -d 127.0.0.1/32 -p tcp -j TPROXY --tproxy-mark 1337/0xffffffff --on-port 15006
    19  iptables -t mangle -A PREROUTING -p tcp -j ISTIO_INBOUND
    20  iptables -t mangle -A ISTIO_INBOUND -p tcp -m conntrack --ctstate RELATED,ESTABLISHED -j ISTIO_DIVERT
    21  iptables -t mangle -A ISTIO_INBOUND -p tcp -j ISTIO_TPROXY
    22  iptables -t nat -A OUTPUT -p tcp -j ISTIO_OUTPUT
    23  iptables -t nat -A ISTIO_OUTPUT -o lo -s 127.0.0.6/32 -j RETURN
    24  iptables -t nat -A ISTIO_OUTPUT -o lo ! -d 127.0.0.1/32 -p tcp -m multiport ! --dports 53,15008 -m owner --uid-owner 1337 -j ISTIO_IN_REDIRECT
    25  iptables -t nat -A ISTIO_OUTPUT -o lo -p tcp ! --dport 53 -m owner ! --uid-owner 1337 -j RETURN
    26  iptables -t nat -A ISTIO_OUTPUT -m owner --uid-owner 1337 -j RETURN
    27  iptables -t nat -A ISTIO_OUTPUT -o lo ! -d 127.0.0.1/32 -p tcp ! --dport 15008 -m owner --gid-owner 1337 -j ISTIO_IN_REDIRECT
    28  iptables -t nat -A ISTIO_OUTPUT -o lo -p tcp ! --dport 53 -m owner ! --gid-owner 1337 -j RETURN
    29  iptables -t nat -A ISTIO_OUTPUT -m owner --gid-owner 1337 -j RETURN
    30  iptables -t nat -A ISTIO_OUTPUT -p tcp --dport 53 -d 127.0.0.53/32 -j REDIRECT --to-ports 15053
    31  iptables -t nat -A ISTIO_OUTPUT -d 127.0.0.1/32 -j RETURN
    32  iptables -t nat -A ISTIO_OUTPUT -d 1.1.0.0/16 -j RETURN
    33  iptables -t nat -A ISTIO_OUTPUT -d 9.9.0.0/16 -j ISTIO_REDIRECT
    34  iptables -t nat -A ISTIO_OUTPUT -j RETURN
    35  iptables -t nat -A OUTPUT -p udp -j ISTIO_OUTPUT
    36  iptables -t raw -A OUTPUT -p udp -j ISTIO_OUTPUT
    37  iptables -t nat -A ISTIO_OUTPUT -p udp --dport 53 -m owner --uid-owner 1337 -j RETURN
    38  iptables -t nat -A ISTIO_OUTPUT -p udp --dport 53 -m owner --gid-owner 1337 -j RETURN
    39  iptables -t nat -A ISTIO_OUTPUT -p udp --dport 53 -d 127.0.0.53/32 -j REDIRECT --to-port 15053
    40  iptables -t raw -A ISTIO_OUTPUT -p udp --dport 53 -m owner --uid-owner 1337 -j CT --zone 1
    41  iptables -t raw -A ISTIO_OUTPUT -p udp --sport 15053 -m owner --uid-owner 1337 -j CT --zone 2
    42  iptables -t raw -A ISTIO_OUTPUT -p udp --dport 53 -m owner --gid-owner 1337 -j CT --zone 1
    43  iptables -t raw -A ISTIO_OUTPUT -p udp --sport 15053 -m owner --gid-owner 1337 -j CT --zone 2
    44  iptables -t raw -A ISTIO_OUTPUT -p udp --dport 53 -d 127.0.0.53/32 -j CT --zone 2
    45  iptables -t raw -A PREROUTING -p udp --sport 53 -s 127.0.0.53/32 -j CT --zone 1
    46  iptables -t mangle -A PREROUTING -p tcp -m mark --mark 1337 -j CONNMARK --save-mark
    47  iptables -t mangle -A OUTPUT -p tcp -o lo -m mark --mark 1337 -j RETURN
    48  iptables -t mangle -A OUTPUT ! -d 127.0.0.1/32 -p tcp -o lo -m owner --uid-owner 1337 -j MARK --set-mark 1338
    49  iptables -t mangle -A OUTPUT ! -d 127.0.0.1/32 -p tcp -o lo -m owner --gid-owner 1337 -j MARK --set-mark 1338
    50  iptables -t mangle -A OUTPUT -p tcp -m connmark --mark 1337 -j CONNMARK --restore-mark
    51  iptables -t mangle -I ISTIO_INBOUND 1 -p tcp -m mark --mark 1337 -j RETURN
    52  iptables -t mangle -I ISTIO_INBOUND 2 -p tcp -s 127.0.0.6/32 -i lo -j RETURN
    53  iptables -t mangle -I ISTIO_INBOUND 3 -p tcp -i lo -m mark ! --mark 1338 -j RETURN
    54  ip6tables -t nat -N ISTIO_INBOUND
    55  ip6tables -t nat -N ISTIO_REDIRECT
    56  ip6tables -t nat -N ISTIO_IN_REDIRECT
    57  ip6tables -t mangle -N ISTIO_DIVERT
    58  ip6tables -t mangle -N ISTIO_TPROXY
    59  ip6tables -t mangle -N ISTIO_INBOUND
    60  ip6tables -t nat -N ISTIO_OUTPUT
    61  ip6tables -t raw -N ISTIO_OUTPUT
    62  ip6tables -t nat -A PREROUTING -i not-istio-nic -j RETURN
    63  ip6tables -t nat -A OUTPUT -o not-istio-nic -j RETURN
    64  ip6tables -t mangle -A PREROUTING -i not-istio-nic -j RETURN
    65  ip6tables -t mangle -A OUTPUT -o not-istio-nic -j RETURN
    66  ip6tables -t nat -A ISTIO_INBOUND -p tcp --dport 15008 -j RETURN
    67  ip6tables -t nat -A ISTIO_REDIRECT -p tcp -j REDIRECT --to-ports 15001
    68  ip6tables -t nat -A ISTIO_IN_REDIRECT -p tcp -j REDIRECT --to-ports 15006
    69  ip6tables -t mangle -A ISTIO_DIVERT -j MARK --set-mark 1337
    70  ip6tables -t mangle -A ISTIO_DIVERT -j ACCEPT
    71  ip6tables -t mangle -A ISTIO_TPROXY ! -d ::1/128 -p tcp -j TPROXY --tproxy-mark 1337/0xffffffff --on-port 15006
    72  ip6tables -t mangle -A PREROUTING -p tcp -j ISTIO_INBOUND
    73  ip6tables -t mangle -A ISTIO_INBOUND -p tcp -m conntrack --ctstate RELATED,ESTABLISHED -j ISTIO_DIVERT
    74  ip6tables -t mangle -A ISTIO_INBOUND -p tcp -j ISTIO_TPROXY
    75  ip6tables -t nat -A OUTPUT -p tcp -j ISTIO_OUTPUT
    76  ip6tables -t nat -A ISTIO_OUTPUT -o lo -s ::6/128 -j RETURN
    77  ip6tables -t nat -A ISTIO_OUTPUT -o lo ! -d ::1/128 -p tcp -m multiport ! --dports 53,15008 -m owner --uid-owner 1337 -j ISTIO_IN_REDIRECT
    78  ip6tables -t nat -A ISTIO_OUTPUT -o lo -p tcp ! --dport 53 -m owner ! --uid-owner 1337 -j RETURN
    79  ip6tables -t nat -A ISTIO_OUTPUT -m owner --uid-owner 1337 -j RETURN
    80  ip6tables -t nat -A ISTIO_OUTPUT -o lo ! -d ::1/128 -p tcp ! --dport 15008 -m owner --gid-owner 1337 -j ISTIO_IN_REDIRECT
    81  ip6tables -t nat -A ISTIO_OUTPUT -o lo -p tcp ! --dport 53 -m owner ! --gid-owner 1337 -j RETURN
    82  ip6tables -t nat -A ISTIO_OUTPUT -m owner --gid-owner 1337 -j RETURN
    83  ip6tables -t nat -A ISTIO_OUTPUT -d ::1/128 -j RETURN
    84  ip6tables -t nat -A OUTPUT -p udp -j ISTIO_OUTPUT
    85  ip6tables -t raw -A OUTPUT -p udp -j ISTIO_OUTPUT
    86  ip6tables -t nat -A ISTIO_OUTPUT -p udp --dport 53 -m owner --uid-owner 1337 -j RETURN
    87  ip6tables -t nat -A ISTIO_OUTPUT -p udp --dport 53 -m owner --gid-owner 1337 -j RETURN
    88  ip6tables -t raw -A ISTIO_OUTPUT -p udp --dport 53 -m owner --uid-owner 1337 -j CT --zone 1
    89  ip6tables -t raw -A ISTIO_OUTPUT -p udp --sport 15053 -m owner --uid-owner 1337 -j CT --zone 2
    90  ip6tables -t raw -A ISTIO_OUTPUT -p udp --dport 53 -m owner --gid-owner 1337 -j CT --zone 1
    91  ip6tables -t raw -A ISTIO_OUTPUT -p udp --sport 15053 -m owner --gid-owner 1337 -j CT --zone 2
    92  ip6tables -t mangle -A PREROUTING -p tcp -m mark --mark 1337 -j CONNMARK --save-mark
    93  ip6tables -t mangle -A OUTPUT -p tcp -o lo -m mark --mark 1337 -j RETURN
    94  ip6tables -t mangle -A OUTPUT ! -d ::1/128 -p tcp -o lo -m owner --uid-owner 1337 -j MARK --set-mark 1338
    95  ip6tables -t mangle -A OUTPUT ! -d ::1/128 -p tcp -o lo -m owner --gid-owner 1337 -j MARK --set-mark 1338
    96  ip6tables -t mangle -A OUTPUT -p tcp -m connmark --mark 1337 -j CONNMARK --restore-mark
    97  ip6tables -t mangle -I ISTIO_INBOUND 1 -p tcp -m mark --mark 1337 -j RETURN
    98  ip6tables -t mangle -I ISTIO_INBOUND 2 -p tcp -s ::6/128 -i lo -j RETURN
    99  ip6tables -t mangle -I ISTIO_INBOUND 3 -p tcp -i lo -m mark ! --mark 1338 -j RETURN
   100  iptables-save
   101  ip6tables-save