Questions tagged [iptables]

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

Filter by
Sorted by
Tagged with
1 vote
3 answers
2k views

Forward all traffic when connected to a hub

I have a Ubuntu with two NICs. eth0 is connected to a hub and eth1 is connected to Internet. eth1 is used to do a point to point VPN using openVPN. So I have a tun0 interface. the VPN tunnel endpoints ...
Cyrill Gremaud's user avatar
1 vote
2 answers
67 views

Route traffic in a public network

I have 3 stand alone CentOS servers on same hosting provider. The hosting company can't offer me a firewall for this devices, only iptables. So I want to buy another server and make this server a ...
antiks's user avatar
  • 223
6 votes
2 answers
3k views

Should i use Firewalld or Iptables for Fail2ban in Centos 7?

I'm setting up Fail2ban to protect ssh, and I use firewalld, I saw a lot of people recommending to use anaction = iptables-multiport and other solutions using iptables instead of firewalld claiming ...
Samuel E.'s user avatar
  • 177
6 votes
1 answer
1k views

iptables/nat/prerouting ignores UDP packets?

The same effect on many servers with various kernel versions. There are multiple Iptables DNAT rules: iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 12345 -j DNAT --to-destination 10.20.30....
user2743554's user avatar
6 votes
3 answers
7k views

How to use iptables or tc to limit packets per client.

I have some problem network clients which send data too fast. I want to slow them down, using iptables, or possibly tc. I've seen iptables solutions like: sudo iptables -A INPUT -m state --state ...
fadedbee's user avatar
  • 2,088
-1 votes
1 answer
80 views

Make Apache work on a custom port using iptables only

My Apache/2.2.14 (Ubuntu) is running on port 80. I'm trying to make it listen on port 999 as well, but without making any changes to the apache config, only using iptables. I've added this to the ...
steve0's user avatar
  • 1
0 votes
1 answer
111 views

DNS requests from a local server to another local server

I have two servers running in one network. External IP of main server: 1.2.3.4 (domain.com) External IP of secondary server: should not be available directly from outside Main server (dns, mx, www)...
Didzis's user avatar
  • 121
0 votes
2 answers
436 views

How safe is IPtables whitelisting?

I am deploying some VPS and of course, security is a big concern. I read that IPtables whitelisting is the best way to safeguard your machine. So I set up the follwing : echo "Flushing rules" ...
Aaron Ullal's user avatar
0 votes
1 answer
1k views

source nat for return traffic (Hair pinning )

Is there any way to source nat traffic received ? iptables -t nat -A POSTROUTING -o eth18 --src 123.123.123.123/32 --jump SNAT --to-source 66.66.66.66 Return traffic still uses 123.123.123.123 as ...
Dense.mode's user avatar
0 votes
2 answers
475 views

port forwarding by iptables failed

I hope to forward from 192.168.1.230:9090 to 192.168.1.231:8080. I execute the following command: iptables -t nat -A PREROUTING -d 192.168.1.230 -p tcp --dport 9090 -j DNAT --to 192.168.1.231:8080 ...
hbprotoss's user avatar
  • 113
0 votes
3 answers
2k views

iptables rules for port 53 not taking effect

My ubuntu 14.04 LTS server is receiving lots of incoming traffic on port 53 from different ip addresses. I am not hosting any DNS service. So I decided to block port 53: iptables -A INPUT -p tcp --...
DarkLeafyGreen's user avatar
1 vote
1 answer
42 views

:: gem list -remote :: iptables configuration

Once I locked down my VPS server with iptables meaning I only have a few selected ports opened for input access, my Gem command stopped working and I'm not sure what I'm doing wrong. This is a two ...
KitakamiKyle's user avatar
6 votes
2 answers
17k views

IPTables: How to log and set a specific log file

Is it possible log all dropped connections by IPTables and set a iptables.log file for logging in /var/log/?
user avatar
0 votes
3 answers
2k views

IPTables: apt-get and wget not working

When resetting IPTables, the apt-get and wget command functions correctly and also downloads what I want. But once I activate this firewall, it isn't functional. Pings still work. I want to allow all ...
user avatar
-1 votes
1 answer
358 views

Unable to connect to a port from a remote machine in Centos?

I am not able to connect to 9423 port of a machine from another machine though the local telnet localhost 9423 works. Here is my netstat -putna. Is there anything suspicious? 10000 works just fine ...
Nishant's user avatar
  • 265
2 votes
0 answers
1k views

iptables configuations for stunnel+squid

I'm building a highly anonymous proxy server with squid and stunnel, and I'm facing a configurations problem on iptables. The server should act like this: browser <-> client stunnel <=> ...
Hartman's user avatar
  • 141
0 votes
0 answers
119 views

Http request blocked on port 80 [duplicate]

I currently have Centos 7 installed on EC2 with the following: Apache Php Mysql Iptables Firewalld Apache running Redirecting to /bin/systemctl status httpd.service ● httpd.service - The Apache ...
Sino's user avatar
  • 101
0 votes
1 answer
52 views

Port forwarding work on virtual machines but not on host

I use this iptables config It simply redirect to port 21 the connection of 2121(used to run ftp as user instead of root) *nat :PREROUTING ACCEPT [200:39210] :INPUT ACCEPT [6:360] :...
elbarna's user avatar
  • 328
0 votes
1 answer
67 views

can access virtualhost locally on the same server but cannot access on remote machine

A pretty wired problem occured when configure a virtualhost at port 81. When I use command curl 123.123.123.123:81 or curl localhost:81 in the same server, it got response. While when I access it ...
franky's user avatar
  • 3
1 vote
2 answers
414 views

IPTABLES: Route outgoing http requests to eth1

I am trying to route all outgoing HTTP requests LEAVING my server to go through a proxy (tinyproxy) on another server. I want the transmission to the proxy to use our LAN which is on eth1. No matter ...
Jafo's user avatar
  • 121
0 votes
2 answers
53 views

Ubuntu server - packets from different networks not coming through (flushed iptables)

I have set up a brand new Ubuntu server, and I'm encountering a very strange network related issue - the processes running on the server cannot 'see' packets originating from external networks, but ...
kralewitz's user avatar
-1 votes
1 answer
4k views

port 80 is open by iptables but Connection timed out

I have nginx on my server, I run the script below to add rules to iptables: #!/bin/bash ip=/sbin/iptables services='22 25 53 80 443 5432 8000 8080' $ip -F; $ip -t nat -F; echo -e "Opening port 22 ...
Mairon's user avatar
  • 159
0 votes
1 answer
8k views

Telnet: Unable to connect to remote host

Related Threads: SMTP server works, but telnet to port 25 does not Can't connect to SMTP server The problem I have a server running Debian 3.2.65-1 and i am having some problems to connect other ...
Rufein's user avatar
  • 103
0 votes
1 answer
1k views

Add latency and random packet drops excluding SSH packets

I want to add some random delay/drop to all packets excluding SSH packets. I can do that to all packets this way: tc qdisc change dev $NIC root netem delay 100ms 10ms 25% tc qdisc change dev $NIC ...
ehsun7b's user avatar
  • 131
-1 votes
1 answer
480 views

OpenVPN cannot route traffic

Scenario OpenVPN server running on Gentoo eno1: (server public ip) has static ip... NO dhcp eno2: vlan (down for now) tun0: openvpn tunnel interface server.conf local <external ip> port ...
man's user avatar
  • 101
3 votes
9 answers
15k views

IP forwarding on Linux - anything important to make sure to do or know?

In moving a website with a dedicated IP from one server to another, to minimize downtime due to DNS propagation delays, there's the approach of using IP forwarding so that all traffic to the original ...
sa289's user avatar
  • 1,338
0 votes
0 answers
102 views

NFS on Ubuntu Server 14 LTS with iptables

I have a virtual server with Ubuntu Server 14 LTS. The provider has offered me NFS storage which I wanted to mount on the virtual server: mount -t nfs 192.0.2.4:/space /mnt/nfs However, I cannot ...
andreas's user avatar
  • 231
0 votes
1 answer
2k views

why fail2ban does not ban? (ubuntu, ssh)

I installed a fresh Ubuntu machine. Then I changed the ssh port which is no more 22 but 22111: Then I have installed fail2ban: apt-get install fail2ban -y cp /etc/fail2ban/jail.conf /etc/fail2ban/...
David's user avatar
  • 3
2 votes
1 answer
247 views

Basic forwarding on Ubuntu not working

I have the following setup, minimized to explain the problem: _________ |Desktop | --------...
Sunny's user avatar
  • 381
1 vote
1 answer
419 views

CentOS server blocking own outgoing traffic

I've got a server (CentOS 6.7) running, which causes me some headaches. A few months ago, the website running on the server was unavailable. After some digging, it appeared that Iptables was blocking ...
Keugels's user avatar
  • 121
0 votes
3 answers
1k views

IPTables forward to dynamic IP

I have a server running on e.g. servera.example.com and one on serverb.example.com. I want to redirect all port 80 traffic to servera.example.com to serverb.example.com, and leave all other ports as-...
DaPorkchop_'s user avatar
0 votes
1 answer
636 views

Pass ethernet interface to iptables rule in ansible playbook

I'm writing a pretty simple ansible playbook for setting up our iptables firewall in centos. Here is the playbook I wrote: --- - hosts: test remote_user: deploy sudo: True tasks: - name: Get ...
nulltek's user avatar
  • 1,281
0 votes
2 answers
854 views

Packets in bridge get up to the user space without being redirected there

I set up a bridge interface (br0) on PC-A (Linux Ubunutu 14.04) In addition I created an application with a TCP Listener on port 80 in the user-space on PC-A As what I understood from the ...
Niv Penso's user avatar
0 votes
2 answers
4k views

Iptables forwarding with single interface

Is it possible to use Iptables to forward all traffic going to certain network to given ip address? I have Ubuntu server to act as router in network 192.168.1.0/24. Its IP is 192.168.1.254. (This "...
Madoc Comadrin's user avatar
2 votes
1 answer
18k views

IPTables Multiple source or Destination IP ranges?

first time post to ServerFault so I'll try and get it right :) I have multiple environments (e.g. prod, dev, test, etc) and I'm trying to write the IPTables file for my RHEL 6.6 servers which allows ...
Tyderian's user avatar
1 vote
1 answer
989 views

Iptables DNAT single port

I'm trying to redirect a single port to a local server via IPtables. Currently I have the following rules: iptables -t nat -A PREROUTING -p tcp -m tcp --dport 55555 -j DNAT --to-destination 10.188....
Aaron A's user avatar
  • 249
2 votes
2 answers
10k views

block DNS Amplification Attack by iptables

Last time I've got warings about DNS Amplification Attack from NFOservers.com DDoS notifier 2015-12-30 23:28:52.609178 IP (tos 0x0, ttl 54, id 42635, offset 0, flags [+], proto UDP (17), length 1500)...
Curl User's user avatar
1 vote
0 answers
259 views

CentOS + IPTables

I am trying to setup a CentOS 7 server with Squid as a proxy server. The proxy server is strictly private and doesn't need to be available to anyone other than myself and other 2 servers, therefore I ...
user avatar
2 votes
1 answer
653 views

Iptables are blocking WildFly10 on CentOS 7

I've CentOS 7 server without firewalld but with iptables installed. There's WildFly 10 is running with changed socket binding http port 8080 to 80 in standalone.xml. I'd open 80 port in iptables ...
WildDev's user avatar
  • 167
2 votes
1 answer
684 views

Channel all the traffic on an IP to a VM

Situation: I have a dedicated Server (CentOS 6) with couple of VMs(Cent OS 7 and Windows Server 2012 R2) in Virtual Box. Few applications are running in windows and reachable from the Main IP(X.X.105....
Anup Sharma's user avatar
12 votes
1 answer
6k views

Iptables with -m and -p parameter

I have this rule in my iptables: iptables -A INPUT -p tcp -m tcp --dport 9191 -j DROP Do I really need "-m tcp"? I already am using "-p tcp", so should I use "-m tcp" to be more secure?
Samul's user avatar
  • 316
0 votes
2 answers
2k views

block ip with iptables ubuntu server

I am trying to block one IP with iptables in my Ubuntu server 12.04. The foreign IP is 117.16.18.95.dyna. You can take a look at the next image: I have added this ip to iptables with the next ...
hyperrjas's user avatar
  • 125
4 votes
1 answer
7k views

How to forward traffic from tunnel interface to eth0

Network topology: Internet | | (eth0) IP: 202.xxx.xxx.xxx/255.255.255.0 A: Remote_Server(Debian) (tun0) IP: 10.10.1.1/255.255.255.0 | | (utun0) IP: 10.10.1.2/255.255.255....
David W.'s user avatar
-2 votes
3 answers
8k views

error iptables-restore: unable to initialize table filter

i have Debian 6.0.5 x86_64 on VPS and create file named 'iptables.rules' with following command: *filter -A INPUT -i lo -j ACCEPT -A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-...
AminM's user avatar
  • 185
1 vote
3 answers
2k views

Bots hitting xmlrpc.php and causing high load on the server

Recently we are having a lot of hits to wordpress xmlrpc.php which in end causes high load on the servers. We tried rewriting all xmlrpc.php to 127.0.0.1 but didn't help much. Since apache was ...
DasGjinovskaLignja's user avatar
9 votes
3 answers
8k views

Command-line utility to test fwmark in ip rule / ip route?

I am trying to find a tool that will allow me to find the route a packet will take that comes in on a device, and has a particular destination address. ip route get will do most of what I am looking ...
msumme's user avatar
  • 93
1 vote
1 answer
2k views

How to prevent linux from dropping incoming packets that have a wrong mac address (promiscuous doesn't work)

I configured three machines in a static proxy_arp like manner: ----------------------+ +-----------------------------------------------+ +---------------------- Machine A | | ...
Nicolas G's user avatar
3 votes
2 answers
1k views

IP Tables, is it possible to limit requests per minute and timeout IP?

I am trying to setup a firewall that limits to 3 connections per IP and also ban the IP for an hour if > 30 connection attempts in one minute. This is for port 80 only. Is this all possible with ...
ServerSideSkittles's user avatar
1 vote
2 answers
195 views

Is it possible to use iptables on Ubuntu to limit brute force attacks?

Is it possible to use iptables on Ubuntu to limit brute force attacks for certain URLs? Basically I want to detect where user calls same url over and over again and drop his connection or somehow slow ...
spirytus's user avatar
  • 197
1 vote
1 answer
4k views

Opensuse port forwarding 80 to 8080 not working

I've a glassfish server that use the port 8080. I need forward from port 80 to 8080 so I can access the content without put the :8080 port in the url. I've tried to put a masquerade rule, add ...
Andrea Catania's user avatar

1
57 58
59
60 61
134