LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   OpenVZ/Centos Port FIltering (Host Node) (https://www.linuxquestions.org/questions/linux-general-1/openvz-centos-port-filtering-host-node-4175424750/)

papa2ae 08-30-2012 06:13 AM

OpenVZ/Centos Port FIltering (Host Node)
 
On my openvz host node, I have blocked port 25 using the following command ..

iptables -A FORWARD -j DROP -p tcp --destination-port 25

This is fine, but it blocks the port for all the containers.

Therefore, I have tried something like this, although it is listed in iptables -L, the connection cant be made. (Tried to check via telnet)

iptables -I FORWARD --source 7.5.4.7 --protocol tcp --destination-port 25

OR

iptables -I FORWARD --source 7.5.4.7 --protocol tcp --destination-port 25 -j ACCEPT

Any idea what is wrong?

PS. The block command is in the end, and nothing is below it. So this shouldn't be a problem. And if there is a way to block instead of allow, that will be fine too.

Thanks
papa2ae

seeberg 08-30-2012 09:21 AM

If you are using bridged networking iptables don't act as you expect. Try searching "ebtables bridged networking"

papa2ae 09-01-2012 10:33 AM

But if the top command works fine, why doesn't the second one work the way it is meant to?

It has always worked for me ...

And no, not using a bridged network setup


All times are GMT -5. The time now is 06:55 PM.