iptables is the userspace command line program used to configure the Linux 2.4.x and 2.6.x IPv4 packet filtering ruleset. It is targeted towards system administrators. Please, when asking a question about iptables, add the output from the following command: iptables -L -v -n

learn more… | top users | synonyms (1)

5
votes
4answers
3k views

Openvpn, forward packets very slowly

I rebooted my server, and an odd issue just came out. I am running on ArchLinux, the clients are Ubuntu, Android and Mac. The problem is that accessing the internet via the clients is slow, about ...
2
votes
1answer
23 views

Port 8080 remains closed even when opened with iptable and nodejs is listening on it

I am trying to install a nodejs server listening to port 8080 that I opened with iptable but when I run nmap or a web tools I always get the message that the port is closed. I'm on a Ubuntu vps. ...
0
votes
0answers
14 views

How to set up Iptables SNAT with dynamically assigned public IP address

I am trying to set up a system to do NAT and other iptables-stuff (like logging, firewall, monitoring, etc.). The ISP provides a dynamic IP address and the DSL modem does NAT. I have the following ...
0
votes
3answers
57 views

Assign IPs to programs/processes

I need to assign different IP addresses to different processes (mostly PHP & Ruby programs) running on my Linux server. They will be making queries to various servers, including the situation ...
1
vote
1answer
862 views

Ubuntu iptables logs not going to any log file

I am trying to put logs in iptables but I can not find any log in any file. Although when I run dmesg command, I can see the iptables entries. But the same entry doesn't go to any log file. Here is ...
0
votes
0answers
26 views

Route traffic through private IP for only certain hosts - CentOS 6.6

I am having a weird problem which I cant figure out - so I was hoping someone here could give me a hand. First off the end goal is that a specific server in my network runs an IPSEC connection to ...
2
votes
2answers
1k views

Iptables: Forwarding packets doesn't work

I have 3 Linux Systems A, B and C. A is a TCP Client and sends a message to TCP Server on C. A can see only the external IP of B which is at wlan0 interface, 192.168.0.3 ------------------ ...
0
votes
0answers
34 views

Chinese Firewall DDoS and IPtables not working

Recently my server has been hit with DDoS's coming from the Great Chinese Firewall. As per the advice in one of the replies in mod_security block requests by http-host header, and the advice in ...
0
votes
0answers
19 views

IPTABLES and GEOIP: Show Custom Webpage to Blocked Visitors

Because of legal protection, as a first stage of launching my project I will focus on couple of countries only. The number of supported countries will grow. I know, it is possible to block or allow ...
0
votes
0answers
20 views

How to configure iptables when running Docker

I have a difficult situation here, i have setup many containers on my docker host, running different applications like mailserver, databases, redis, and certain html applications using other ...
0
votes
1answer
992 views

iptables denies internal access to port 17500

In the kernel log there are hundreds of these lines. The source is the external IP of the VPS (not localhost nor 127.0.0.1), other times an IP of the network of the VPS provider. The source port and ...
5
votes
3answers
4k views

How do you test iptables rules to prevent remote lockout and check matches?

As I'm learning about iptables I've made a couple of mistakes and locked myself out. What method(s) do you use to test rules without locking yourself out? I'm using ubuntu server 12.04 LTS All ...
1
vote
2answers
26 views

iptables performance - iprange vs subnets

I want to allow a range of ip addresses - two /24 subnets, which don't fall under /23. I have two options: Use two rules with /24 masks and -s option Use single rule with -m iprange and specify ...
0
votes
1answer
10 views

Do I need to set rules for source and destination ports for outgoing rules on iptables?

I'm using puppetlabs firewall module and I'm having troubles setting up iptables for a simple web host. I'm following this guide and want to set up additional rules. ...
0
votes
4answers
14k views

Allow traffic to/from specific IP with iptables

i want to allow all traffic to specific ip, using iptables. tryed by adding lines: /sbin/iptables -A INPUT -p tcp -s XXX.XXX.XXX.XXX -j ACCEPT /sbin/iptables -A OUTPUT -p tcp -s XXX.XXX.XXX.XXX -j ...
0
votes
0answers
19 views

How to allow applications in network namespace access to global filesystem?

I have several applications that are potentially high-risk and high-throughput (like bind, ntpd, etc.). I plan on having a "management domain" for OS tasks, updates, SNMP, automation, etc. and a ...
-1
votes
1answer
41 views

Forwarding ports and traffic to VPN tunnel

I've installed OpenVPN on my VPS. I have one question: how to forward traffic going to that VPS to go to VPN tunnel created with my local PC. I will use TCP connection. The whole traffic will be like ...
0
votes
1answer
23 views

Return OpenVPN Internet clients' traffic to non-default gateway

At home I have an OpenVPN server which is at the same time an OpenVPN client. The purpose is to share one foreign IP address between several devices. In the local network everything works fine since ...
0
votes
1answer
21 views

Allowing all ports from an IP

I have successfully entered the following command to iptables sudo iptables -I INPUT -p tcp --dport 5000:5020 -j ACCEPT -m comment --comment "Allow Ports 5000s" However, AFAIK this allows access to ...
49
votes
5answers
6k views

I accidentaly forbid SSH connection to a remote server… What's next?

Let's say it again, we all make mistakes, and I have just made one. A brief history: I was doing some stuff on a VPS (Debian) I'm renting, when I noticed some strange behaviour. Using the netstat ...
1
vote
0answers
22 views

iptables foward to multiple interfaces with NAT

I want to use iptables for provide NAT translation and forward the packets out a different interface. The network set-up is as follows: Alias: eth0:220 with IP address 10.1.1.220 / 255.255.252.0 ...
1
vote
0answers
35 views

Effect of firewall on virtual machine [on hold]

We have a ubuntu-12.04 host machine that has another ubuntu-12.04 guest machine running in it. The network interface between the two is bridged. I would like to put the host machine behind a firewall, ...
-5
votes
3answers
54 views

How I can Block all China to entry to my server [on hold]

How I can Block China to entry to my server ? All China country ? By ipset and iptables I want by this to avoid DDOS attacks OS: CentOS 6.6 Thanks.
0
votes
1answer
20 views

Iptables - How can i limit the access of a service on a server with two ips?

On my personal server ( Centos 6.6 ), i acquired a secondary ip in order to keep all backend access splitted from the frontend applications. But i'm not sure how can i specify wich port can be ...
0
votes
0answers
16 views

KVM port-forwarding from ppp0 to VM's bridged NIC not working, but to VM's NAT NIC works?

I've spent a lot of time on this freaky problem, I've created a simple host and VM configuration to try isolate the problem. Terminology in this question Host: The bare metal server VM: The KVM ...
0
votes
1answer
12 views

accessing same domain name through a different port

I have a production website, and a development website. The must be accessed through the domain name, www.mysite.com. I would like to be able to access the dev site through a praticular port, say ...
2
votes
0answers
27 views

Iptables content blocking firewall

I have setup a firewall with iptables to ratelimit connections based on content. The following is an example of one of my rules that stops wordpress bruteforce attacks. `iptables -A INPUT -p tcp -m ...
1
vote
2answers
33 views

iptables rules for StrongVPN-like VPN endpoint

Goal: To replicate the functionality I have with StrongVPN on my own Debian VPS. With StrongVPN, seemingly, all ports on the public IP provided are forwarded to the client, meaning, e.g, ssh :22 from ...
0
votes
2answers
1k views

IPTables port forward Remote mysql to localhost

i have a MySQL server1.1.1.1 and I need port 3306 in 1.1.1.1:3306 port forward to my secondary server 2.2.2.2:3306 I don't have access to MySQL server. i have tried iptables -t nat -A PREROUTING -p ...
0
votes
2answers
37 views

iptables block client ip internet access and keep LAN access

With the increase of appliances having network access and the potential for hacking, I want to block specific ip address from accessing the internet, but allow LAN access. For instance, I use a ...
1
vote
1answer
30 views

IPTables - Simple Routing of all traffic

Ubuntu 14.04.2 VM, with IP of 1.2.3.4 and 1.2.3.5. I'm trying to route all traffic for 1.2.3.5 to another address of 1.2.3.189 (which is on another server, and can be reached by any machine on the ...
1
vote
1answer
68 views

Linux - show dropped packets form firewall

I am trying to set up a sip trunk and so far everything has gone well. The only issue I face is that the call does is not received when the iptables service is running. By stopping the service ...
-2
votes
0answers
18 views

how do I get plesk running correctly on Ubuntu? [closed]

I have installed Plesk 12 with the autoinstaller from http://autoinstall.plesk.com/one-click-installer. The installation succeeded with "Congratulations! All stages of the installation/upgrade ...
-2
votes
0answers
10 views

Dual wan ubuntu router [closed]

I would like to configure a ubuntu server with two ISP and one lan with two network; say 192.168.1.1 and 192.168.2.1. 192.168.1.1 n/w should route through ISP one and 192.168.2.1 n/w should route ...
1
vote
1answer
36 views

systemctl throwing errors on start/enable after package instal [duplicate]

In the effort to lock down a new Centos box I am building I am installing iptables. I would like to be able to put this in a script so I can do this to other boxes but I am getting some odd errors ...
0
votes
0answers
11 views

Centos internet sharing with dual WAN and subnet routing

Situation is like this: eth0 has internet access with VPN for 2 subnets 192.168.2.x nad 192.168.30.x eth1 has internet access eth2 is the one to be the connection to allow internet connection ...
3
votes
3answers
157 views

Iptables rules with ! character

I have entered iptables rules to log a specific connection on our server, but it doesn't seem to be working as I want it to. Here are the rules: 1 LOG tcp -- !10.51.0.0/16 ...
0
votes
1answer
1k views

iptables forwarding through virtual interfaces

I'm trying to configure my computer as a gateway between two networks, but I cannot make it working for some reasons Here is a representation of the network: 192.168.1.101 192.168.1.102 ...
3
votes
1answer
24 views

Is the use of the RELATED state in iptables used properly?

I have been seeing many people using the ESTABLISHED and RELATED flags together to ACCEPT traffic through once a connection was previously accepted (see Allowing Established Sessions). Say I setup my ...
0
votes
1answer
2k views

SSH Socks Proxy wiith iptables REDIRECT

I have googled and haven`t found the answer on my question. Help me please. There are two servers: serverA with public IP 12.0.0.10 and an private IP 10.0.0.5 serverB with public IP 20.0.0.11 I ...
-2
votes
0answers
23 views

Fedora 21 Port Forwarding with firewalld (firewall-cmd); how does it REALLY work? Or, does it? [migrated]

Fedora's ability to forward ports using the apparently "native" networking software, firewalld, appears to continue to be broken beyond credulity. Please note that it hasn't really worked since at ...
-1
votes
1answer
35 views

what is wrong with this rsyslog configuration?

I am trying to get rsyslog to log to the following custom log file /var/log/iptables.conf instead of syslog. Iptables has got logging enabled, here is an example log line outputted from iptables ...
-2
votes
0answers
20 views

Postfix to Use Ipv6 on Rotation Basis [closed]

I want to setup my vps to use ipv6 on rotation basis and make ipv4 as incoming for postfix. i have 16-ipv6 address and 1-ipv4 address Need help in configuring the same in my vps. It has centos 64 bit ...
19
votes
3answers
32k views

How to reload default Mac OSX routing table without rebooting

Greetings, I'm using vpnc for a VPN client. I'm also doing some tricky things with route to make sure I can still access my local network, etc. etc. (the particulars here are not very important). ...
46
votes
11answers
205k views

How to start/stop iptables on Ubuntu?

How can I start/stop the iptables service on Ubuntu? I have tried service iptables stop but it is giving "unrecognized service". Why is it doing so? Is there any other method?
0
votes
0answers
13 views

Syslogd acctack

My hosting company told me, my VPS server (CentOS release 6.6) have abnormal activities issue (hacking other server) and blocked my outgoing traffic, they just give me limit info: The hacking ...
0
votes
1answer
2k views

strongswan VPN on OpenWrt

Hi I'm running Barrier Breaker version of OpenWRT and I have setup a VPN according to: http://wiki.openwrt.org/inbox/strongswan.howto I can connect to the VPN with my iPhone or Mac (to 10.10.1.0/24 ...
2
votes
0answers
52 views

How do iptables work with NFQ in terms of traffic shaping in snort?

I'm trying to understand how iptables and NFQ work together with snort. The reason that I ask this is because from what I understand snort can be set to IPS via NFQ but if you have iptables there ...
1
vote
1answer
25 views

How do I get firewalld to restrict access to all except specified IP addresses?

I would appreciate some assistance with configuring firewalld please. Here's a bit of background. All I want to do is prevent all access- except whitelisted IP addresses to a web application running ...
-1
votes
0answers
15 views

How to force users binding to specific IP, using IPtables?

I want to give some web users the possibility to have a dedicated IP, both for receiving and for sending. So it means a web script for WEB user XX, received by Apache on IP x.x.x.x, when opening ...