0

I have set up a very simple Hypervisor using Alpine Linux and my VM sees all traffic coming from the IP of the hypervisor.

Which also means if fail2ban tries to block attacks, it always blocks the hypervisors IP

How can I have the VM see the real IP Adresses and not just the IP of the hypervisor?

Interface setup

On the HV (192.168.5.5) I have a bridged interface br0 which is working fine

# tun1 setup script on Hypervisor
iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE
iptables -P FORWARD ACCEPT
ip tuntap add dev tap1 mode tap user root
ip link set dev tap1 up
ip link set tap1 master br0

qemu-system-x86_64 [..non related parameters removed ..] \
-device virtio-net-pci,netdev=network0,mac=02:1f:ba:26:d7:56 \
-netdev tap,id=network0,ifname=tap1,script=no,downscript=no

The VM has internet access but all traffic it sees comes from the IP of the hypervisor.

VM seeing only HV IPs

Someone is even trying to use my Server for an DNS amplification attack (blocked outgoing on my PFSense Firewall though) DNS amplification attacks

Fail2ban also blocking the wrong IP fail2ban log showing blocked HV ip

1 Answer 1

0

The reason for this is the postrouting iptable rule.

After removing iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE using the command iptables -t nat -D POSTROUTING -o br0 -j MASQUERADE it works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .