Questions tagged [iptables]

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

iptables is a user space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall and the chains and rules it stores.

1316 questions
123
votes
2 answers

How to save rules of the iptables?

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: 1. sudo su 2. iptables-save > /etc/iptables.rules …
Gustavo
  • 1,239
97
votes
3 answers

What is MASQUERADE in the context of iptables?

In iptables many times I see the target MASQUERADE. What is that? I searched and found lots of things. But I need someone to explain to me what MASQUERADE is in an easy to understand way? An example (taken from this answer) is: sudo iptables -t…
96
votes
5 answers

Redirect port 80 to 8080 and make it work on local machine

I redirected traffic for port 80 to 8080 on my machine with sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-ports 8080 It works fine for all the world except my own machine. I am a developer and I need to redirect port 80 to…
Max
  • 1,168
88
votes
5 answers

Where can I find the iptables log file, and how can I change its location?

I have this rule in my iptables: iptables -A INPUT -s 192.168.11.0/24 -j LOG My question is: Where is the iptables log file, and how can I change that?
pylover
  • 2,405
82
votes
13 answers

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 demands a Personal Firewall. I don't want to…
guerda
  • 1,191
60
votes
2 answers

how do you create an app profile for ufw?

Ufw has a command that lists out profiles to which you can further explore their profile definitions $ ufw app list And $ ufw app PROFILE {app profile title} I was wondering how you can create a profile for an undefined program, like virtual box…
Miphix
  • 1,078
50
votes
3 answers

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 you. BIG EDIT: I don't want ANY rule to be persisted…
J. Bruni
  • 1,392
48
votes
3 answers

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 up.
Adam Monsen
  • 2,161
44
votes
4 answers

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 configured on the other end of the OpenVPN…
Stephen RC
  • 4,920
43
votes
6 answers

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.
Raccha
40
votes
7 answers

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 -F will know what I mean ;) ). Could you…
silvo
  • 1,289
37
votes
6 answers

Open port 80 on Ubuntu server

I'm just starting out in Ubuntu/Linux, and have some trouble opening port 80 for incoming connections. I ran the sudo ufw allow 80/tcp command, and when I run sudo ufw status the result looks like this: Status: active To …
martin
  • 481
  • 1
  • 4
  • 5
32
votes
2 answers

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 25570 to 25565 on the same machine. I know there's…
30
votes
3 answers

What's the difference between PREROUTING and FORWARD in iptables?

I am trying to understand how this system works and I have problems to understand the difference between using NAT PREROUTING or filter FORWARD. From what I understand, the PREROUTE can send the packet to another server, avoiding the filter. If NAT…
GheorGhe
  • 413
29
votes
5 answers

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 the following dialog that I have to respond to.…
1
2 3
87 88