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
1answer
799 views

How to create a local-remote-local tunnel to a specific port using ssh

I'm able to establish an ssh connection from my windows computer (localhost - eth1) to my linux computer (remotehost - eth0) by doing: ssh user@192.168.1.100 Instead of using that, because I use ...
1
vote
2answers
510 views

Is Iptables blocking outgoing ssh connections?

I have been trying to do pulls from github and it keeps hanging. My iptables rules have no rules which block outgoing traffic but I cannot connect to github using either ssh or http. I can't even ...
1
vote
1answer
85 views

Forwarding all traffic to other server with iptables

Assume I have a sever with X.X.X.X IP address and a web server with Y.Y.Y.Y IP address. How would I forward web traffic from X.X.X.X to Y.Y.Y.Y using iptables? My servers run Linux and use iptables
2
votes
1answer
60 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. ...
0
votes
1answer
740 views

IPTABLES forward all ports except ssh

I have nat and packet routing working just fine, but I'd like to forward all ports except SSH to a static ip(192.168.0.3) What would be the correct iptables syntax to do this?
0
votes
1answer
3k views

Forwarding all incoming traffic on eth0 to go to eth1

I am trying to setup my raspberry pi to sit between my router and my modem. I'm basically trying to set it up as an intercepting proxy so that all web traffic goes through the proxy. I have the ...
3
votes
0answers
2k views

Route outgoing VPN traffic through local transparent proxy

I have a Digital Ocean droplet (similar to an Amazon EC2 instance) running Ubuntu Server 12.04.3 x64 with both strongswan 5.1.1 (built from source) and squid 3.4.2 (also built from source) installed. ...
1
vote
1answer
388 views

bind/named not working on UDP from external

This one is weird. I've set this up a long while ago, on a centos5. From what I remember, it used to work. For some time now, it's not. I've just been informed so no clue what changed when that made ...
1
vote
1answer
148 views

iptables password protection followup

This is a follow up on my other post about this iptables: plaintext password protection I could not get help in the old topic...I just really need some help... Here is the command I tried, something ...
1
vote
1answer
152 views

Use IPTables to force TCP packets over router

To test a TCP-stack program, I need to get the TCP packets via the router. When I try to connect to my server program via the router, the OS does not hit the router as the destination IP is the same ...
0
votes
3answers
1k views

How to configure iptables correctly

I'm a newbie to linux.I just implemented the following commands in iptables which I found on a site for security (i don't understand much about how each rule works). The commands are as follows: ...
0
votes
1answer
155 views

Per application rules in iptable

Is there possibility to add rule via iptable for specific process name? Good explanation of why I need it is here: "Under Windows, this helps making the PC more secure. There are many ...
2
votes
2answers
700 views

Connecting to an SSH server behind a NAT

I am having trouble connecting to an SSH server behind a NAT on an ubuntu workstation. I've installed openssh package(both the client and the server) and forwarded port 22 through the NAT and tried to ...
1
vote
2answers
1k views

Is selective VPN routing worth it?

I want to setup routing tables on my RT-N66U router to selectively route traffic through a VPN. For instance, only Pandora requests would go via the VPN. I've found a way to do this with iptables: ...
0
votes
1answer
164 views

Routing traffic over Vpn without NAT?

I want to tunnel traffic through my vpn but I just realized that my kernel does not have nat enabled ;( iptables -t nat -A POSTROUTING -s 10.20.0.0/24 -o eth0 -j MASQUERADE iptables v1.4.14: can't ...
0
votes
1answer
952 views

How do I block every connection except vpn and ssh without endangering the state of my vps?

I have some vps space but I get alot of scans based on what I see in iftop. I tried some iptables stuff but it gets tiring and useless to put all the ips that I see in the logs. I am wondering about ...
1
vote
0answers
177 views

“iptables -P OUTPUT DROP” blocks DDWRT's web interface

When I do iptables -P OUTPUT DROP it blocks DDWRT's web interface. That is I am not able to access http://192.168.1.1 via Firefox. I put this rules before changing the chain policy to drop: ...
1
vote
0answers
224 views

using iptables to filter vboxnet (virtualbox host only network)

Im trying to use iptables to filter the traffic coming from a guest OS running on virtualbox. The guest is configured to use a host only adapter for the network, and my Ubuntu host is configured to ...
0
votes
0answers
226 views

Why does iptables restart cause connectivity timeout for about a minute?

I have a centos 6.5 64bit router with 3 nics. The box is configured to route 2 networks. netA - eth1 [ about 10 clients ] netB - eth2 [ about 100 clients ] provider - eth0 [ fiber to isp ] I have a ...
0
votes
1answer
408 views

UFW default rules… where are they?

In the tutorial on UFW here https://help.ubuntu.com/community/UFW it says that UFW uses the default rules if enabled and not configured. I checked the folder: /etc/ufw/ and the files I found ...
0
votes
1answer
483 views

IPTables and Port redirection Apache2

I'm using Apache to redirect a subdomain to a port (mod_proxy, mod_proxy_http, mod_proxy_ajp) and IP Tables to restrict direct port access except to me and the local server. My IP Tables looks like ...
0
votes
0answers
119 views

client still cannot get internet access from gateway pc

I have already set up a laptop as a gateway in ubuntu 12.04. with 2 interface cards. internet >> eth0 >> gateway pc >> eth1 >> Access Point for eth0 IP dhcp for eth1 Static Ip 192.168.5.1 Access ...
0
votes
0answers
43 views

Need help changing where iptables logs to

I'm writing a program that needs to read in and look at the iptables log file. I know how to write rules for iptables and to make it log, but by default it logs to kernel.log. Is there a way to make ...
0
votes
1answer
89 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
45 views

Setting up Debian local server on specific port

I'm trying to set up a local web server using the port 8000 to be accessed from an internal LAN network in order to test a web application. The problem is I'm not sure how to do it. I created two ...
1
vote
3answers
441 views

Temporary iptables changes

I have a remote system that I SSH. Since I am planning to make this system more publicly accessible, I want to improve my iptables rules over the current policy of accepting anything. I have added a ...
1
vote
1answer
188 views

iptables detects clients behind NAT?

I'm setting up a server that I want to protect from DoS attacks, by setting a limit using iptables: iptables -A INPUT -p tcp --dport 80 -m limit --limit 25/minute --limit-burst 100 -j ACCEPT (default ...
0
votes
1answer
13 views

Is there a way to see when iptables was last changed?

Is there a way to see when iptables was last changed? I'm running CentOS5. I found this morning that the configuration is different from what I set 6 months ago.
1
vote
2answers
2k 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
731 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 ...
1
vote
0answers
310 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
176 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
229 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
148 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
283 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
814 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
513 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
335 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
392 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
231 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
493 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
1
vote
1answer
242 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
879 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
2k 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
138 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
572 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
178 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
404 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
1answer
481 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
215 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 ...