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
5answers
6k views

Home network to accept only certain MAC addresses from LAN

I have Ubuntu 10 as router with WAN(eth0) and LAN(eth1). How can I restric eth1 to accept only packets from certain MAC addresses and drop the rest? I am also about to setup DHCP to certain MAC ...
1
vote
3answers
918 views

iptables LOG actio writes to STDOUT

when I use LOG action in some chane of iptables rules, I get the output both in STDOUT or STDERR of the xm console and in /var/log/messages. Is there way to make iptables to write only to log ...
1
vote
2answers
415 views

Why after Accepting Ports 20 and 21 in iptables are they still closed?

I am trying to open the FTP Ports on my server. I have vsftpd installed on the server already. However I am unable to reach the server on ports 20 and 21 Somehow it is allowing me to access port 21 ...
1
vote
2answers
66 views

How to check/adjust SSH server on embedded board

I'm currently having difficulties connecting to an embedded board from my Linux machine through ssh. The embedded board is a FOX G20 V with a Linux OS. I've tried to connect to the board through ...
1
vote
1answer
2k views

Iptables redirect to localhost?

Suppose I have a network with a server routing all connections from inside the network to the Internet. How can I set up iptables so that instead of routing incoming connections to the Internet, it ...
1
vote
1answer
120 views

How iptables behaves on timezone change?

I have doubt how iptables keep changing the info in iptables when timezone is change. I am using iptables s v 1.4.8 I have blocked one IP with following details # date Thu Jun 6 12:46:42 IST ...
1
vote
1answer
1k views

Will increasing number of rules in iptables slow down my internet

How much impact will the rules have on speed, if we are using match to queue the packets.
1
vote
1answer
31 views

Should my server ever need to directly communicate with the NAT gateway?

What I mean by ``directly communicate'' Does it ever need to receive packets with the gateway's IP address as the source IP address, or send packets with the gateway's IP address as the destination ...
1
vote
1answer
54 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
1
vote
1answer
165 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
2answers
103 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
286 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: ...
1
vote
1answer
115 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 ...
1
vote
2answers
592 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
2answers
218 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
vote
1answer
273 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
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
2answers
108 views

DNS set correctly but website unreachable

I have the (sub)domain elo.bernardinuscollege.nl, which has a DNS A record that points to 54.225.118.87, which is correct (checked it with telnet, which indeed returns the right IP). For some reason ...
1
vote
3answers
379 views

Setting up two ADSL lines for home/business use

As a follow-up to this question which is still unresolved. I have two ADSL routers with different providers connected to different phone lines to the internet. As shown in the diagram. These routers ...
1
vote
1answer
153 views

Can't reach web server from local virtual network

I have installed a couple of virtual machines. Some uder Windows, some under Fedora Linux. On one of the Fedora machined I've installed Apache web server. I have setup server name in httpd.conf to ...
1
vote
1answer
93 views

Valid Type Of Service Values

I need to know what are valid values for TOS field in iptables. I mean when I try to add a rule with ip rule add what can I give as tos value I could not find any resource about tos value. I know ...
1
vote
1answer
1k views

unable to connect to localhost:80 after installing nginx

I just installed nginx by doing sudo yum install nginx and I'm unable to connect to it on port 80. I tried stopping iptables by doing sudo service iptables start and was still unable to connect. I'm ...
1
vote
1answer
70 views

iptables -L lags on non localhost or anywhere address

I am trying to configure iptables for ubuntu 10.04 and I have a problem with iptables -L lagging on rows where the destination or source address is not localhost or anywhere. The following entries ...
1
vote
1answer
806 views

Rerouting traffic from port 80 to another port on a single ip

I have a server with multiple IP addresses associated with it. I'm trying to run a node.js web server (which I do not want to run as root), using only one of those ip addresses (it would be very bad ...
1
vote
2answers
5k views

How to alias an IP address to make DLNA resource accessible from different IP network

what I have I have a home wifi network 192.168.1.0/24 having DLNA resource 192.168.1.100. I have a TV with ethernet and a netbook with both wifi and ethernet interfaces. I want to make my notebook ...
1
vote
2answers
3k views

Setting up a Linux server with a public Static IP

I have setup a Ubuntu Linux server in an office. It should have a public IP so that outside users can access the internet. Currently, it is set with a public IP, but is it supposed to have a local ...
1
vote
1answer
599 views

Feedback to router users during access-restricted hours for DD-WRT

Following router schedule rules that I change often, the stock firmware on my D-Link 825NA rev. B redirects HTTP requests to a built-in "Access denied!" warning at appointed times. I just upgraded ...
1
vote
2answers
2k views

Howto compile a kernel module on CentOS [required packages]

What yum commands do I need to get available packages installed on CentOS to build a iptables MATCH kernel module.
1
vote
2answers
2k views

Routing from the DMZ to the interior network only

I have a home network connected to Verizon's FIOS service. Verizon's ActionTec router is connected to the ONT via coax to establish the MOCA network. My DD-WRT router's WAN port is connected to one ...
1
vote
3answers
18 views

Firewall init script

On Debian, what is the best way to start an iptables firewall script : /etc/init.d/firewall_script.sh in /etc/network/interfaces, add post-up /etc/network/if-up.d/firewall_script.sh Do you check ...
1
vote
3answers
93 views

How to block all ports except 80,443 with iptables? [duplicate]

Blocking all ports(in and out) is easy but it's hard with the word "except". I don't know any rules that satisfies the condition. PS: I know this question is nothing new. But in fact, I didn't find ...
1
vote
1answer
70 views

Combination of NAT, DHCP, and OpenVPN on lubuntu 14.04

Okay, so I've got a set up, where eth0 my internal IP address (192.168.1.3) it has been configured as my default gateway using the iptables this sudo sysctl -w net.ipv4.ip_forward=1 sudo ...
1
vote
2answers
100 views

Apache runs locally but can't be accessed from other machine

I'm running Apache 2.2.3 in a VM for a test environment on CentOS 5. Apache is running and responding to requests on the VM itself. If I run "lynx localhost" on the VM I do get my test page. When I ...
1
vote
1answer
108 views

How to transparently tunnel a port from IPv4 to a remote IPv6 device?

At home, I am connected with an IPv6 address and additionally, my provider provides a NAT-like setup through which I receive a public IPv4 address that I share with other customers (the reason being ...
1
vote
1answer
148 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
1answer
145 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 ...
1
vote
1answer
88 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 ...
1
vote
1answer
135 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... ...
1
vote
1answer
337 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
70 views

Drop IP fragments of a certain protocol

When conntrack is active, the iptables stack never sees a fragmented IP packet, only the reassembled one (source), so the -f test never matches. If I want to block any fragment I could set ...
1
vote
1answer
145 views

Disable SSH remote tunneling

I need to restrict SSH tunnel functions. Users should not be allowed to create remote tunnels but only tunnels to localhost. I tried to setup the whole thing in the SSH configuration but I can only ...
1
vote
2answers
907 views

CentOS 6.4 and alternate SSH port not working

I've got a CentOS 6.4 machine and would like to change the default SSH port, and followed these instructions: CentOS Wiki After making those changes (including the "semanage port -a -t ssh_port_t -p ...
1
vote
1answer
347 views

Internet access to host behind firewall using ssh tunnel

My goal is to give host behind firewall access to the internet. Below you can find brief description of network [internet] <-> [proxy] <-> [A] <-> (firewall) <-> [B] [A] - ...
1
vote
3answers
3k views

Source Based Policy Routing & NAT (DNAT/SNAT) aka Multi WANs on CentOS 5

Originally posted at Unix and Linux but nobody was able to answer it, so m migrating the question here: My question is regarding Source Based Policy Routing on CentOS 5 with 2 WANs plus a LAN (NAT) ...
1
vote
1answer
1k views

Forward connections on 0.0.0.0:80 to 127.0.0.1:9091

I'm trying to set up a tor-relay. In order to allow tor to present a static web page explaining what it is I want the server to listen on port 80 and 443. In order to allow tor to use ...
1
vote
1answer
406 views

OpenVPN + Squid or another way of blocking advertisements/websites?

I have a personal VPN that I use on my tablet for public wifi protection. Adblock+ is limited on android in that you need to set up a proxy for it to work, and this isn't ideal. Before I started ...
1
vote
1answer
167 views

ICMP firewall policy for standard ubuntu desktop

For a standard desktop computer running Ubuntu 12.04 behind a NAT router, what ICMP packets should one accept in the firewall, say iptables? It seems there is often conflicting advice; some say block ...
1
vote
1answer
2k views

how to open ports for localhost on linux?

I've been reading for the past hour about opening ports on Ubuntu 12.04 and I can't seem to get anything to work. I'm running a program with an RPC server accepting local connections on localhost ...
1
vote
2answers
510 views

How do I route a port range in a linux host to a guest VM?

I am trying to redirect a certain port range in a linux host to one of its guest VMs. I would like for this redirection to apply to all the host's interfaces, including localhost. I was able to do: ...
1
vote
1answer
1k views

iptables rule for loopback interface lo

I want to test some network performance, where I need to use a tcp client to connect to a tcp server program on the same host, so I used localhost(127.0.0.1) however, when the TCP SYN is sent, it get ...