I have IPIP tunnel as shown in tcpdump output bellow: IP 192.168.240.112 > 192.168.250.112
.
Inside this tunnel, there is a traffic in another IPIP tunnel IP 10.233.86.94.35938 > 10.233.100.199.3306
$ sudo tcpdump -i oet1 -n
09:53:57.455262 IP 192.168.240.112 > 192.168.250.112: IP 10.233.86.94.35938 > 10.233.100.199.3306: Flags [P.], seq 802:865, ack 3295, win 501, options [nop,nop,TS val 3263474194 ecr 1936879148], length 63
My incomplete iptables rule:
iptables -t nat -A POSTROUTING -o oet1 -s 192.168.240.112 -d here_I_will_put_IP_that_I_need_that_is_fine -j SNAT --to 192.168.250.112
I want to somehow select packets of source IP 10.233.86.94
to destination IP 10.233.100.199
and add to iptables rule. So SNAT is done only when 10.233.86.94
calls 10.233.100.199
.
Any way to mark IPs that are inside nested (encapsulated) tunnel or are they not reachable to iptables?
Thanks