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

0
votes
1answer
1k views

How to do port forwarding/redirecting on Debian?

I have two questions. Question 1: My debian machine has interface eth3 with ip 192.168.57.28. If someone tries to connect to 192.168.57.28:1234 how do I redirect the request to another machine: ...
1
vote
3answers
554 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 ...
8
votes
2answers
41k views

need iptables rule to accept all incoming traffic

For my test environment i want to accept all incoming traffic, can someone please give me the iptable rule to be added. My current iptables -L -n output looks like this Chain INPUT (policy ...
0
votes
1answer
675 views

Unable to ping my VirtualBox VM

I've installed a VirtualBox VM from http://virtualboximages.com/CentOS+6.4+x86_64+LAMP+Server+VirualBox+VDI+Virtual+Computer. My VM has access to internet, and I can ping the host. I've set a static ...
1
vote
1answer
3k views

Redirect incoming https to local ip with iptables

I have a router with 1 network interface (eth0, public ip) and an alias for eth0:0, local ip 192.168.1.1. I want to redirect all incoming https (443) traffic to another server. I tried it with ...
1
vote
1answer
456 views

Multiple IP addresses through the same interface and iptables

System Admin is not my strong point. My situation is we have 1 website that has 4 domains. The website itself serves different templates/content depending on which domain is used, simulating 4 ...
2
votes
2answers
3k 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
1
vote
1answer
2k 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
263 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 ...
0
votes
1answer
1k views

iptables MASQUERADE and SNAT together

Good people, I have a network having the following setup eth0 10.216.11.41 internet facing eth1 192.168.0.4 internal network interacting with other machines within the internal network. Id like ...
0
votes
1answer
110 views

IPTABLES to block sites on browser

I am trying to block a specific IP address from being accessed using the browser on my system. I added a simple rule as below iptables -A OUTPUT -d <IP> -j DROP The site gets blocked in the ...
0
votes
0answers
323 views

iptables not working on DDWRT firewall

I have write a firewall rules for DDWRT router but I didn't work. What I needed is, I would like to set all my wireless user, once it reach daily quota which is 200mb it will disconnected from the ...
0
votes
0answers
3k views

Can't connect to mysql by telnet 127.0.0.1

I can't telnet MySQL on my localhost. MySQL is up and running and works fine with Apache-SSL/PHP/MySQL server but I can't connect by telnet: telnet 127.0.0.1 3306 Trying 127.0.0.1... telnet: Unable ...
0
votes
0answers
34 views

Modify rule when service crashes

I have a iptables rule in PREROUTING that redirects all incoming to a specific port, where a service consumes the data. Is there a dynamic way to determine if the service has crashed and remove the ...
1
vote
1answer
697 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 ...
0
votes
1answer
1k views

Forward to Internal IP and Port From a Single IP Address on DDWRT Router

I'm trying to follow this guide and I have a simple request that I haven't been able to solve. I'd like to only accept requests from a specific IP address to a host within my internal network at home. ...
1
vote
0answers
150 views

NAT routing command in windows

Is there any specific command in windows which do the following task: I want to modify the source IP address in the packet whose Destination IP is not in the private LAN, i.e., I have a virtual ...
1
vote
1answer
305 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 ...
0
votes
2answers
350 views

DDWRT Port Forwarding Request from Dynamic IP

I'm running a DDWRT router with a NAS behind it. The NAS runs a service called Cloud Station. I'd like to restrict access to Cloud Station to a handful of hosts (family members). Each family member ...
2
votes
1answer
4k 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 ...
0
votes
1answer
989 views

Blocking all sites/IP address but Google.se with iptables

Im trying to block all IPs but Google.se. It doesnt work (Site does not display) Here is what I wrote: #/bin/sh echo "Flushing IPTables..." sleep 1 iptables -F iptables -X iptables -t nat -F ...
2
votes
1answer
3k 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 ...
0
votes
1answer
301 views

iptables: how to allow genuine internal traffic whilst blocking spoofed/bogus packets?

So I've read that a common attack is spoofing packets from internal SRC IP addresses, such as 192.168.0.0/16. How can I defend against this with iptables, yet at the same time allow traffic from the ...
2
votes
1answer
1k 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 ...
1
vote
0answers
309 views

I need some help proof reading my IPtables rules, my rules seem to work but I cannot be sure

Like the title says, I need some help proof reading my iptable rules, my rules seem to work but I cannot be sure. My set up is as follows: ISP ---> cable modem ---> Ethernet switch ---> ...
0
votes
1answer
564 views

Manually Editing iptables

I'm using CentOS. What I'm wondering is, what happens if I manually edit /etc/sysconfig/iptables and save it? Is that the definitive source? When I type iptables -L I get something that doesn't match ...
1
vote
1answer
153 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
0answers
299 views

NAT router sends RST to a server where a NAT'ed client is connected to

As I tried to remove some Ethernet wires in my home network, I took an older notebook with Linux and tried to use it as some kind of Ethernet-2-WiFi-NAT-router (Wi-Fi card can't act as bridge, so I ...
1
vote
0answers
94 views

Lubuntu UFW does not respond

I have been using ubuntu for a long time. Nowadays, I wanted explore lubuntu. However, I cannot configure ufw. Actually I can but it does not respond. Basically, I cannot get the result of "ufw ...
1
vote
1answer
372 views

iptables, redirect from ip address to loopback

I have an Apache web server listening in 127.0.0.1:63280 eth0 has IP: 172.200.200.200.1, and try to connect from workstation IP 172.200.200.200 iptables -t nat -A PREROUTING -s 172.200.200.200.1 -p ...
0
votes
1answer
827 views

Prevent device from reaching WAN traffic (MAC address for example) - OpenWRT

I want to forbid a device on my network from accessing the internet. Computers still have to communicate with the device, and vice versa. OpenWRT version: OpenWrt Attitude Adjustment 12.09
1
vote
1answer
320 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 ...
1
vote
1answer
161 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
0answers
164 views

Change UDP port with iptables for VPN clients

What I want to do is say that for all UDP connections on interface ppp0 that have a destination port of 53, change that destination port to 1053. I am attempting to change the destination port of UDP ...
0
votes
1answer
2k views

Iptables drop forward packets to specific host

I am having trouble isolating a specific host from others on my lan. What I am trying to do is only allow communication between 192.168.0.2. and 192.168.0.8 as well as not allow any other host to ...
11
votes
2answers
10k 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 ...
0
votes
1answer
126 views

Can iptables be used to convert a single-homed host into a NAT server?

I have an Internet-enabled machine, HostA, with one NIC. I have another machine, HostB, with one NIC that is not Internet-enabled. I would like HostB to be able to share HostA's Internet-connection. ...
0
votes
1answer
259 views

How do I drop the entire INPUT chain from iptables?

On Linux, I've been building a malicious IP list. I assume the DDOS is now gone. How do I drop the entire INPUT chain from iptables, without affecting the FORWARD or OUTPUT chains?
0
votes
1answer
97 views

Linux gateway / DNAT: restrict to certain interfaces

I have various machines with a number of network interfaces: eth0: a local LAN eth1: sometimes used for the connection to the Internet gateway ppp0: Modem uplink as an alternative to eth1 tun0: ...
2
votes
1answer
236 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, ...
1
vote
1answer
1k views

Limit UDP outbound traffic to loopback (localhost) instead of eth0

Atm i'm testing it on Ubuntu Server at VMware Workstation + Windows 7 local host with bridged connection. Later this has to go to live server. I have VLC streaming video file on Ubuntu with cvlc ...
0
votes
2answers
35 views

Problems in creating rules in iptable

Hello to all :) I need a little help with creating a rules. Im starting to learn iptables and firewalls but I have some questions. I need to allow HTTP communication only from PcA to PcB./ My code is: ...
1
vote
2answers
795 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: ...
0
votes
1answer
232 views

Updating iptables via ddclient

TL;DR Is there anything I can do to change iptables from ddclient (with user ddclient)? The story behind I have a computer that uses dyndns to be addressable from outside. Whenever the provider ...
1
vote
1answer
3k 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 ...
1
vote
2answers
947 views

Iptables configuration to allow Steam Client

I recently got and setup a small linux (Debian) router box. I'm adding it to an existing network to create a small subnet with specific properties, namely internet content filtering. I'm highjacking ...
1
vote
1answer
1k views

Can't connect to SSH over VPN when using 3G only

I'm having a bit of a strange problem that I'm not sure how to debug/fix. I have a Raspberry Pi connected to a Windows VPN via either a wired interface or 3G dongle. With the wired interface I can ...
0
votes
1answer
176 views

How to drop IP packets received on the default route interface when no other than default route is found?

I am setting up a router based on a linux kernel. As expected, ipv4 packets received on the interface used by default route are sent back to the same interface in case no other route is found. Is ...
0
votes
0answers
888 views

How does iptables masquerading allow to access a different local subnet?

My Linksys router (IP 192.168.1.1 inside a /24 subnet) is connected to my ADSL modem (IP 10.0.0.138 inside a /24 subnet) to establish an internet connection via PPPoE. To be able to access the modem's ...
1
vote
3answers
788 views

linux routing outbound port 80 traffic via ssh tunnel, iptables, or a simple route

I have two hosts, A and B. Host A hosts services on port 8080 and has outbound internet firewall rules allowing port 80 and 443 access to Host C. Host B is on the same subnet as Host A. Host B is ...