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

1
vote
2answers
5k views

Block all ports except SSH/HTTP in ipchains and iptables

How can I block all ports except ssh (port 22) httpd (port 80) using iptables and iphains?
12
votes
4answers
9k views

With Linux iptables, is it possible to log the process/command name that initiates an outbound connection?

I would like to keep track of the processes that initiate outbound connections on a Linux desktop. The best I can come up with is this: iptables -A OUTPUT -m state --state NEW -j LOG --log-uid This ...
6
votes
1answer
3k views

How to deliberately introduce a delay for incoming UDP packets

I want each packet (that match iptables rule) to be delayed by some fixed time interval. How to to this? Preudocode: iptables -A INPUT -p udp <more conditions> -j DELAY --delay 50000 # delay ...
3
votes
1answer
368 views

Why small TCP connections succeeds, but big ones fails?

Sometimes from Linux system I see the following weird behaviour: I able to ping things and sometimes use some services, but networking is very bad. For example, now I routed connection through my ...
6
votes
1answer
3k views

pfctl port forwarding in Mac osx?

-A PREROUTING -s 10.0.10.0/24 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080 -A PREROUTING -s 10.0.10.0/24 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8080 -A POSTROUTING -s 10.0.10.0/24 -o ...
7
votes
2answers
5k views

No idea what is listening on port 80 in OS X

I'm on OSX Mountain Lion 10.8.3, and I've freshly rebooted my Mac. I want to start a service (like Apache on port 80), but there is already something going on with port 80: telnet localhost 80 ...
6
votes
2answers
7k views

Setup routing and iptables for new VPN connection to redirect **only** ports 80 and 443

I have a new VPN connection (using openvpn) to allow me to route around some ISP restrictions. Whilst it is working fine, it is taking all the traffic over the vpn. This is causing me issues for ...
11
votes
1answer
23k views

What are the iptables rules to permit ntp?

My server's clock is wrong because the firewall doesn't permit ntp traffic. What are the iptables rules required to allow the ntp client to get out and back? Any suggestions how to implement those ...
3
votes
1answer
2k views

Load balancing with multiple gateways

I have to different ISPs, each on each own network. The main connects via ethernet and the secondary via wifi. The two networks have no relation at all. I just connect to them simultaneously. The ...
2
votes
1answer
730 views

How to route specific traffic through OpenVPN?

I'm running a server at home with rtorrent and apache2. I would like to route my rtorrent traffic via OpenVPN and since im kinda new to OpenVPN and iptables i would like to have a user friendly guide. ...
2
votes
2answers
689 views

Iptables port mapping from two PCs to one

We have 3 PCs, two of it are connected to internet (both of it have 2 NIC) PC1: eth0 - 1.0.0.1 (external IP) eth1 - 172.16.0.1 (internal IP) PC2: eth0 - 1.0.0.2 (external IP) eth1 - 172.16.0.2 ...
2
votes
3answers
2k views

How to install firewall script in Ubuntu?

https://help.ubuntu.com/community/Router/Firewall In the link above there is a firewall script described. How can I install this script in Ubuntu 10.0.4 desktop?
0
votes
1answer
720 views

DD-WRT - Host-based forwarding

I would like to know if I can configure DD-WRT router, that operates as the server's network gateway, so support different forwards based on hostname (other than port 80). I've configured ...
-1
votes
1answer
85 views

Bind incoming packets to 1 interface and outgoing packets to 2nd interface?

I am have a Linux machine with 2 network interface cards, I need to use one for incoming packets, other for outgoing packets.
2
votes
0answers
90 views

How to forward ports through ssh and nat to another machine

I have a problem when using ssh port forwarding and nat simoultaneously. Situation: Machine A runs a webserver on port 8080 Machine B is a raspberry pi which works like a little router. It has two ...
2
votes
1answer
1k views

How to allow FORWARDing with firewalld on a Fedora 19 router

I've just installed Fedora 19 and I'm using firewalld instead of iptables, but I'm having difficulty interpretting the new terminology. I have 2 NICs. One is specificed ZONE="internal" and the other ...
2
votes
5answers
12k views

What Iptables rules need I to forward a windows remote desktop connection?

I have this situation: network mask. 255.255.255.0 router/gateway: Ubuntu server (only command line, no gui) with internal lan ip 192.168.0.2 and a dynamic dns on the external ip Windows pc on ...
1
vote
1answer
331 views

Chromecast, Unblock-Us and Edimax BR-6478AC router

It seems that Google has hard coded the Google DNS into the Chromecast, thus making it pretty much useless for anyone outside the U.S. who wants to use it for Netflix and Hulu. I have the above ...
1
vote
1answer
111 views

Separating two networks

I have two routers, R1 and R2. R1 (a stock linksys router running dd-wrt) is connected to internet and is serving internet to a network of 5 devices/PCs running a DHCP server, with a network of ...
1
vote
3answers
490 views

I need a traffic monitor for Linux, that only counts in a specific wireless network

I need a simple traffic monitor for Linux, that counts the traffic in a specific wireless network because I have volume restrictions on that one. I tried it using the following iptables rule: ...
1
vote
1answer
152 views

How to setting up iptables for traffic fowarding on port 80 from specific sources

Im running a web server on port80, but i want traffic coming from ip 212.333.111.222 on port 80 to be fowarded to port 9020 on the same server that my web server is rinning at that is my sshd port
0
votes
1answer
56 views

Bidirectional two networks link

I have a two networks that I need to link in two directions. network A 10.11.0.0/24 - and its gateway 10.11.0.1 network B 10.0.0.0/24 network B has a VPN server (10.0.0.38) that is doing a ...
0
votes
1answer
731 views

Route LAN traffic through eth0, not tun0, on my VPN access point

How can I make my Access Point send traffic to 192.168.1.0 through eth0 and all other traffic through tun0? I have set up a Raspberry Pi VPN access point. It sits on the same subnet as all my ...
0
votes
1answer
215 views

How can I detect long-lived connections and mark them for shaping

I would like to detect TCP connections which have been open for more than one minute (or for greater than N bytes, or M packets), so I can classify them as bulk traffic ("downloads") and de-prioritise ...
0
votes
1answer
360 views

Linux box acting as wireless access point to share the internet connection

A linux machine is connected to internet over two interfaces ppp0 and ppp1 using two modems. Also this machine acts as wireless access point through an interface say, eth0 with ip address 192.168.1.1 ...
-1
votes
1answer
121 views

Configure IPTables [duplicate]

We have RHEL 5.0 squid proxy in our office. Our LAN is 172.20.12.0 /24 n/w. Proxy ip is 172.20.12.4 /24 . I want to share Internet through proxy. Most importantly: Suppose I have flushed the ...
-1
votes
1answer
488 views

LInux squid proxy

We have RHEL 5.0 squid proxy in our office. Our LAN is 172.20.12.0 /24 n/w. proxy ip is 172.20.12.4 /24 . I want to share internet through proxy. Most importantly: I want to give full access to ...
-2
votes
1answer
310 views

IP tables gateway

I am trying to make an iptables gateway. I ordered 3 dedicated server from my hosting company all with dual nics. One server has been given all the ip addresses and is connected directly to the ...