Iptables is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel.

learn more… | top users | synonyms

23
votes
9answers
15k views

How to control internet access for each program?

I would like to use a software to control which program may connect to the internet. I know that this behaviour is associated with the word "firewall", but some Linux users are very upset if somebody ...
17
votes
2answers
45k views

How to save rules of the iptables? [duplicate]

I create the rules to iptables. But, when I restart the computer, the rules don't work! How to save the rules on Ubuntu ? The was problem solved! do: After of the write the commands iptables, do: ...
14
votes
4answers
20k views

GUI for iptables?

I would like to secure my server and it seems that IPtables is one of the first steps. Unfortunately editing the rules in a terminal is a bit complicated and dangerous (those who ever did an iptables ...
13
votes
5answers
21k views

How to secure ubuntu server from bruteforce ssh attacks?

I have my passwords secure, but I heard people complaining about perfomance of a server going down drastically when a bruteforce attack is taking place. How can I secure my ubuntu 10.10 server from ...
11
votes
1answer
34k views

Redirect requests to my external IP/port to a different external IP/port?

Is it possible to redirect connections to a specific IP/port to an external IP/port? Example: Server A has the external IP xxx.xxx.xxx.xxx Server B has the external IP yyy.yyy.yyy.yyy User sends a ...
11
votes
4answers
16k views

How can I block ping requests with IPTables?

and stealth specific ports?
11
votes
2answers
4k views

How to configure an OpenVPN Client Router

I am attempting to set up an OpenVPN Router so that I may connect my tablet (wireless) and Blu-Ray (wired) to a paid VPN service in another country on Ubuntu 12.10. I have successfully done this using ...
10
votes
3answers
20k views

How can I make a specific set of iptables rules permanent?

Is there a "best practice" or standard to make a few iptables rules permanent? I mean: automatically applied upon a system reboot? I am using a VPS with Ubuntu Server 10.04 LTS (Lucid Lynx). Thank ...
10
votes
3answers
1k views

Replacing my firewall rules

I've had an init script for many years that configures iptables for me and it has worked like a champ until now. After upgrading from 10.04 to 12.04 I started having firewall problems where the ...
9
votes
2answers
3k views

potential ufw and fail2ban conflicts

Will running both fail2ban and ufw cause problems? I noticed that fail2ban modifies iptables rules, but ufw already has a ton of iptables rules defined... so I'm not sure if fail2ban will mess these ...
9
votes
4answers
2k views

Is someone trying to hack into my server? What can I do?

A few weeks ago I posted a question here about some ssh issues I was having with an Ubuntu 12.04 box. Fast forward to today and I am trying to allow someone else access to the machine, but they keep ...
8
votes
1answer
26k views

iptables log file,and how change it

I have this rule in my iptables: iptables -AINPUT -s 192.168.11.0/24 -j LOG My question is: Where is the iptables log file, and how can i change that?
8
votes
1answer
9k views

How can set these iptables rules to run at startup

I usually run my iptables rules whenever I login. From the terminal I type ; sudo sh firewall.sh Setting up my sister's computer, I want to give her some basic firewall protection. She wont be ...
8
votes
3answers
1k views

How can I prevent apt-get/aptitude from showing dialogs during installation?

I'm trying to build an Ansible Playbook to deploy some Ubuntu 12.04 servers on Linode, but my problem seems to be an Ubuntu one. When I run different combinations of apt-get or aptitude I always get ...
7
votes
3answers
58k views

Reloading iptables

I made changes to iptables config file in /etc/iptables/filter in ubuntu and want to reload them. I read the man page and also googled but couldn't find the information. Any help will be appreciated. ...
7
votes
1answer
63k views

How to start/stop iptables?

While learning some new things about iptables I can't through this. While I am trying to start, its saying as root@badfox:~# iptables -L -n -v Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts ...
7
votes
1answer
4k views

persist port routing from 80 to 8080

I use amazon EC2 instance which works via ubuntu. By default according security restrictions I can't bin my application to port 80, so I just bind it port 8080 and then set routing redirect from port ...
7
votes
1answer
341 views

How to disable NAT for IPv6 (NAT66)?

The current Ubuntu LTS does not support NAT tables for IPv6 (i.e. there is no ip6tables -t nat), and I'm fine with that, in fact, a NAT-less environment is the "core" of my networks. But, the next ...
7
votes
1answer
2k views

How many instructions can be stuffed into iptables without loosing system sanity?

Say one wishes to have a list of blocked IP addresses. I have seen the following example script: BLOCKDB="/path/to/ip.blocked.file" # omit comments lines IPS=$(grep -Ev "^#" $BLOCKDB) for i in $IPS ...
7
votes
3answers
616 views

Prioritize traffic from LAN computers

I'm running torrent client on my headless Ubuntu server. Also number of computers are connected to this server, which is used as internet gateway/router. The question is whether it's possible to ...
7
votes
0answers
305 views

How can I run a command from a qml script? [duplicate]

I'm working on an Ubuntu Touch app that needs to modify iptables and do various other things that requires interaction with the command line. I found this and I understand that it must be done with a ...
6
votes
2answers
1k views

Do I also need to set up another iptables rules for ipv6 if I just used iptables?

Say I have a firewall setup on my linux server with iptables so that I only accept port 22 and port 80 traffic and I block access to all other ports. Do these rules only work if the client machine is ...
6
votes
1answer
2k views

Block Ping from a specific IP

I am on a private LAN 192.168.1.0/24. My ip is 192.168.1.3, I want to block only ping requests from 192.168.1.2. I am running ubuntu 11.10. I found two links First tells how to block an IP but not ...
5
votes
3answers
4k views

Is there a recommended default iptables setup?

I've been using ubuntu server for a while, however I have never really invested time into iptables. I was wondering if there was a recommended way to setup iptables on a basic server intall. An ...
5
votes
2answers
4k views

Is there a rule for iptables to limit the amount of SYN packets a /24 range of IPs can send?

How can I block entire C class IP blocks when they send too many SYN packets to my ubuntu 12.04 server? Example of what I see during a SYN flood attack: Each different IP only sends 1 SYN packet, ...
5
votes
3answers
2k views

How to host an AP or a hotspot?

I'm running Ubuntu 12.04 as a virtual machine on my Mac. Since I am unable to get the virtual machine to have full access to my WiFi card, I bought another USB WiFi card to use. This is my WiFi card. ...
4
votes
1answer
5k views

Do I need to restore iptable rules everytime on boot?

Every time I reboot I loose the iptables rules that took me so looong to enter. I know I can save them and restore them on boot, but is there anyway to save them forever? Do I really need to restore ...
4
votes
1answer
12k views

Forwarding traffic between 2 interfaces

I have 2 VLANs connected to a 'router'. All the machines can ping other machines within their own VLAN and the router. The router can ping all of the machines. I am trying to get machines to talk to ...
4
votes
5answers
15k views

How can I fix the iptables error message “unable to initialize table 'filter'”?

When I try to use iptables command on one of my Rackspace cloud server, I'm getting the following error. In an attempt to apply iptables rules with iptables-apply -t 120 /etc/iptables.rules and ...
4
votes
2answers
4k views

'ip rule flush' breaks all connectivity

I'm configuring some network stuff, and every time I try something the connection breaks. Thinking that I must be configuring something incorrectly to break all connections, I did a bit of ...
4
votes
1answer
1k views

Iptables Not Blocking User

iptables seems to not want to block a user. I'm using a remastered 10.04 live and Firestarter as a firewall. I've made no fundamental changes to the distro, except to update, upgrade and added this ...
4
votes
1answer
10k views

iptables doesn't redirect http traffic to my Squid proxy!

I arranged a transparent Squid proxy which listens to port 3128 on localhost, to block some web sites. I've tested the proxy using Firefox, and it works. Then I ran this, hoping to redirect all the ...
4
votes
1answer
4k views

Port forward to a port on the same machine

I used to run a service on port 25570 I'm now changing it to run on port 25565 but I still want people who try to access it on the old port to have access to the service. So I'd like to forward port ...
4
votes
1answer
464 views

Could someone tell me whether my OS is communicating with the internet?

I edited iptables so that when the VPN service is disconnected, no program will access the internet. Well, I did an experiment. I disconnected the VPN service manually and immediately did a ping by ...
4
votes
1answer
732 views

Why ufw is blocking my outgoing traffic?

Here is my status: $ sudo ufw status verbose Status: active Logging: on (medium) Default: deny (incoming), allow (outgoing) New profiles: skip To Action From -- ...
3
votes
2answers
9k views

How to configure UFW to allow IP Forwarding?

I have UFW, OpenVPN and Virtualbox installed on my home server. I have a host-only network for my virtual machine guests (vboxnet0) set up with the IP range 10.0.1.0, and another IP range of 10.0.0.0 ...
3
votes
3answers
5k views

Bash Script: catching errors in a block of statements

I have a large iptables ruleset that I manage with my own bash script. Most of the commands in the script are simple, single-statment iptables commands. I am trying to improve the script by adding ...
3
votes
2answers
14k views

How do I allow all possible IPs for Gmail servers through my ufw firewall?

I am currently using the following rule: ufw allow out from my_local_ip to any port 587 This is a little too lax for my liking. I would like to tighten it up and restrict it to only gmail's smtp ...
3
votes
1answer
996 views

iptables resets when server reboots

Everytime my server reboots it seems I have to reset my iptables to default, I used to use firestarter but removed it a while ago. Is there any settings that are making iptables change when the server ...
3
votes
3answers
642 views

Very easy iptables tutorial?

Where to find a easy "iptables for dummies" tutorial? I know NOTHING about it and basically I need to allow only http, ssh and ftp connections... thank you all
3
votes
1answer
10k views

iptables-restore failing to load my rules

I've been searching around for some time now, but nothing solves my problem. I'm setting up a mail server, but when writing to the iptables, I get an error: iptables-restore: line 2 failed. I'm ...
3
votes
2answers
8k views

Help! My server has been hacked - .IptabLes and .IptabLex in /boot [closed]

I'm running a Ubuntu 6.06 dapper server and it has been hacked. I'll admit up front here that I'm a programmer and not a system administrator so even though I've worked with Unix/Linux for years my ...
3
votes
1answer
219 views

Setting up catch-all with iptables

I'm trying to setup a iptables which only allows traffic in via ssh and a catch all that blocks everything else coming into computer. The iptables -L output looks like this Chain INPUT (policy ...
3
votes
3answers
6k views

Error message when entering iptables command (table does not exist)

I have been trying to install Spotify, but when logging in I get a message saying I have an error 101. This appears to be related to either my proxy settings or to my firewall. Following instructions ...
3
votes
1answer
4k views

How to delete or unblock an IP address listed in IPtables firewall?

I am trying to delete an IP address that appears listed on the server's IPtable. I'm using the following command to list the IPs: iptables -L INPUT -n --line-numbers Giving me a result like: ...
3
votes
1answer
2k views

Error when doing port forwarding with iptables?

I've got a fairly standard ubuntu install and looking to add a port forward. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ...
3
votes
1answer
371 views

Gufw doesn't show my current iptables rules

I bought a new machine, so, what I did was save my current iptables using iptables-save and imported the rules into the new machine with iptables-restore command. If I run iptables -L command in the ...
3
votes
2answers
6k views

What are fail2ban's log iptables “returned NNN” entries? (Fail2ban is failing to ban)

In my fail2ban.log there are some entries the meaning of which I don't understand (and haven't found searching around)... I have several "jails", and I have created one particular one that bans IP's ...
3
votes
2answers
3k views

iptables rule to force all browsers to use proxy

I have installed squid as my proxy server in Ubuntu 10.04 standalone system which has a single NIC. Why i have installed Squid in a standalone system is because of my friends who uses my system to ...
3
votes
2answers
809 views

UFW not blocking connections to docker instance

I have a webservice running inside a docker instance which was run using the following command: sudo docker run -d -p 4040:4040 .... My UFW rules look like this: ~ sudo ufw status Status: active ...