I have problem because I want to send a packet generated by myself to my vm instance on GCP. I'm using following code with spoofed source address:
packet = IP(src="77.7.7.7", dst="MY-VM-IP")/UDP(sport=RandShort(), dport=53)/DNS(rd=1,qd=DNSQR(qname="google.com"))
import time
while True:
send(packet)
time.sleep(1)
Although when I'm not changing source IP, I can see my packet with TCP dump on my VM. How can I make it works? I have IP forwarding enabled on my VM and FW set to allow.
According to the documentation 1, it is possible as long as the VM who sends the packet has
IP forwarding
set toON
.You also need to make sure that the VM who is recving the traffic has an Ingress FW rule that allows that.
I just tested the following and it worked: