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

2
votes
1answer
903 views

Nginx works on my linux machine but is not accessible from other computers in my local network

In my LAN network I have a server with Scientific Linux (RedHat or Fedora based distro), I've done yum install nginx but the welcome page is not accessible from other computers in my network. When I ...
2
votes
2answers
975 views

How to route the incoming connections through a specific interface?

I have multiple ethernet cards with two different set of networks configured on them. The output of route -n is given here:: Kernel IP routing table Destination Gateway Genmask ...
2
votes
4answers
8k views

iptables: Allow only HTTP access for web browsing

Have a linux box, want it locked down but just be able to surf internet on it. Why is this script blocking http too? #!/bin/sh # # iptables -F # #Set default policies for INPUT, FORWARD and OUTPUT ...
2
votes
2answers
711 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
1answer
4k views

DD-WRT Setting Up Guest Network

I have a router on which I installed DD-WRT firmware. I am trying to set up a virtual interface to use as a guest network. The guest network should be on the 192.168.8.0/24 subnet while our LAN is ...
2
votes
1answer
1k views

iptables equivalent in windows-xp,win7?

I want to do port forwarding in win7,what's the iptables equivalent in win7?
2
votes
2answers
284 views

Logging communication between two VMs

I'm trying to set up "malware lab" described in this paper. So far, I've set up Windows guest system, adding one Host-only Network adapter, and setting this (sorry if the names aren't exactely ...
2
votes
2answers
1k views

what does “-m tcp” mean in this iptables rule?

Firewall configuration written by system-config-firewall -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
2
votes
1answer
157 views

Allow shell access for key holders OR password login for whitelisted IP addresses

As a first line of defense against brute-force attacks, I've restricted SSH login attempts with TCP wrappers (denying access by default, and maintaining an IP whitelist in /etc/hosts.allow). However, ...
2
votes
2answers
330 views

How to send out some traffic via my vpn connection

I had a working setup where I could access all my work resources which are accessed via VPN going via my server previously however at some point recently this stopped working for no obvious reason. ...
2
votes
2answers
2k views

OSX: Mimic Ubuntu IP Masquerading via iptables with ipfw

Good day, I am attempting to replicate a setup I have between a router and an Ubuntu PC, and have the same setup working on my MacBook (10.6, Snow Leopard). First, I have a router that has a USB ...
2
votes
1answer
320 views

Different routing rules for a particular user using firewall mark and ip rule

Running Ubuntu 12.10 on amd64. I'm trying to set up different routing rules for a particular user. I understand that the right way to do this is to create a firewall rule that marks the packets for ...
2
votes
1answer
1k views

How to block access to a website on Lucid Lynx?

I am trying to block a few websites on a lucid lynx, I tried editing /etc/hosts and that blocks access via url but the site still open if I enter the ip on the browser, how can I block ip access also? ...
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 ...
2
votes
1answer
596 views

Mirror Port via iptables

I have a dedicated Linux (Debian 7.5) root server, with a number of guests set up. The guests are KVM instances, and get network access via bridge-utils (NAT, internal IPs, use the host as a gateway). ...
2
votes
1answer
31 views

When writing an iptables save file by hand, how does one calculate the packet-counter and byte-counter values?

I am attempting to write a 22MB iptables rule-set file, the very kind that is generated with the iptables-save command, except endlessly long. Understandably, this takes a prohibitive amount of time. ...
2
votes
2answers
4k 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
1answer
1k views

Bandwidth limit by Port on iptables

What iptables function would i write to bandwidth limit all traffic on port 566 to 2KB/s? Im confused exactly of how to do this.
2
votes
2answers
334 views

Force certain applications to use VPN

For a few days now, I've been trying to force only certain applications to use a VPN. I've thus far found it pretty simple to either force all applications to use it, or no applications to use it. ...
2
votes
1answer
484 views

IPTables - unknown error 4294967295

I've moved an old Slackware 11 installation from a physical PC to a virtualized in ESXi. Everything seems to work fine except for one rule in iptables, namely the row: iptables -t filter -I INPUT -m ...
2
votes
1answer
747 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
1answer
2k views

Port forwarding with IPTABLES and VBox

I have a small problem with getting a proper configuration of iptables under Ubuntu. But before, let me describe the network configuration: I am using xDSL line terminated with modem+router+DHCP ...
2
votes
1answer
447 views

Save iptables when iptables-save doesn't exist?

I'm working on a Soekris net4801 that is running an unknown distro of Linux. The kernel is 2.4.29, and iptables is v1.3.4. I can't work out how to save the iptables. I searched the whole system for ...
2
votes
3answers
3k 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?
2
votes
2answers
1k views

linux: how to run aria2 or wget only through eth0

I have a computer under Linux with several network cards, for example: eth0, eth1, eth2, eth3. Is there some way to run any downloader, like aria2 or wget only through one interface, for example eth0? ...
2
votes
1answer
15 views

How to apply ipfw rules to domains that resolves to multiple IPs?

Suppose I wanted to use ipfw to throttle uploads to youtube. The uploads are made to upload.youtube.com but this domain resolves into multiple different IPs (which also appear to change over time). ...
2
votes
1answer
42 views

IPSet with IP6Tables ERROR

Can someone please solve my headache and tell me how to fix this? [root@www ~]# ip6tables -I INPUT -m set --match-set blacklist6 src -J DROP ip6tables v1.4.7: Couldn't load match ...
2
votes
0answers
60 views

Block all outgoing traffic for a User running Wine apps

Good day, I'm using a lot of WINE apps under Linux which work just fine, but one thing I am specifically looking for right now is to block their access to the internet (outgoing), with exception of ...
2
votes
0answers
144 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
0answers
46 views

Determine if an uplink interface is usable

I have a firewall system that is served by two uplinks to different ISPs. I'm using shorewall to manage the firewall; it load-balances traffic over both interfaces with connection tracking. All that ...
2
votes
1answer
115 views

How does uTorrent can automatically forward port through Linux Net Filter based firewall?

I have dilemma: How it is possible that uTorrent shows on my internal machine with internal IP, that my connection is OK (green check in the bottom right of its window), while I never forwarded any ...
2
votes
1answer
270 views

CONNMARK on rewritten packets

I have a host, on which I rewrite saddr and daddr of IP packets coming to it, this is done by the program, employing libnetfilter_queue. Basically it acts like proxy. For example, the packet comes ...
2
votes
2answers
981 views

How can I port forward an LAN port to a WAN Ip with iptables?

Using iptables on my router (dd-wrt), I'd like to forward requests to the router on port 64738 from the LAN to an IP (192.168.10.14) on the WAN. This is the opposite of the norm (forwarding a request ...
2
votes
0answers
172 views

Limit bandwidth on HTTP downloads based on file size

Is there a way to limit lets say in iptables or any proxy solution/software if a user is downloading a filesize that is greater than lets say 20MB it will limit his entire download at 2KB/s? ...
2
votes
1answer
2k views

How to use NAT iptables rules for hostapd

My PC is equipped with two net interfaces - wlan0 and eth0. I want to use WiFi port as access point on wlan0. So i use hostapd facility and it works properly in routing mode in local network. Users ...
2
votes
1answer
712 views

iptables status enabled after restart even after disabling

I am disabling iptables on Oracle Linux 6 with these commands. setenforce 0 service iptables stop service ip6tables stop chkconfig—level 123456 iptables off chkconfig—level 123456 ip6tables off ...
2
votes
2answers
2k views

How to use iptables to connect proxy server

In my company, all http and https must connect to a proxy server, which means we must set proxy in our web browser. Our department has an internal network (192.168.0.xxx). I use a Linux server as ...
2
votes
1answer
195 views

amule, Fedora 14, iptables

I need to set iptables rules for aMule, but I am not sure which one are the right ones. Googling around, I have seen something like: iptables -I INPUT -p tcp --dport 4662 -j ACCEPT iptables -I ...
2
votes
1answer
159 views

Why does Firefox need a loopback connection?

I was playing around with firewalls and iptables. When I blocked any traffic except HTTP and DNS I was able to establish a connection to google.com via wget google.com. But I wasn't able to open ...
2
votes
0answers
261 views

Centos iptables blocks after reboot

I have a Centos5 installation with kvm on my server. I am using nat portforwarding to ssh my virtual machines. I have several iptables rules and saved then in /etc/sysconfig/iptables. After reboot, I ...
2
votes
1answer
225 views

dd-wrt: Keep source ip after port forward

I just started using dd-wrt on my wndr3700, but now all my incomming connections to a server inside the network gets the same source ip as the router. How can I change this back so I get the real ...
2
votes
1answer
2k views

Reverse Proxy for TCP (RDP, VPN, etc) and HTTP

I have a domain that points to my ISP assigned IP though a CNAME (cname goes to my noip address incase my ISP decides to change the IP), I would like to route different subdomains to various IP:PORT ...
2
votes
1answer
1k views

How to match multiple strings in iptables

I have 2 strings, and i wish to queue the packet if it contains both the strings ( something like ("jsh"&&"gjhyg")), i tried following ways, but they don't seem to work: sudo iptables -A ...
2
votes
1answer
1k views

Gateway on a virtual network interface used by LXC guests

I'm currently having some problems with configuring a gateway for a virtual network interface. Here is what I've done : I created a virtual network interface : # brctl addbr lxc0 # brctl setfd lxc0 ...
2
votes
2answers
2k views

iptables firewall only allows internet traffic if source port of 80 is allowed

I am configuring an iptables firewall, currently just to allow http and https traffic. It is working but under a particularly strange rule - I must allow incoming connections with a source port of ...
2
votes
0answers
669 views

How do you add a MAC-based routing whitelist with DD-WRT and the OpenVPN client?

I have an OpenVPN client set up on my DD-WRT home router which maintains a VPN into my workplace. Slight problem: I don't want random lusers who access my wireless AP to have access to my company's ...
2
votes
2answers
890 views

Using iptables to selectively route outgoing requests?

I'd like to set up my Dd-WRT firewall so that it uses the VPN service from a VPN provider to access a bunch of destinations and normal route foe all other requests. In detail: giganews.com would be ...
2
votes
4answers
456 views

Block all but http traffic on a network interface

I've got two network interfaces on an Ubuntu machine which go out to two different networks but both have internet gateways. I need to limit it so that any outgoing http requests it makes (ie ...
2
votes
1answer
252 views

Restrict the number of http and https connections from a specified IP address to ten connections per minute

How I can restrict the number of http and https connections from a specified IP address to ten per minute usingiptables commands? I’ve tried this but it is not working: iptables -A INPUT -s ...
1
vote
2answers
6k 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?