Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have openvpn configured on the centos server and client can connect via openvpn client from there windows box on port 1194. Clients gets the gateway

The problem is that client boxes have viruses on there system and they sending spams via openvpn server so I just want to block that spams and port 25 for my clients.

I added the following rule in my iptables, which is allowing all traffic and dropping port 25.

iptables -t nat -A PREROUTING -p tcp --dport 25 -j DROP 
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

eth0 is the interface of the openvpn server.

But its still sending spam.

Can anybody suggest how can i block the spams/emails from my openvpn client machines?


share|improve this question
up vote 2 down vote accepted

Correct rules:

iptables -A FORWARD -p tcp --dport 25 -s CLIENT_IP_NETWORK -j DROP
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.