I have two IP addresses on my physical eth interface. Lets say 192.168.10.7 (eth0:0) and 192.168.0.7 (eth0). So it works. But I use application, working on the only one of this addresses on port 12000. It is setup in this application internally to work on address 192.168.0.7. I set app to work on address 192.168.10.7 too, using iptables, in such way:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -t nat -A PREROUTING -p tcp -d 192.168.10.7 --dport 12000 -j DNAT --to 192.168.0.7:12000
Now I want to block all incoming traffic to IP address 192.168.10.7 (interface eth0:0) except port 12000. All the rest traffic must be unchanged. I am not iptables expert. Can anybody help me?