Questions tagged [iptables]

GENERAL IPTABLES SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com. An application that allows administrators to configure the packet processing tables provided by the Linux kernel firewall. Use this tag only for questions on programming with iptables. Questions about configuring iptables should be asked on Server Fault (https://serverfault.com/tour).

An application that allows administrators to configure the packet processing tables provided by the Linux kernel firewall. Use this tag only for questions on programming with iptables. Questions about configuring iptables should be asked on Server Fault.

Links:
Linux Firewall Tutorial: IPTables Tables, Chains, Rules Fundamentals
Iptables Essentials: Common Firewall Rules and Commands

2035 questions
491
votes
25 answers

Is there a way for non-root processes to bind to "privileged" ports on Linux?

It's very annoying to have this limitation on my development box, when there won't ever be any users other than me. I'm aware of the standard workarounds, but none of them do exactly what I want: authbind (The version in Debian testing, 1.0, only…
Jason C
  • 21,377
  • 10
  • 38
  • 33
411
votes
8 answers

How can I remove specific rules from iptables?

I am hosting special HTTP and HTTPS services on the ports 8006 and 8007 respectively. I use iptables to "activate" the server; i.e. to route the incoming HTTP and HTTPS ports: iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT iptables -A INPUT…
Jeroen Ooms
  • 31,998
  • 35
  • 134
  • 207
161
votes
16 answers

What is the best practice of docker + ufw under Ubuntu

I just tried out Docker. It is awesome but seems not work nicely with ufw. By default, docker will manipulate the iptables a little bit. The outcome is not a bug but not what I expected. For more details you can read The dangers of UFW + Docker My…
Yi-Chien Chang
  • 1,763
  • 2
  • 11
  • 6
153
votes
9 answers

How can I use iptables on centos 7?

I installed CentOS 7 with minimal configuration (os + dev tools). I am trying to open 80 port for httpd service, but something wrong with my iptables service ... what's wrong with it? What am I doing wrong? # ifconfig/sbin/service iptables…
Meiblorn
  • 2,522
  • 2
  • 18
  • 23
93
votes
3 answers

iptables block access to port 8000 except from IP address

I've never used iptables, and the documentation online seems a bit opaque. I'd like to block all requests to port 8000 on my server except those coming from a specific IP address. How do I do that using iptables?
will
  • 3,103
  • 4
  • 25
  • 30
86
votes
12 answers

Connection refused to MongoDB errno 111

I have a Linode server running Ubuntu 12.04 LTS and MongoDB instance (service is running and CAN connect locally) that I can't connect to from an outside source. I have added these two rules to my IP tables, where < ip address > is the server I want…
dbcooper
  • 2,299
  • 2
  • 14
  • 8
76
votes
9 answers

Running docker container : iptables: No chain/target/match by that name

I'm trying to run a container but I get the following issue : Error response from daemon: Cannot start container b005715c40ea7d5821b15c44f5b7f902d4b39da7c83468f3e5d7c042e5fe3fbd: iptables failed: iptables --wait -t filter -A DOCKER ! -i docker0 -o…
vmonteco
  • 14,136
  • 15
  • 55
  • 86
54
votes
3 answers

Docker: How to re-create dockers additional iptables rules?

When the docker-demon starts it adds a couple of rules to iptables. When all rules are deleted via iptables -F i have to stop and restart the docker demon to re-create dockers rules. Is there a way to have docker re-add it's additional rules?
kioopi
  • 2,170
  • 2
  • 18
  • 26
53
votes
11 answers

Charles proxy fails on SSL Connect Method

I have Android 4.3 forced to use Charles proxy via IPTABLES. The charles certificate is installed on the phone. I am able to capture normal SSL traffic like https websites in the browser. All POST and GET methods seem to work fine. In a particular…
user1318504
  • 608
  • 1
  • 6
  • 11
48
votes
14 answers

Iptables v1.4.14: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)

I'm trying to set iptable rules, and I got following error message when I use iptable : iptables v1.4.14: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. I'm…
Douglas
  • 5,229
  • 3
  • 43
  • 54
48
votes
4 answers

Gitlab with non-standard SSH port (on VM with Iptable forwarding)

My gitlab is on a virtual machine on a host server. I reach the VM with a non-standard SSH port (i.e. 766) which an iptable rule then forward from host:766 to vm:22. So when I create a new repo, the instruction to add a remote provide a mal-formed…
Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178
46
votes
9 answers

How can I programmatically manage iptables rules on the fly?

I need to query existing rules, as well as being able to easily add and delete rules. I haven't found any API's for doing this. Is there something that I'm missing? The closest I've come to a solution is using iptables-save | iptables-xml for…
Ycros
  • 1,720
  • 2
  • 14
  • 10
40
votes
3 answers

iptables: No chain/target/match error (with docker network create)

When creating a network (docker network create -d bridge my-nw), I obtained this error in response: Error response from daemon: Failed to Setup IP tables: Unable to enable SKIP DNAT rule: (iptables failed: iptables --wait -t nat -I DOCKER -i…
Christian68
  • 845
  • 4
  • 13
  • 24
39
votes
1 answer

iptables: how to delete postrouting rule?

I would like to delete POSTROUTING rule below, [root@hostname ~]# service iptables status Table: nat Chain PREROUTING (policy ACCEPT) num target prot opt source destination Chain POSTROUTING (policy ACCEPT) num target …
hiroo
  • 657
  • 2
  • 7
  • 13
38
votes
2 answers

ssh: connect to host bitbucket.org port 22: Connection timed out

Everything was working perfectly fine. Did some git pushes with no problems. Today I decided to update my framework to the latest version, so it changed the directory structure of my project a bit. So within Bitbucket, I created a new repository…
user3489502
  • 3,451
  • 9
  • 38
  • 66
1
2 3
99 100