Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [iptables]

iptables allow creation of rules to define packet filtering behavior.

-1
votes
0answers
12 views

How to block all outgoing connection, execpt of established one?

I want to enable incoming HTTP connection to a server and the consequent established connection, but to block all other outgoing connections from the server. Any ideas how to do that?
0
votes
0answers
6 views

firejail net filter LAN connections only

My goal is to have two computers download something over bittorent, but only one will use internet connection. The second one will be only use local peer discovery and local connections only. Is it ...
0
votes
1answer
11 views

Trying to setup port redirection through 2nd gateway

I am trying to setup configuration where all connections to port 161 will go through another gateway (through openvpn) while others are going directly [localhost] -> [gateway] -> [remote] - OK [...
2
votes
2answers
1k views

Impossible to browse web after configuring iptables

I'm trying to configure iptables on my ubuntu computer. These are my rules: Chain INPUT (policy DROP) target prot opt source destination ACCEPT tcp -- anywhere ...
1
vote
1answer
17 views

Block MAC for a port iptables

I'm trying to block a MAC address for a specific port. iptables -I FORWARD -p tcp -m mac --mac-source 40:00:00:74:0A:00 --destination-port 80,443 -j DROP
4
votes
2answers
1k views

Meaning of log entries from an iptables configuration

My router has Linux as its OS. The system log has a lot of rows about iptable and klogd that I don't understand, could someone explain them to me? The iptables setup: iptables -t nat -A PREROUTING -...
1
vote
1answer
8k views

ufw: how to forward single port to another port on different interface

I have two interfaces eth0 (192.168.1.2) and eth1 (192.168.3.2). I receive data from 8080 at eth0. I want to forward it to eth1 port 80. I'm using UFW, because i don't understand iptables and how to ...
1
vote
0answers
127 views

SFTP Download throttled to 10Mbyte/s on Linux Mint (18.2)

I wanted to Download a large (1GB) File from our Server via SFTP. I have a 400Mbit Cable Connection which under Windows gives me ~32Mbyte/s download Speed with WinSCP from my Windows Machine. If it ...
5
votes
4answers
4k views

How to share the internet connection?

An ordinally network topology in picture: In words: - "server" (e.g.: an Ubuntu 10.04 LTS) is connected to the "internet" through pppoe connection - "server" is using it's wireless card in AP mode,...
1
vote
1answer
527 views

How to add multiple user.rules in ufw?

I know you can add rules one by one. But is there a way to add rules in one go - For instance, this is how you add rules in ufw in Debian - $ sudo ufw allow 80/tcp $ sudo ufw allow 443/tcp $ sudo ...
1
vote
1answer
936 views

Iptables policy to accept incoming SSH and ICMP only

I ran the following iptables commands to allow incoming SSH and ICMP connections and block all others. sudo iptables -F INPUT sudo iptables --policy INPUT ACCEPT && sudo iptables --policy ...
0
votes
0answers
12 views

How can the IP masquerading forwarding through a VPN gateway be configured to access the WAN router the gateway is attached to?

I have a gateway machine on my network running a VPN which routes outgoing traffic through a router, but the masquerading rules prevent the machines on the network from connecting directly to the ...
0
votes
1answer
18 views

How to open a port to specific IPs in iptables while using docker?

I have a postgreSQL database inside of Docker that I don't want to expose it to the host network as it causes all users to see the exposed database port. (For now I don't have a pfsense or anything ...
0
votes
1answer
24 views

Multiplex multiple services on same port discriminating by source port

imagine that on the same host I have 2 services: an ssh daemon listening on port 22 a socks5 proxy listening on port 1080 I want to multiplex both services using only port 22 but depending on the ...
2
votes
1answer
3k views

Firewalld: How to whitelist just two IP-addresses, not on the same subnet

I'm running firwalld on a VPS / webserver. The public zone is active and default (and I do not want the change that). How do I allow only these two external IP-addresses to access the VPS (i.e. all ...
0
votes
1answer
19 views

whitelist IP Addresses centos 6.10

How to allow specific IP Addresses to a dport in iptables ? for example : i have 2 clients, first client's IP Address is 182.3.3.1 and the second ones is 202.4.5.6, and i have a port let's say 2222. ...
0
votes
0answers
20 views

Best way to filter/limit ARP packets on embedded Linux

I have an embedded Linux on some network device. Because this device is pretty important I have to make many network tests (I have a separate device for that). These tests include flooding my device ...
0
votes
0answers
37 views

Isolating bridge interfaces from interfaces not connected to them

I am trying to build an emulation platform for emulating an LTE connection using ns-3 and tap interfaces inside a single real host. I have found this very complicated. I want to be able to create a ...
2
votes
1answer
901 views

iptables Port Forwarding — no service with the port

I have setup a network as in the image below: Firewall (FW) running CentOS 6 has two physical interfaces with subinterfaces: eth0:2 — 10.100.1.78/25 eth0:3 — 10.100.1.79/25 eth3 — 192.168.0.21/24 ...
0
votes
1answer
225 views

Debian 8.0 minimal IPtables Persistent not loading on boot

For my company we are working on a phone system that is running on a Debian 8.0 minimal VPS hosted at Wable.com. Everything was working great until some of us had some home network changes and the ...
-1
votes
1answer
31 views

How to route between two bridge interfaces?

So I have a total of two bridges. One has the 10.0.0.1/24 subnet (br0), and the other has the 10.1.0.1/8 subnet (br1). I want to setup an NGINX reverse proxy that would run on a container connected ...
0
votes
0answers
44 views

Docker container has no route to host

If I stop the iptables service, things will work. I need to know how to change the iptables configuration to allow container access to host ports. I have an nginx container on this RHEL 7 server ...
-1
votes
0answers
26 views

Customized captive portal with external DHCP server [closed]

Usecase: Whenever any wireless device will get connect to access point, it will send DHCP request. Access Point will forward DHCP request to Fortinet DHCP server and block all other request for that ...
-1
votes
1answer
35 views

linux network traffic accounting

I have a network with several Hosts N1, N2, N3, ... and they all communicate with each other. I'm in the N2 host CLI with linux. Can you know how much traffic was in bytes between a N2 Host and N3 in ...
1
vote
1answer
24 views

How to prevent iptables and nftables rules from running simultaneously?

I'm trying to set up a firewall on my own desktop (currently I'm tinkering with a Fedora 29 virtual machine). I would like to have it on the "deny-everything-by-default" basis. Almost immediately I ...
-1
votes
1answer
25 views

How to check multiple list from IPSet in IPTables with a single rule?

How can I check multiple list of IPs from IPSet in IPTables with a single rule? I need to add check two list of IPs because it is too big. I know it is not healthy, but I need to do it that way. ...
0
votes
2answers
36 views

Block IP range using iptables [duplicate]

I am trying to use in DD-WRT iptables to block an ip range Ex: I want to block iptables -I FORWARD -s 192.168.2.105-192.168.2.110 -j DROP but it does not work.
0
votes
1answer
29 views

Save iptables DD-WRT command

I am trying to save an ip-blocking rule in DD-WRT but without success, every time I reboot the router the rule disappears. I wanted to save the rule permanently. I entering the GUI going under ...
21
votes
5answers
52k views

Iptables to redirect DNS lookup IP and Port

I have discovered that my ISP (verizon) is intercepting all DNS traffic on port 53. Using iptables, I want to redirect all DNS lookup traffic to a specific IP and Port (5353). Any attempt for my ...
2
votes
1answer
167 views

Restrict local port access to a specific user

I'm trying to restrict access to a particular port for a particular user on my Debian. Let's say user's id is 1000 and port I would like to block is 5000. I tried using iptables with the following ...
3
votes
3answers
3k views

How can I block all ports except some?

I am trying to use iptables but I am clueless in understanding the documentation even so that I've locked myself out of my server twice already whilst trying to implement it. These are the simple ...
2
votes
1answer
2k views

Is iptables string matching still supported?

I was reading the book Linux Firewalls - Attack Detection and Response (by M. Rash, No Starch Press, 1 Ed., Oct. 2007). In one of its chapter it discusses string matching using iptables. I was ...
2
votes
3answers
362 views

removed lib modules folder after every reboot

uname -r: 4.13.0-16-generic (ubuntu 17.10 server) I have a problem that iptables doesn't work after a reboot: iptables-apply /etc/network/iptables [ ok ] Stopping fail2ban (via systemctl): fail2ban....
1
vote
2answers
418 views

Iptables masquerade breaks dns lookups

I'm testing something with IP masquerade on locally generated traffic but it seems to be breaking DNS lookups. Everything else works fine--all IP traffic without DNS queries work. $ iptables -t ...
4
votes
1answer
888 views

Route VPN traffic through different proxies

I want to setup VPN server and route (based on my routing algorithm) all traffic through different proxy servers. Let's say I have one host, with many users, connected to my VPN. I want to route all ...
-2
votes
0answers
18 views

FTP is not working. Error message: unrecoverable backend error: (1251)

I rent the VPS for studying and it has installed the zpanel sentora. And now I can access the admin panel page, just using ssh to control it. There are an account name tuananh and FTP account name ...
1
vote
1answer
870 views

Bandwidth throttling per user group

I am wondering if it is possible to create a bandwidth shaping/throttling script that shapes traffic based on user group. That is, if user1, user2, are in user group group1, they will have 1mb/s ...
1
vote
2answers
72 views

How to convert `iptables -S` output to a breadth-first listing

I'm looking for a program that takes the output of iptables -S and converts it to a breadth-first listing. Why? I'm doing some work on a router using VyOS where several layers of tables are pre-...
0
votes
0answers
25 views

IPTables and Port Forwarding on an OpenVPNAS Server

I have a new OpenVPNas server running on CentOS 7 (Not married to CentOS 7). That I working on replacing an expensive Commercial VPN that has a Public Static IP. Being that the OpenVPNas server is ...
1
vote
1answer
460 views

iptables port forwarding and forcing interface on port

DDWRT is running a VPN client daemon (interface tun1) and all traffic, with a couple of exceptions gets routed through that interface. The first exception is traffic on port 12600 should be routed ...
3
votes
2answers
1k views

How to do routing

I have set up a Ubuntu server, that I want to use as a router for my local office. The problem is, that I want to make 2 VPN connections, to remote branches, and then I want to route all traffic to ...
1
vote
2answers
36 views

How do I find what performs port forwarding?

I configured port forwarding 6 months ago somehow on one of my AWS EC2 servers but I can't remember how. It's Amazon Linux instance. I thought I used iptables but rules table reveals anything. $ ...
1
vote
1answer
2k views

Block ESTABLISHED connections with firewalld/iptables

I am running firewalld on my server and I am trying to setup a fail2ban (using firewalld) in order to improve security. The problem is: I can't get it to kill established connections. Firewalld has ...
2
votes
2answers
2k views

Bonding two broadband connections to serve LAN as a gateway

I need to increase the connectivity and speed of the Internet to my LAN users. These are the things I have in my hand to do so. PC with 3 NICs 1 for LAN and 2 for routers 2 broadband connections ...
-4
votes
2answers
382 views

Iptables rule to allow the incoming request from only IP and reject all other ip's [closed]

Hi We have blocked entire country and but the same blocked country we need allow incoming request one particular IP form the blocked country
0
votes
2answers
635 views

Local port forwarding using iptables is not working

I am using the following command to forward incoming traffic from port 30 to port 1234. But it's not working. In Wireshark also there is no trace of packets directing to port 1234 are found. sudo ...
0
votes
3answers
798 views

Route certain client through Openvpn tunnel

I have openvpn client running in my centos box which I use as a router for my internal network. I have two interfaces for reach outside world. eth0 - normal internet tun0 - openvpn tunnel I ...
1
vote
1answer
56 views

Redirect all outgoing DNS queries to local stub resolver at 127.0.0.1:53

I am attempting to redirect all outgoing DNS queries on my Linux box to my local caching stub resolver (unbound). iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to 1.1.1.1:53 iptables -t nat -...
1
vote
0answers
44 views

FTP Connection Refused after passive mode

when using ftp via commandline I can connect and authenticate but when I issue commands I receive the message connection refused. I am able to connect to this FTP server from other servers and locally ...
1
vote
2answers
28 views

How do I block public port(3306) access in Linux but allow from other nodes on local network?

I have a MySQL server running on port 3306 with a private IP: 10.64.30.117. I also have a web app running on another node with a private IP: 10.17.23.1. I want the web app to be able to access the ...