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 apf installed on a OpenVZ container (proxmox 2.1). The config is pretty much vanilla and things are working. My external services like ssh and http are working. My problem is that all outbound traffic on http/https is blocked. How do I allow all outbound traffic for http/https.

If I change EGF to 1 like this, all inbound and outbound traffic gets blocked


I opened a single outbound rule with the following

# /usr/local/sbin/apf -a

How do I allow all outbound traffic on http/https without blocking all traffic? Why would I allow all inbound ssh/http traffic and block all outbound traffic?

share|improve this question
Did you ever find a reasonable solution for this issue? – David Apr 25 '13 at 16:52

I had the same issue - using an OpenVZ container, outbound HTTP and HTTPS were blocked when the inbound filter was on; everything was blocked when the egress filter was on.

The solution is to set the IPTABLES configuration of your container from your hardware. On my server, the default was (in /etc/vz/vz.conf on the hardware):

IPTABLES="ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length"

I overwrote this in my container's configuration (/etc/vz/conf/CONTAINERNUMBER.conf on the hardware)

IPTABLES="iptable_filter iptable_mangle ipt_limit ipt_multiport ipt_tos ipt_TOS ipt_REJECT ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_LOG ipt_length ip_conntrack ip_conntrack_ftp ip_conntrack_irc ipt_conntrack ipt_state  ipt_helper  iptable_nat ip_nat_ftp ip_nat_irc ipt_REDIRECT"

Not sure exactly which one did it, but after setting this and restarting the container, APF worked exactly as expected.

share|improve this answer
Thanks, I will give that a try. Never expected to get a response at this point. Thanks! – David Nov 20 '13 at 4:34
@David I love you, David. You saved my xmas. – initall Dec 23 '14 at 16:00
No big deal, I work out :) Merry Christmas – David Dec 23 '14 at 23:58

That's to prevent unwanted outbound traffic to bypass your firewall and consume unnecessary bandwidth, etc.

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.