Iptables is a module that provides the Linux operating system functions of firewall, NAT and logging of data traveling over a computer network.

learn more… | top users | synonyms

3
votes
1answer
35 views

Is IPTABLES obsolete when behind a router?

I'm still quite noobish when it comes to networking. I was fiddling around with squid on centos and i was wondering whether turning on iptables when your centos box is behind your isp modem/router has ...
0
votes
0answers
101 views

iptables rule - SSH socks proxy

I have very basic iptable rules for my home server. Block all INPUT except SSH and a few other connections. Allow everything else. When I connect via SSH I sometimes also create a dynamic SOCKS5 ...
3
votes
1answer
1k views

How to isolate networks with a Mikrotik router?

I have recently got a Mikrotik router for my network, and I want to create 3 networks that are isolated from each other but all have internet access: The "main" network for PCs, etc. A network for ...
1
vote
1answer
46 views

ip6tables causing slowness

When running commands like ntpq -p or apt-get update it takes a very long time to display the results. If I remove all the ipv6 rules, everything works fine. I checked syslog, and there's no iptables ...
0
votes
1answer
230 views

Redirect DNS requests using a router and iptables

I have a cable-modem-router from my ISP (Technicolor TC7210Z), and a bunch of wired and wireless devices connected. I want to change the DNS configuration for all devices, but I cannot change it on ...
2
votes
2answers
4k views

How to redirect a port using IPTables in Red Hat Linux (RHEL)?

I'd like to forward port 80 to 8080. So I tried to edit /etc/syscongfig/iptables: -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 But got: # service iptables restart ...
0
votes
0answers
47 views

Cannot connect to The Ship Dedicated Server

I am attempting to run a dedicated server for The Ship from my Ubuntu VPS. I have installed the server through srcds, and it seems to start up fine. This is what is shown when I execute "srcds_run": ...
1
vote
1answer
67 views

Samba not accessible via Server name anymore

From one day to another, my samba share (Debian 8 with current Samba 4.1.17) stopped turning up in the windows network neighborhood (Win 10). For a few days it was still accessible by typing \\...
0
votes
1answer
54 views

IPtable rule to limit number of TCP connections on my PC

I have a limit on the number of TCP connections that I can make in my network. If I make more than 100 TCP connections, I get banned for a few minutes. My GoogleChrome in linux opens a lot of ...
1
vote
0answers
351 views

Compile iptables from source make error

I'm trying to compile latest iptables 1.6, but I receive the following error: (./configure it's OK) then I call make and: xtables-config-parser.y:20:28: error: libnftnl/table.h: No such file or ...
1
vote
0answers
49 views

Amazon VPC one way communication issue [closed]

I have 2 sites. 1 - Amazon China: 10.50.0.0/23 with a few instances and one which is assigned with both a public and a private address (let's call it China-GW). This instance has been installed with ...
-1
votes
1answer
122 views

How to speed up dd-wrt iptables command execution

I have a custom firewall script in dd-wrt router. It has thousands of lines in a user-chain like this: /usr/sbin/iptables -t nat -A XXXX -d 1.2.32.0/19 -j RETURN /usr/sbin/iptables -t nat -A XXXX -d ...
1
vote
1answer
829 views

Block traffic to LAN but allow traffic to Internet (iptables)

On my home network I am setting up a CentOS server that will be used by about a dozen or so for educational purposes - e.g. learn how to use the Linux shell and host websites, among other things. I ...
4
votes
2answers
246 views

dhclient unicast DHCPREQUEST excessive logs

I am using centos 7 with dhclient 4.2.5: $ uname -a Linux hostname 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux $ dhclient -V Internet Systems Consortium ...
0
votes
0answers
29 views

iptables tcp over NAT with NFQ

I'm working woth OpenWRT on a router, and would like to catch all traffic over port 1234 with NFQUEUE and set verdict according to packet. I know of snort and surricata, but would like my own package....
0
votes
1answer
125 views

Linux - Squid on local machine to control outgoing traffic

I'm trying to setup squid on my computer to control the outgoing traffic from the same computer only. If my understanding is correct, squid runs as user "squid" on on most Linux distributions (mine is ...
0
votes
0answers
122 views

Iptables MASQUERADE only selected ports

I did port forwarding following this tutorial: http://www.debuntu.org/how-to-redirecting-network-traffic-to-a-new-ip-using-iptables/ iptables -t nat -A PREROUTING -p tcp --dport 1111 -j DNAT --to-...
0
votes
1answer
1k views

Blocking all sites/IP address but Google.se with iptables

Im trying to block all IPs but Google.se. It doesnt work (Site does not display) Here is what I wrote: #/bin/sh echo "Flushing IPTables..." sleep 1 iptables -F iptables -X iptables -t nat -F ...
0
votes
2answers
406 views

How do I forward eth0 to wlan0?

I tried to forward eth0 to wlan0 on my Raspberry Pi B+ using NAT on iptables with the following commands: echo 1 > /proc/sys/net/ipv4/ip_forward iptables -A FORWARD --in-interface eth0 -j ACCEPT ...
0
votes
1answer
873 views

Limit and limit burst in IPTABLES

For some reason I am not able to understand the concept of limit and limit burst in IPTABLES. Could anyone please help me here ! Thank you!
1
vote
1answer
141 views

OpenVPN Routing Port 80 Traffic only DD-WRT

I've setup openvpn client on my dd-wrt to connect to a host a couple states away. Works great(checked route table as well) but I want to only tunnel http traffic. I've always used IPtables for my dd-...
-1
votes
1answer
54 views

How can i open port for microsoft outlook

I use firewall and configure iptables command to block all torrent port in my firewall with iptables. When I add these rules, I can't send and receive email with my outlook with my exchange server in ...
1
vote
2answers
54 views

Need an explanation of iptables rule

Can anyone help me understand the below iptables rule? iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
2
votes
1answer
129 views

No connection between devices in local network

I have home server that also works as router (gateway). It has 2 interfaces one for internet (enp4s0) and another (enp4s1) looks into local network. All devices from local network uses internet from ...
1
vote
1answer
61 views

Access linux device through bridged interface

I'm currently trying to set up a device with a bridge in my network. The device used for the Bridge has two eth interfaces and a wlan interface. I managed to create the bridge from eth1 to wlan0. The ...
2
votes
2answers
344 views

Why put ACCEPT target after DROP in iptables?

My iptables -nvL looks like this: bash# iptables -nvL Chain INPUT (policy ACCEPT 1031 packets, 81085 bytes) pkts bytes target prot opt in out source destination ...
0
votes
1answer
455 views

IPTABLES Rules to rate-limit ICMP(Ping) traffic to 5 packets per second

Trying to figure out the IPTABLES rule for above mentioned requirment. Can anyone please advise me here. I was trying this but not succesful - iptables -A OUTPUT -p icmp -m limit --limit 5/second -j ...
19
votes
4answers
27k views

How can I check if an iptables rule already exists?

I need to add a rule to iptables to block connections to a tcp port from the Internet. Since my script may be called multiple times and there is not a script to delete the rule, I want to check if ...
0
votes
1answer
43 views

Using iptables to bypass VPN based on user

Running the latest LTS Xubuntu and am trying to route traffic from processes initiated by one user (let's say 'jsmith') around a VPN. I think iptables is my only hope here? The relevant adaptors are ...
0
votes
0answers
36 views

How To Setup a Firewall in Ubuntu 14.04 LTS

I have to set-up an Apache web server on Ubuntu 14.04 LTS and a Firewall Server on Another Ubuntu 14.04 LTS . My question is that how to connect firewall server to the next web server after installing ...
1
vote
1answer
108 views

Cannot access internet with current OpenVPN configuration

I am trying to get an OpenVPN server working on my Raspberry Pi. The Raspberry Pi is running Arch Linux with OpenVPN version 2.3.8-2. I'm currently able to connect to the server from the Android ...
1
vote
1answer
106 views

Why can traffic be routed to Privoxy but not Tor using Iptables?

To route http-requests from Interface 10.10.0.0 over privoxy this iptables rule is enough: iptables -t nat -A PREROUTING -s 10.10.0.0/16 -p tcp -m multiport --dports 80,8080,81 -j DNAT --to-...
0
votes
0answers
47 views

Run script after Suricata drops or alarms

I have a Suricata IPS. I want after droping some packets, block their IP in my other servers. I have the command needed to block them. I just don't know how to parse new lines at fast.log and drop.log,...
0
votes
0answers
25 views

Problems with routing/firewalling with L2TP / IPSec

I have racoon configured for VPN along with L2TP (PAM auth), and I plan on using this for multiple users. My racoon.conf is: path include "/etc/racoon"; path pre_shared_key "/etc/racoon/psk.txt"; ...
2
votes
1answer
61 views

Iptable & routing in a virtualbox lab

I set up a virtual box lab, with the following configuration: Vitual Lab Setup In order to make the lab working i create with a script the following interfaces, enabling port forwarding for the ...
0
votes
0answers
28 views

meaning of iptables -vL output

I ran the following commands: iptables -Z nmap 192.168.111.142 iptables -vL And I got this: Chain INPUT (policy ACCEPT 29 packets, 1484 bytes) pkts bytes target prot opt in out ...
0
votes
0answers
74 views

Transparent proxying for all docker containers

I'm running docker containers from behind a corporate firewall and it is always problematic that I have to set the proxying parameters in each container. This is especially bad when I run builds from ...
4
votes
0answers
132 views

Why do different users get different IP via the same interface

On the same server, on root, I am getting the correct internet ip of the interface root@server:~# curl -s --interface ppp0 ipcheck.com 111.111.111.111root@server:~# However... If it's not super ...
-1
votes
1answer
383 views

DD-WRT Wifidog - Redirect isn't working

I have flashed a ASUS AC-RT56U router with DD-WRT version V24-preSP 2201412-22-2014-r25697. Now I want to make it into a hotspot with wifidog TO PLACE IN A SMALL BUSINESS (FITNESS CENTRE) I have ...
0
votes
1answer
150 views

Is there any other way to get IPTables to filter IP addresses based on geolocation in Ubuntu 12.0.4.5 (LTS)

So a few of the servers I manage are being slammed by traffic from China when the sites themselves would have utterly no appeal to anyone in China in any way. To make things worse, lots of unwanted ...
2
votes
1answer
862 views

Ubuntu IPTables allow only allow 1 country

So I've been looking around on the net for a script that will drop all traffic to all ports except the http(80) and https(443) ports, and then only allow traffic on all other ports from country x (...
1
vote
1answer
1k views

using firewalld and firewall-cmd how to add-rule to primary INPUT chain not INPUT_direct

so after reading the firewalld man page and fedora documentation, I have come to the understanding that to add a custom rule to firewall with specific arguements i need to use the structure firewall-...
1
vote
0answers
124 views

Setting up RTMP for streaming (Console)

So I have been trying to set this up for the past few days and I am having so much trouble actually getting this to work. I have installed Nginx with the optional RTMP module onto my Mac and I also ...
0
votes
1answer
39 views

Iptables issue error at line 2

I messed up with my ip table now i am facking some kind of issue with that iptables to start.Below content is present in my iptables file. But when i try to start the ip tables i am facing error as ...
0
votes
1answer
65 views

How to I configure iptables for both IP masquerading and firewalling at the same time?

I have a host that acts as a gateway for routing a home network to Internet. IP Masquerading has been enabled for months now and the system has worked fine. How do I configure it to function also as ...
1
vote
2answers
165 views

does IPTABLES as a router always require masquerade / SNAT?

If I set up a linux box as a router behind a DSL gateway, do I need to enable masquerading or SNAT? Logically I would assume that all I need to do is enable ip_forwarding (done) but traffic to ...
1
vote
1answer
6k views

Fail to start iptables.service: 'No such file'

I'm trying to directly use iptables instead of firewalld to manage firewall rules. However systemctl start iptables prints: [root@centos-new ~]# systemctl start iptables Failed to issue method call: ...
0
votes
0answers
29 views

iptables wont take any arguments

I have an ubuntu server configured as a gateway router with eth0 (ext connected to a dsl router) and eth1 (internal network) I have Source NAT enabled, to share the external IP with all internal ...
3
votes
0answers
42 views

How can I read out the value of internal counter inside IPSet

I know there is an option named “counters” when creating an IP set with IPSet. However, I want to know how to read the value of the counters out, so as to know how many packets or how much data has ...
0
votes
0answers
177 views

iptables-restore failed at COMMIT line, no detailed description

I'm trying to setup iptables (using iptables-restore) for a new server and was looking at the security docs from Linode, so basically used their templates for IPv4 and IPv6. These are both failing at ...