iptables allow creation of rules to define packet filtering behavior.

learn more… | top users | synonyms

1
vote
1answer
199 views

How do I allow only certain IPSet set's to access a certain port with iptables?

I'm using IPSet to build IP ranges for different countries as follows : # Canada ipset -F ca.zone ipset -N ca.zone nethash for IP in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/ca.zone) ...
1
vote
1answer
132 views

Managing iptables for home lan routing

I have a LAN at home. One Netgear router - 192.168.0.1 connected to the internet. One Macbook - 192.168.0.10 (connected to Netgear router) One PC with Kali Linux - 192.168.0.20 (connected to ...
3
votes
2answers
358 views

How do I fix iptables in ChromeOS?

Using the shell in chrosh in ChromeOS I followed some (apparently terrible) advice to flush my IP tables. using the command sudo iptables -F I am now unable to connect to the internet at all. All ...
2
votes
2answers
72 views

ipset accounting information

I know that iptables keeps accounting information for ip traffic blocked or passed. However, it appears that when using ipsets with iptables, the accounting information is aggregated for the entire ...
3
votes
1answer
1k views

What is the difference between OUTPUT and FORWARD chains in iptables?

CentOS 6.0 I'm studying iptables and am getting confused on the difference between FORWARD and OUTPUT chains. In my training documentation, it states: If you're appending to (-A) or deleting ...
4
votes
1answer
5k views

How can I configure syslog.conf file, to log iptables messages in a separate file?

How can I configure /etc/syslog.conf file in order to save log information about iptables in a specific file. I want to save these information separately, so I can extract what I want easily and ...
0
votes
1answer
127 views

Squid not forwarding my packets proxied from iptables on router

I am trying to make openwrt's iptables from my router to direct to my squid proxy on my machine (since there is no enough space in router's flash memory) but even if I have my squid config ok ( ...
1
vote
0answers
25 views

Configure syslog.conf file [duplicate]

How can I configure /etc/syslog.conf file in order to save log information about iptables in a specific file. I want to save these information separately, so I can extract what I want easily and ...
1
vote
1answer
95 views

Where does Iptables store blocked IPs

I need to set up a shell to block DDOS attacks , but in that script, it's reading some Blocked IPs from /etc/sysconfig/iptables. The problem is that I don't have this directory, So I'm wondering ...
0
votes
1answer
2k views

How to redirect to my squid proxy using iptables since DNAT target: only valid in nat table

I want to redirect the traffic in my lan network through squid proxy but I am having some problems with iptables rules. When I use the following rule: # iptables -I FORWARD -s ...
8
votes
4answers
633 views

Failing to block brute force ssh with iptables

I'm trying to block (slow down) brute force attacks on my sshd server. I'm following this guide http://www.rackaid.com/resources/how-to-block-ssh-brute-force-attacks/ which basically says I need to ...
0
votes
3answers
137 views

Search in iptables.log file takes a long time

I have used iptables to save information about connections by modifying the /etc/syslog.conf file to save information in /var/log/iptables.log. So, every X hours, I need to extract information from ...
0
votes
2answers
365 views

CentOS restore firewall after `service iptables panic`

My friend and I were doing some firewall configurations and in the meanwhile he thought it was a good idea to type service iptables panic. Now we cannot put the firewall back on the original state ...
4
votes
1answer
362 views

Why is my computer trying to send ICMP type 3 to OpenDNS?

In my firewall logs I see lots of entries like this. IN= OUT=eth0 SRC=192.168.1.105 DST=208.67.220.220 LEN=148 TOS=0x00 PREC=0xC0 TTL=64 ID=55705 PROTO=ICMP TYPE=3 CODE=3 [SRC=208.67.220.220 ...
8
votes
2answers
14k views

Iptables to allow incoming FTP

i want to allow incoming FTP traffic. CentOS 5.4: This is my /etc/sysconfig/iptables file. # Generated by iptables-save v1.3.5 on Thu Oct 3 21:23:07 2013 *filter :INPUT ACCEPT [0:0] :FORWARD ...
1
vote
1answer
1k views

iptables redirect FORWARD http traffic to privorxy port

Ideally i m trying to use my laptop and a 3Gphone as a WiFi router to redirect FORWARD HTTP but not HTTPS Traffic to privoxy which then forwards the traffic via a SSH tunnel to a ziproxy VPS. for the ...
4
votes
1answer
65 views

Is there any difference between these two configuration options?

Is there any actual difference between iptables -P FORWARD DROP and net.ipv4.ip_forward = 0 ? I know that one is a firewall command while the other one is a kernel option. But: I don't know ...
1
vote
0answers
129 views

Firewall config prevents hibernate connecting to postgres in CentOS6.3

I have an operating environment in CentOS 6.3 that has tomcat7 and postgres9.2 installed. There is just one web application deployed in tomcat that tries to establish a connection from localhost to ...
2
votes
1answer
140 views

What are the pros and cons to editing iptables configuration file vs adding rules via the iptables command

I am working with a product on CentOS that occasionally needs to automatically add and remove rules from the iptables configuration. For example, during an update, we want to explicitly refuse ...
1
vote
1answer
251 views

how to investigate Firewall blocked outbound TCP

CentOS webserver with CSF (Config Server Firewall) running. Blocking all outbound / Inbound traffic except listed ports 80 81 22 21 etc. for web, mail & FTP services etc. I'm use to seeing heaps ...
2
votes
1answer
131 views

Lost connectivity after iptables change

I attempted to add a couple web ports to iptables and in doing so lost the ability to resolve any external address. I have a working SSH session open and can get to the box easily if needed. Here's ...
2
votes
2answers
1k views

Open a port in my CentOS

I'm trying top open a port on my CentOS machine: I edit the /etc/sysconfig/iptables file and add my rule: -A INPUT -p TCP -m state --state NEW -m tcp --dport 143 -j ACCEPT Then I restart the ...
1
vote
0answers
255 views

iptables one IP through another network interface

This question is very similar to what I am trying to do: iptables --set-mark - Route diferent ports through different interfaces However I attempted to follow the answer but I was unable to make it ...
2
votes
1answer
113 views

Mark packets between machines (client and router)?

Can I mark a packet on the client's OUTPUT chain and add an iproute policy on the router to route them via a specific gateway? This what I tried to do, but it isn't working. My client's mangle table ...
4
votes
2answers
533 views

iptables port forwarding

I have a CentOS server with Java/J2EE(Tomcat) installed on TCP port 8080. I have two interfaces, eth0 and lo. I need to forward all incoming connection on TCP port 80 to 8080. I tried doing the ...
0
votes
2answers
224 views

Isolate a hosts networking with iptables

I want to isolate a host on my home intranet using iptables on my linux router. So say for instance, I have a host that has the IP of 10.0.1.50 and I want it to be able to talk to the rest of the ...
2
votes
1answer
51 views

How would I go about making this IPTABLE rule for every ip and not just one?

iptables -I PREROUTING -t nat -p udp -s 192.168.0.62 --dport 53 -j DNAT --to-destination 23.21.182.24 Instead of 192.168.0.62 I'd like to set that as a global rule, EVERY ip that needs dns should ...
4
votes
1answer
2k views

How can I redirect all traffic except local through external proxy with iptables in dd-wrt?

I have a router with dd-wrt. I have a firewall running to direct all traffic through an external proxy. It works great except that it also redirects local Ips and my proxy does not allow Ips, so I can ...
4
votes
1answer
86 views

iptables change log

Somehow an iptables rule was added to one of my systems. Does (or can) iptables keep a log about when and (maybe) who made a rule change? If iptables itself can't, is there a wrapper that might do ...
2
votes
0answers
206 views

SNAT problem in iptables

I am trying to reroute traffic from specific devices in my house over openvpn. For this, I've created an OpenVPN tunnel between my house wifi router and my server. Here is my setup: Wifi router's ...
1
vote
3answers
1k views

How to change user agent on all http requests made from my machine with Squid intercepting proxy?

I'd like to change the user agent on all HTTP requests made from this machine. It's easy enough to change the user agent in each browser, but other apps also make http requests. In particular, there's ...
2
votes
0answers
153 views

IPTables dropping UDP packet stream

I have a configuration where UDP packets containing encapsulated DNS data are sent to a KVM instance for processing. The KVM instance sits behind an IPtables firewall which is also doing NAT. The ...
3
votes
1answer
261 views

IPtables : Limit number of new ssh connections per minute

I need to ensure on my server that maximum new ssh connections per minute are not more then 5. sudo /sbin/iptables -A INPUT -p tcp --syn --dport 22 -m connlimit --connlimit-above 5 -j REJECT Above ...
5
votes
3answers
3k views

Help configuring a custom log file for iptables

I'm trying to log dropped packages to a custom file instead of /var/log/messages. To achieve this, I have added these two lines at the end of my configuration file: -A INPUT -m limit --limit ...
1
vote
1answer
406 views

Why iptables does not fetch information from /etc/sysconfig/iptables on centOs?

I'm new in Linux and encountered with problem with iptables. Here is content of /etc/sysconfig/iptables file # Generated by iptables-save v1.4.7 on Tue Nov 27 21:41:04 2012 *filter :INPUT ACCEPT ...
1
vote
2answers
190 views

Saving iptables on CentOS, and merging the previous rules with the newly saved ones?

I added some new rules using iptables command, then saved them using /sbin/service iptables save as described here: http://www.centos.org/docs/4/html/rhel-rg-en-4/s1-iptables-saving.html After ...
1
vote
0answers
95 views

SNAT with network alias IP RHEL 5.5

I have Rehat Enterprise Linux Server Release 5.5(Tikanga) with two interfaces as below eth0: with public IP as xxx.xx.64.118 eth0:0: with public IP as xxx.xx.116.19 eth1: with private IP as ...
2
votes
1answer
1k views

Set up firwall with iptables to only allow VPN

Im using IPredator VPN with openVPN and I want to make sure that if the connection is dropped, i wont submit data from the internet without the VPN. I heard that I could do that with iptables and a ...
1
vote
1answer
45 views

IPTABLES chain need help for restriction

I have two network cards eth0:- 172.16.91.70 (External Zone) eth1:- 172.16.85.70 (Internal Zone) I have clients in my Internal Zone which can access the external network. The ping goes fine and can ...
8
votes
1answer
2k views

Linux as router with multiple internet providers

Linux as router: I have 3 Internet providers, each with its own modem. Provider1, which is gateway address 192.168.1.1 Connected to linux router eth1/192.168.1.2 Provider2, gateway address ...
2
votes
0answers
263 views

Iptables and Port Scanning and Recent module

I'm trying to write an adaptive firewall using iptables, and am not clear on how the recent module is working. For example, see http://blog.zioup.org/2008/iptables_recent/ Snippet from my iptables: ...
1
vote
2answers
195 views

IP packets have wrong source address

I have two 4g modems connecting to a network and sending and receiving data. There is a problem though, as the modems keep getting kicked off the network because the source IP address of the packets ...
0
votes
1answer
72 views

Undoing specific iptables ip/port restriction

Say I add the following iptables rules: iptables -A INPUT -p tcp -s localhost --dport 4444 -j ACCEPT iptables -A INPUT -p tcp --dport 4444 -j DROP This allows localhost to access port 4444 then ...
2
votes
1answer
495 views

Port Forwarding using iptables on Open-Mesh

A quick overview for those who are unfamiliar with Open-Mesh: The system uses small wireless access points that automagically build their own mesh network. As long as one of the access points is ...
1
vote
1answer
131 views

Redirecting all IP over USB traffic to a fixed address

I'ma bit of a network newbie, so apologies for the inaccurate vocabulary. Say I have a device connected by IP over USB to my computer (running Ubuntu), that connects to 10.0.0.1. I configured my ...
2
votes
2answers
3k views

Debugging iptables using live packet views

Are there any CLI or GUI functions that I can use to monitor hits to iptables and watch as packets interact with iptables?
4
votes
2answers
6k views

How can I redirect outbound traffic to port 80 using iptables locally?

I'm trying to locally redirect ports on my Ubuntu machine using iptables. Similar to transparent proxying. I want to catch anything trying to leave my system on port 80 and redirect it to a remote ...
2
votes
1answer
160 views

LAMP Hardening, Transparent Proxy with iptables

I'm running a LAMP server with FTP(S) and several users. The users have only access to uploading PHP files and other web content. Some are running Drupal and Wordpress, but also a few home made stuff. ...
1
vote
1answer
191 views

Intercept incoming TCP/IP packets on Linux and perform NAT

I want to make a decision of what computer is behind the firewall sending the packet. Imagine I have 2 PCs behind the firewall and I want to, based on (my algorithm), make a decision at the firewall ...
1
vote
2answers
267 views

iptables: what the difference between filter and mangle

I am using iptables to to mark the package and want to route based on the marks. First I added the ip rule: sudo ip rule add fwmark 1 prohibit (The "prohibit" is just for test, I will change it ...