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

There seem to be many different ways to setup whitelist rules within iptables.

What is the wisest way to whitelist the CloudFlare IP address ranges below via SSH? ( - ( - ( - ( - ( - ( - ( - ( - ( -

According to their FAQ it should be done as follows:

iptables -I INPUT -p tcp -m multiport --dports http,https -s CLOUDFLARE_IP_RANGE -j ACCEPT

However, this generates the following error:

Bad argument 'http,https'

It also does not provide for OUTPUT rules, or rules to be flushed first.

share|improve this question
The following thread may be helpful: link – littlebizzy Nov 9 '12 at 13:48

I have never seen anyone try to use service names in that argument. Try using the equivalent numeric port numbers instead:

--dports 80,443
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.