I'm trying to allow access to certain ports on the server, via only one of the server IP addresses.
So for example if the server has two IP addresses: 1.1.1.1 1.1.1.2
I only want for example ports 25, 26 to be accessible via 1.1.1.2. I'm not trying to prevent any external IP addresses from accessing the ports, just trying to make sure that they can only access the ports on a certain IP address on the server.
I've been trying to write this using iptables, but I've so far been unsuccessful - I was wondering if anyone could help?
iptables -[AI]
is basically useless, becauseiptables
rules are position-depdendent. We need to see the output ofiptables -L -n -v
to have any hope of commenting usefully.