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)

1
vote
0answers
30 views

Ban IP doesn't work with forwarding

I use à VPS like a bridge for an other server. I use apf-firewall and this file /etc/apf-firewall/preroute.rules for forward somme port one the other server. This is the end of the file: iptables ...
0
votes
0answers
11 views

Filter Traffic Between Virtual Machines

I have a machine with Fedora 21 which acts as a host system for two virtual machines. The VMs are made up using QEMU/KVM/libvirt/virt-manager. One VM is running a webserver, the other VM acts as a ...
1
vote
1answer
29 views

iptables block net range

I'm trying to REJECT network via iptables(8) and for whatever reason it is not doing so: # cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.6 (Santiago) # uname -a Linux X ...
2
votes
0answers
25 views

Whitelisted MAC address not getting access to NAT'd network

I'm in the process of setting up a whitelist-based router and am encountering issues when trying to grant access to clients. Follows is my current iptables configuration # Generated by iptables-save ...
1
vote
1answer
21 views

iptables 'rewrite' requests on a certain port?

Alright, my situation is basically this... I have a box that's acting as a router, with 2 interfaces, eth0 and eth1. eth1 is my uplink, that is it is the interface through which the box is obtaining ...
2
votes
2answers
49 views

Exposing private network ip

I have the following setup: Box A eth0 - 192.168.1.101 eth1 - 10.10.2.1 Box B eth0 - 10.10.2.2 Box A has internet access through eth0. I want Box B to be visible on the 192.168.1.0/24 network, so ...
0
votes
2answers
33 views

Iptables rule to match on mac address fails

Why is the following simple IPtable rule not working? iptables -A INPUT -s 192.168.1.88 -m mac --mac-source 00-27-0E-33-4B-B2 -j DROP Actually I want to inverse the match. Something like this: ...
0
votes
1answer
18 views

IPTables not working as expected for ssh control

I have the following rules, which for testing is all that I have: iptables -F iptables -A INPUT -p tcp --dport 22 -j DROP iptables -A OUTPUT -p tcp --sport 22 -j DROP iptables -A INPUT -i em1 ...
3
votes
1answer
12 views

Routing SMTP Connections to Different IP Sets with IPTables

I'm trying to set up two different IPs for SMTP that each get routed to two different sets of IPs, with no IPs shared between the two sets. I'm trying this, but it mixes the two sets of IPs so that ...
-3
votes
1answer
35 views

How to set up port forwarding from Windows host to Vagrant Linux VM to Docker containers?

I'm using a Windows host, running CoreOS in Vagrant with VirtualBox provider, and in that CoreOS, I have Kubernetes 0.14.2 single-node cluster running (I couldn't get latest version, 0.15, to work ...
1
vote
1answer
24 views

IPTABLES -L OPTION NOT SHOWING SNAT RULE

I am able to get NAT to work using the following snat rule: iptables -t nat -A POSTROUTING -o em2 -j SNAT --to 192.168.2.2 My question is: Why is this rule not displayed when I issue the ...
1
vote
3answers
266 views

What is the best way to get PRECISE domain name from ip address logged in iptables log

In iptables I am logging certain public IP addresses... say of websites visited from different workstations, depending on destination port number... All this is not really relevant to the question but ...
3
votes
1answer
42 views

How to test iptables settings by port scanning?

I want to test my iptables and prove that it only allows traffic for given Protocol / Port - combinations. How I can use as a target for a port scan?
0
votes
0answers
23 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 ...
2
votes
1answer
42 views

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

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
1answer
36 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 ...
1
vote
1answer
75 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
35 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
29 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 ...
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
15 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
1answer
24 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 ...
0
votes
0answers
24 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
vote
0answers
23 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 ...
-5
votes
3answers
55 views

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

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
21 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
1answer
18 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 ...
1
vote
0answers
37 views

Effect of firewall on virtual machine [closed]

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, ...
2
votes
0answers
34 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 ...
0
votes
0answers
26 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 ...
52
votes
5answers
7k 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
1answer
31 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 ...
0
votes
2answers
61 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
57 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
16 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 ...
0
votes
1answer
28 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 ...
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 ...
-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
40 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 ...
3
votes
3answers
158 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
0answers
14 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 ...
1
vote
1answer
28 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 ...
2
votes
0answers
58 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 ...
0
votes
1answer
69 views

ipTables IP Range will not be blocked

I have setup fail2ban with this Tutorial http://wireflare.com/permanently-ban-repeat-offenders-with-fail2ban/ and it seems working. But the attackers are changing their IPs and thats why I decided to ...
0
votes
1answer
12 views

Secure elasticsearch but allow remote CRUD

I'm going to run a bit of software on server A to add and remove entries from elasticsearch on server B. How can I allow these remote create and delete operations, but still keep ES secure? Is ...
0
votes
1answer
48 views

Cannot acces Port 8443 of my Ubuntu server [closed]

I try to connect to my Ubuntu server over port 8443 using nmap. PORT STATE SERVICE VERSION 8443/tcp closed https-alt As you can see to the outer world the port 8443 appears to be closed. ...
0
votes
0answers
17 views

iptables, after specifying an interface to drop traffic it drops all traffic of all interfaces

We have currently the situation that one interface (eth0) is linked to the internet. and we 2 other devices (eth1/eth2) for management purposes. Now the idea is to block off eth0 completely from the ...
0
votes
1answer
49 views

Setting up iptables filter to allow Git

Sorry I am new at this server stuff, so bare with me and if I'm missing any info let me know! I'm trying to setup my Ubuntu 14.04.2 LTS server to have a solid iptables firewall. Right now I think it ...
-1
votes
2answers
83 views

iptables rule to send email

I have to send emails (and only send, not receive) from a linux server (SUSE Linux Enterprise Server 11) and I think I should add kind of the following rule to the iptables: iptables -A OUTPUT -p ...