Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 10.0.8.1.

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?

Thanks.

share|improve this question

1 Answer 1

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

 
discard

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.