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
782 views

Route traffic through VPN to some IPs occasionally

I would like to route traffic to some specific addresses through VPN. Easy enough, one can simply add a route: ip route add <destination ip> dev tun0 scope link Here comes the catch: I do not ...
1
vote
1answer
185 views

How to block incoming traffic on a virtual interface?

How do I block all incoming traffic on eth0:0 but keep eth0 open? What I've tried is this: iptables -P INPUT DROP iptables -A INPUT -i lo -j ACCEPT iptables -A INPUT -i eth0 -j ACCEPT But this ...
0
votes
0answers
104 views

Ping through GRE tunnel discarded between 2 interfaces of a router - Ping does not reach subnet

I have an interesting issue that I hope someone can help with. I am trying to create a GRE tunnel between 2 routers (running Linux Ubuntu 12.04) and pass traffic between 2 subnets trough this tunnel. ...
0
votes
2answers
132 views

is there an iptables rule to allow only email on port 25?

Is there a way to block port 25 for everything but mail communication? Had no luck finding an answer to this yet. Maybe it's possible to block every application but those related to above usage? I am ...
2
votes
1answer
114 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 ...
0
votes
1answer
83 views

how to restore iptables after iptables -F?

I used iptables -F on my machine, and what can I do to recover the iptables into the default without rebooting my machine? I restarted the iptables service and it failed, and I can't find iptables ...
1
vote
1answer
113 views

excluding port from VPN client

I use hidemyass which is a vpn service. I use it for privacy reasons. The main purpose of the VPN is for my web browsing. How can I exclude certain ports from using the VPN connection? For example: ...
1
vote
2answers
250 views

Why nic with incorrect subnet mask can still ping the gate way?

At first, my network config was like this: $ ip a 2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 3c:97:0e:bd:b1:68 brd ff:ff:ff:ff:ff:ff ...
-1
votes
1answer
263 views

Iptables: allow wget

for some reason the following rules block wget. iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -p tcp --dport 80 -j ACCEPT iptables -A INPUT -p tcp ...
1
vote
1answer
152 views

Iptables limit user access time and mac

I am trying to create an iptable chain to kick my daughter off her ipad during the night. With the mac only filter I can block access but when I add time it no longer works. Does anyone see an issue ...
0
votes
3answers
143 views

Show a default page after connecting to WIFI LAN

I have the following setup at home: |--------------------| INTERNET ---- | GATEWAY COMPUTER | ----- WIRELESS ROUTER )))))) CLIENT 10.10.0.2 ...
0
votes
2answers
113 views

How to set iptables?

I want to allow traffic only for httpd(nginx), port 2710 and ssh. I've tried the following, but it didn't work and apparently all httpd, traffic was blocked and I couldn't access ssh as well. There ...
0
votes
1answer
366 views

Redirect/Block outgoing HTTP traffic for a specific URL on Mac

I want to know if it's possible to redirect or block HTTP traffic with a string like this command on linux : iptables -A OUTPUT -p tcp -m string --string "STRING" -j REJECT
0
votes
1answer
146 views

On Linux, can I forward wlan0 to eth0, and wlan1 to eth1?

I have the following simple situation: two internet connections via two distinct ethernet NICs, eth0 and eth1, and two APs (I use hostapd, of course) on two distinct wireless cards, wlan0 and wlan1. ...
1
vote
1answer
309 views

iptables NAT doesn't preserve remote IP

I have the iptables rules below forwarding incoming ssh traffic on port 2222 to a virtual machine running in a vmware "vmnet" network on the same host. 192.168.1.1 192.168.1.40 +---------+ ...
1
vote
1answer
765 views

Sharing OpenVPN to specified IP-range on the local LAN

Is it possible and how to share OpenVPN (currently Anonine) -connection to specified IP-addresses on the local LAN? Local LAN consist windows- and linux machines and Android devices. Current setup, ...
0
votes
1answer
87 views

Same IP on two NICs?

This is similar to this question. However I'm looking for an answer from a perspective of worst case scenario, and risks involved. I'm not interested in LACP or cnahhel bonding. I have a computer ...
0
votes
1answer
329 views

DD-WRT port forwarding doesn't work for internal subnet

I've a router with dd-wrt firmware. I've setup 2nd IP address via Iptables commands and have portforwarded one port. It works fine. However it doesn't work internally. Trying to go internally for ...
0
votes
1answer
112 views

iptables routing traffic from1 pc to another and then out to specific internet IP

I have a server (10.10.10.2) that can't access the internet and has an APP on it that needs to access a service on public IP w.x.y.z. Another server (10.10.10.3) that does have internet access can ...
0
votes
0answers
217 views

Dropping Packets with Openvswitch Openflowcontrol

I am trying to setup some Flows with ovs-ofctl to block all unwanted incoming packets for a VM. The commands I use are: ovs-ofctl add-flow xenbr0 "priority=65000, table=0, tcp, dl_src=*, nw_src=*, ...
0
votes
0answers
94 views

how to proxy to a VPN connected server with local services running?

I'm having trouble accessing services that are running on my Linux Box from outside the local network. The setup is not as simple as most tutorials describe so I'm a bit stuck. My Linux Box (running ...
0
votes
1answer
333 views

How to set a port forward in Ubuntu's iptables?

This quote should explain me how to do this, but I don't get it... Next, I had added following rules to forward all http requests (coming to port 80) to the Squid server port 3128 : iptables ...
0
votes
0answers
124 views

How how can I set up iptables for a Squid proxy?

I rented space on a server with a static IP address, and I would like to set up a transparent proxy on this server. After configuring the Squid for testing purposes with the listener http_access ...
1
vote
2answers
2k views

iptables gives me and error “can't initialize iptables NAT”

I am trying to use iptables and it is giving me the following error root@vikkyhacks:~# iptables -t NAT -L iptables v1.4.18: can't initialize iptables table `NAT': Table does not exist (do you need to ...
1
vote
1answer
97 views

Traffic not being forwarded through NAT

I have a router which provides internet access using NAT, and a client Linux box (A) which is connected to this router on eth0. This Linux box also has a wlan interface, wlan0; what I would like is ...
0
votes
1answer
832 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
43 views

redirect data form tunnel to another network

I have Linux computer with eth0(192.168.1.20/24) and tun0(10.8.0.6/24) interface. I am sending data through tunnel to Linux computer in the specific port and want to redirect all data to another ...
0
votes
1answer
230 views

Iptables filtering and NAT with secondary IP address

I have two IP addresses on my physical eth interface. Lets say 192.168.10.7 (eth0:0) and 192.168.0.7 (eth0). So it works. But I use application, working on the only one of this addresses on port ...
0
votes
1answer
978 views

Using iptables to redirect ip address

I have the requirement on a Linux system where the Linux device is using RSYNC to sync data to another Linux machine. This is working fine at the moment, however I need to move one of the machines to ...
1
vote
1answer
146 views

With iptables only allow certain outbound ports

Okay, I'm running a router with shibby tomato (linux based) v1.28-115 and have a bridge network setup (br1) that consists of a guest wifi. I want to only allow access to specific outbound ports... ...
0
votes
3answers
837 views

Use iptables on gateway for port forwarding

I have a Linux machine in my local network that I use as a gateway, so all of my network traffic passes it (the machine has only one network interface which I use for incoming and outgoing traffic). I ...
0
votes
1answer
92 views

Will using iptables DROP target cause TCP CLOSE_WAIT that never completes?

I have some simple rules to block certain IP blocks used frequently by hackers/spammers, e.g.: iptables -A INPUT -s 173.208.250.0/24 -j DROP But, I noticed that apache hangs after a couple of days ...
3
votes
1answer
2k views

How do I forward traffic between Tun device and eth0?

In summary, I would like to have Tun device traffic forwarded back and forth through another network interface that has internet connection. While I can see the traffic going out to internet ...
0
votes
1answer
290 views

iptables stupid error (iptables -A INPUT -j ACCEPT)

[root@router ~]# iptables -A INPUT -j ACCEPT iptables: No chain/target/match by that name. How is that possible? I recompiled the kernel (3.11.8) and updated iptables to 1.4.16. The strage thing is ...
0
votes
0answers
96 views

iptables messing up Tomcat?

I encountered the following problem(s) using Tomcat 7 with iptables on. 1) Namely, there's this Tomcat 7 instance that I run on server-1 (directly exposed), and this Tomcat instance hosts a REST ...
0
votes
0answers
95 views

Session limit for OpenSSH server on Ubuntu Desktop 7.10

I need restrict session limit on my OpneSSH server only for one session (one connection). I use Ubuntu Desktop 7.10. Of course Version is old, but I need it for experimental purposes. I tried modify ...
0
votes
0answers
137 views

centos 6.4 nat virtual machines not able to connect to the internet

I have two virtual machines running on virtual box. The master has one interface(eth0) bridged to the host nic(eth0) and another one connected to the internal network(eth1). This acts as a gateway to ...
1
vote
1answer
352 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 ...
-3
votes
1answer
3k views

How do I block all ports except 22 and 80 in Centos6.2 64bit

How do I block all ports except 22 and 80 in Centos6.2 64bit. thanks all.
0
votes
0answers
199 views

Req' Iptables Guru: rule to forward to HTTP proxy

I have a RPi with two interfaces, wlan0 and eth0. Through eth0 I have connected a set-top-box (STB): the network for eth0 is 192.168.2.0/24. My experiment is to use a transparent HTTP proxy ...
0
votes
1answer
345 views

INPUT or PREROUTING, which is first checked?

About iptables. I saw contradictory explanations. This site and most article say PREROUTING chain is checked before INPUT chain. But another tutorial(page 4-6) says INPUT is before PREROUTING. Whom ...
-5
votes
2answers
106 views

Is there a way to pause/resume particular TCP connection?

I'm playing online game that matches me against random players. I found out that when I unplug my Ethernet cable, I have a minute to decide do I want this match to count. If things go wrong, I just ...
0
votes
0answers
31 views

Allow INPUT port for specific UID

I want to restrict an open UDP port from the INPUT chain to a specific UID, so that only if a process belongs to the UID, it receives packets on that port, otherwise they are rejected. For some ...
0
votes
0answers
52 views

Web proxy on LAN - iptables and Win Firewall

My LAN is simple: Router: C.C.1.1 Win 7 laptop: C.C.1.2 RPi: C.C.1.3 "C.C" = 192.168... The Win 7 laptop is connected via its WiFi interface. I have connected another machine (let's call this ...
2
votes
1answer
261 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 ...
0
votes
1answer
631 views

Centos 6 server does not open ports

So after some battling and struggling with the firewall, i see that I may be doing something or the firewall isnt responding correctly there is has a port filter that is blocking certain ports. Okay, ...
0
votes
1answer
789 views

debian gateway using iptables

I am having problems setting up a debian gateway server. My goal: Having eth1 the WAN interface. Having eth0 the LAN interface. Allow both ports 22 (SSH) and 80 (HTTP) accessed from the outside ...
0
votes
1answer
28 views

List rules using iptables in a customized way

How to list the iptables rules in a customized way? Like: target protocol portnumber src dest the order could be changed but I dont want the name of protocols, just number (like 80 instead of http) ...
0
votes
1answer
315 views

Can't ping through default gateway

I have the following configuration: Routing table on M3 is: Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.2.1 0.0.0.0 UG ...
0
votes
0answers
234 views

SCP over NAT stalls at 2112KB

I have two systems (A and B) on different subnets, with one dual-homed box (C) that can see both. I use iptables DNAT on C to port-forward SSH to B, so that A can run ssh -p 12345 hostC to connect to ...