Questions tagged [iptables]

iptables is the userspace command line program used to configure the Linux 2.4.x and 2.6.x IPv4 packet filtering ruleset. It is targeted towards system administrators. Please, when asking a question about iptables, add the output from the following command: iptables -L -v -n

iptables is userspace utility complementary to Linux kernel-level Netfilter firewall.

When seeking help in regards of the firewall configuration it's advisable to supply iptables-save output to give a readable ruleset listing possibly appending it with iptables -L -v -n — to give matching ruleset information.

6406 questions
2
votes
2 answers

Secure iptables config for Samba

I'm trying to setup an iptables config such that outbound connections from my CentOS 6.2 server are allowed ONLY if they are of state ESTABLISHED. Currently, the following setup is working great for sshd, but all the Samba rules get totally ignored…
Eric
  • 237
  • 1
  • 6
  • 12
2
votes
1 answer

iptables after drop ftp goes through

I cannot deny access to FTP for a IP address. First of all i needed to deny everything so i did like this: #iptables -F #iptables -P INPUT DROP #iptables -P OUTPUT DROP #iptables -P FORWARD DROP Then I opened FTP: #modprobe…
Mike
  • 21
  • 2
2
votes
2 answers

iptables blocking traffic

Can someone please explan why IPTABLES is blocking any ports in this list of rules: Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere state…
DD.
  • 3,024
  • 10
  • 34
  • 50
2
votes
1 answer

Slumbering apache server refusing connections, but not via localhost

I'm pushing a moderate amount of traffic (about 20 req/s) to a simple PHP API running on an Apache server. The Apache server slumbers (mod_status barely registers one active request), however, I'm seeing "Connection Refused" errors happening…
Ross
  • 123
  • 5
2
votes
2 answers

How can I get port forwarding to work with iptables?

I want to protect my MySQL Server from portscanners/probes. So my idea is to put the external port on let's say 36636, internal port has to stay at the default 3306 for compatibility with local apps. A MySQL client connects to…
Tobe
  • 151
  • 2
  • 6
2
votes
2 answers

Redirect traffic between two ports with iptables

My goal is to run a webserver on port 3000 and make it available to my network over port 80. The best answer I found so far is this nice one liner. iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000 But this only effects…
TheHelix
  • 21
  • 3
2
votes
2 answers

Iptables: Forwarding packets doesn't work

I have 3 Linux Systems A, B and C. A is a TCP Client and sends a message to TCP Server on C. A can see only the external IP of B which is at wlan0 interface, 192.168.0.3 ------------------ --------------------- …
user907810
  • 141
  • 1
  • 2
  • 5
2
votes
1 answer

IPTables unable to nat trough VPN

I have a VPN connection to a server on a remote location. I want other pc's to be able to reach the webserver on the remote location trough the VPN connector. But i can't get where i want. This is the situation: VPN Server (and also the webserver):…
cygnusx
  • 21
  • 1
2
votes
4 answers

How to formulate IP forwarding rule using iptables

I have two Systems A and B. A is a TCP Client and sends a message to TCP Server on B. ------------------ -------------------------- System A System B 192.168.0.5 wlan0 192.168.0.3 wlan0 …
user907810
  • 141
  • 1
  • 2
  • 5
2
votes
1 answer

Routing smtp and pop3 past iptables through proxy

following setup: Client(Outlook) <-----> |eth1 PROXY eth0 | <------> Interwebs How do i manage to do this? Setting the standard policy of all filter tables to ACCEPT doesnt change a thing, so is prerouting the way to go? Greets, Kai
Kai
  • 177
  • 1
  • 3
  • 10
2
votes
1 answer

iptables is not allowing me to contact my dns nameservers

I have the follwing iptables rules: Chain INPUT (policy DROP) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:ssh ACCEPT tcp -- anywhere anywhere …
arrowill12
  • 229
  • 1
  • 3
  • 7
2
votes
4 answers

CentOS not allowing remote MySQL connections

When assigning a user from a remote IP to connect to a database it is saying that it's failing to connect. It is also failing to connect with root so something is wrong. Bind IP is off and I have also tried disabling iptables, still no dice. Port…
nd8ad
  • 21
  • 1
  • 1
  • 2
2
votes
1 answer

Set generic iptables rules?

This may be a really dumb question but how can you open a port on multiple interfaces without defining the interfaces? For example how do I open port 22 on all interfaces? On my machine I have some interfaces that are dynamic and may or may not be…
tftd
  • 1,480
  • 7
  • 24
  • 38
2
votes
2 answers

IPtables: is there a minimum UDP packet size for a DNS lookup?

IPtables for a virtual dedicated server. I would like to block UDP scans and I was wondering whether there's a minimum packet size for a DNS lookup? Nmap sends 0-byte UDP packets (source : http://nmap.org/bennieston-tutorial/ ), but there're…
Kris
  • 1,347
  • 3
  • 15
  • 16
2
votes
3 answers

Limit UDP connections per IP iptables

I want to limit connections per IP for a specific UDP port. I got it working for TCP, but somehow it doesn't work on UDP. These are my rules: For TCP (working) iptables -A INPUT -p tcp --syn --dport 7787 -m connlimit --connlimit-above 3 -j REJECT…
habl
  • 21
  • 1
  • 2
1 2 3
99
100