Questions tagged [iptables]

Iptables is a module that provides the Linux operating system functions of firewall, NAT and logging of data traveling over a computer network.

771 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10
votes
1answer
2k views

Allow traffic through a firewall to a dynamic IPv6 address

Suppose I have this configuration on IPv4 right now: My router (a Linux box) is connected to the Internet on eth0 and my LAN on eth1. I want to forward port 80 to 10.1.2.3. Here's how I'd currently ...
6
votes
2answers
4k views

FTP client not working inside Docker container

I am trying to get my app functioning properly in Docker, but am having trouble with it. The app connects to a remote FTP server with PASV mode, and PUTs a file. Pretty simple and works fine without ...
5
votes
1answer
2k views

Block Windows 10 P2P updates with a corporate firewall

I work for a small IT company that fix mostly Windows computers, and lately we have an huge issue with Windows 10 updates. When a new computer enters our network and starts downloading updates, it ...
5
votes
0answers
6k views

How do I configure DD-WRT to forward IPSec traffic to an internal server to support a road warrior configuration?

I use dd-wrt as my home router setup and that's been working fine. Now I wanted to figure out a way to be able to use my iPad to set up a IPSec tunnel to my home network while I'm on the road. PPTP ...
5
votes
1answer
3k views

How to configure port forwarding for an IP camera

I need to configure port forwarding for my IP camera so that I can access it from internet. UPNP is not supported on my gateway. My network configuration is the following: Gateway (Ubuntu Server 12) ...
4
votes
0answers
376 views

Forwarding traffic from network interface to a zerotier interface

Environment Ubuntu 18.04.3 LTS ZeroTier 1.4.6 (latest stable package) Wine 4.17 (latest development package) I'm trying to host a Red Alert 3 LAN session (using wine) on my system and would like to ...
4
votes
0answers
1k views

IP forwarding between two interfaces on Windows Server from Linux box

I have two VMs, one Ubuntu Server and one Windows Server 2016. On both machines I have a virtual switch with NAT (Hyper-V vSwitch on Windows) with Docker containers connected to them. On Linux my ...
4
votes
0answers
5k views

How do I kill existing network connections on Linux?

I've been working on a project that is nearly complete: to be able to kill my children's internet connections at the touch of a button. I've implemented part of the solution by basically calling: ...
4
votes
1answer
2k views

Block all outgoing traffic for a User running Wine apps

Good day, I'm using a lot of WINE apps under Linux which work just fine, but one thing I am specifically looking for right now is to block their access to the internet (outgoing), with exception of ...
4
votes
0answers
363 views

Iptables error :libipt_cgroup.so doesn't exist while using net_cls.classid in net_cls cgroup subsystem

In kernel document doc/cgroup/net_cls.txt, it introduces the function of net_cls.classid, and show an example of netfilter (iptables) using this tag to perform actions. the command of iptables is: ...
4
votes
1answer
2k views

Linux iptables forward from ip1:port1 to ip2:port2

I connect thought tunnel to other machine like this: ssh user@ip -L2000:192.168.64.88:80 So on my local machine I want to configure iptables that way like I have a "native" access to 192.168.64....
3
votes
1answer
240 views

Linux not preferring ipv6 on dhcpv6 network

On my home network, I'm using a (Raspbian) Raspberry Pi as a wifi router with hostapd, isc-dhcp-server, radvd, pihole, and dnscrypt-proxy installed. I do not use dhcpcd, I use dhclient. As I only get ...
3
votes
2answers
3k views

iptables rules to allow devices on VPN to access internet

I have a linux firewall setup as my home network gateway that is correctly leasing IP addresses to devices on my network, and those devices have internet access. I also setup OpenVPN on the same ...
3
votes
0answers
355 views

MITM redirecting to my own NTP server, blocking traffic to Apple NTP pool

CONFIGURATIONS ipv4.forwarding 1 (ON) arp_cache_poisoning between VICTIM & D.G.. (192.168.1.100 & 192.168.1.1) **LAN** VICTIM: 192.168.1.100 ATTACKER: ...
3
votes
0answers
82 views

How do I use iptables to forward all dns requets from a specific MAC address to a IP address?

I'm not an experienced iptables user and am trying to figure out if there's a way to forward all dns requests for a specific device on my network to an external or internal webserver? Appreciate any ...
3
votes
1answer
1k views

does iptables perform a automatically SNAT for response packet, if it does when does it happened?

Let's assume we have a router which has internal ip(192.168.1.1) and external ip(192.0.2.5) and a computer behind the router which has internal ip(192.168.1.100). And the router has already configured ...
3
votes
0answers
169 views

iptables, groups and setgid

I have a question about the "owner" module of iptables. I saw that it's possible with it to only allow some programs to use services based on their (e?)gid. On this basis, I can employ the set-group-...
3
votes
1answer
1k views

How do I port forward from adapter to localhost, changing ports

I am using an Ubuntu 16 server. I am trying to use iptables to forward a port from a particular network adapter and port to a specific port on lo/127.0.0.1. It seems like the correct tool. By way ...
3
votes
0answers
428 views

Iptables/Route with 2 ssid hostapd and subnets and openvpn setup

I'm struggling to setup iptables/routing in the correct way. Objective is: - Traffic from clients connected to wifi-KK to not use the tunnel but go via eth0 to router - Traffic from clients ...
3
votes
0answers
94 views

iptables: aren't these docs wrong?

I've been looking at two references for iptables documentation, and both appear to be wrong in some very important details. However, being new to iptables, I'm not fully sure, hence this post. ...
3
votes
1answer
334 views

Linux: When does Reverse Path Filtering happen?

I know that with rp_filter set to 1, linux would check the route table to see whether the input packet "belongs" to this network (and drop it if not). So when exactly does this happen? And which ...
3
votes
0answers
734 views

Strict/detailed iptables rules for i2p

I think I've understood the i2p faq correctly, and this appears to work (added the wording from the faq followed by the rules, in order, and changed my unique port number to PORT): # Outbound UDP ...
3
votes
0answers
32 views

Redirect/Resend IP packets after WakeOnLan

my old pc is playing home server now and uses a lot of energy. Therefore i'd like to suspend it, when it's not needed and wake it up when someone tries to access it. My plan is to notify a Raspberry ...
3
votes
1answer
875 views

Logging LAN traffic with ebtables-iptables-ddwrt

Goal I am trying to log internal(eth0->eth0[via br0]) traffic to syslog on DD-WRT. Problem Bridged traffic is not seen by iptables. The same traffic is also not visible via ebtables. Things I ...
3
votes
0answers
218 views

Why do different users get different IP via the same interface

On the same server, on root, I am getting the correct internet ip of the interface root@server:~# curl -s --interface ppp0 ipcheck.com 111.111.111.111root@server:~# However... If it's not super ...
3
votes
1answer
7k views

iptables-restore failed at COMMIT line, no detailed description

I'm trying to setup iptables (using iptables-restore) for a new server and was looking at the security docs from Linode, so basically used their templates for IPv4 and IPv6. These are both failing at ...
3
votes
1answer
414 views

Routing traffic around VPN

I recently setup a OpenVPN client on my HTPC, however once I connected to the VPN server I was no longer able to remotely SSH or connect to the other servers I had running on the HTPC. I followed ...
3
votes
3answers
4k views

How to force Google safesearch on entire network

I've a problem filtering web searches on Google domains. Currently I've a linux openVPN Server running with openDNS "family block". I can block a lot of websites with dangerous content and it's ok. ...
3
votes
0answers
4k views

udp client sending ICMP “port unreachable” when receiveing messages from the server

(Note: I moved this question from StackOverflow, because it's to be considered off-topic there, better fits here, and still unsolved) I have a udp client using luasocket, basically doing this (with a ...
3
votes
1answer
603 views

How does uTorrent can automatically forward port through Linux Net Filter based firewall?

I have dilemma: How it is possible that uTorrent shows on my internal machine with internal IP, that my connection is OK (green check in the bottom right of its window), while I never forwarded any ...
3
votes
1answer
745 views

Why does Firefox need a loopback connection?

I was playing around with firewalls and iptables. When I blocked any traffic except HTTP and DNS I was able to establish a connection to google.com via wget google.com. But I wasn't able to open ...
3
votes
1answer
4k views

Match multiple strings in iptables

I have 2 strings, and i wish to queue the packet if it contains both the strings ( something like ("jsh"&&"gjhyg")), i tried following ways, but they don't seem to work: sudo iptables -A ...
3
votes
2answers
7k views

DD-WRT firewall rule configuration

I'm using DD-WRT on my linksys router. I want to limit each user on my network to 200 connections at any given time. Does anyone know the rules I enter the firewall in DD-WRT admit panel. I tried ...
3
votes
1answer
612 views

Using Raspberry PI as OpenVPN router for Asterisk

So, I've been banging my head with this for quite some time. I have the following configuration: OpenVPN server, IP 1.2.3.1 Asterisk server, connected to OpenVPN server, IP 1.2.3.3 Raspberry PI, ...
2
votes
0answers
41 views

iptables cgroup module not found with Kernel 4.19.118-v7l+ and iptables v1.8.2

I try to do a routing on a per process basis like described here Route the traffic over specific interface for a process in linux and here https://www.evolware.org/?p=369 However when I try to execute ...
2
votes
0answers
31 views

OpenVPN use IPtables NAT without sending all traffic through VPN

I have a VPN connection between two servers that I want to use to allow one to connect to the other's ports and use IPtables Prerouting to make it accessible from the other server. I do not want any ...
2
votes
0answers
81 views

Port Forwarding when using a Bridge and IPTables

I have a Raspberry Pi that I am using as a bridge to allow it to act as a router to devices attached to it either via a physical port (eth0) or a wireless connection (wlan0). The Raspberry Pi has a 4G ...
2
votes
0answers
54 views

Prohibit non-LAN traffic from VPN interface

We have a machine running an openVPN client for the sole purpose of being able to SSH to the client while it is connected to a remote network. The VPN is working mostly correctly, but it is routing ...
2
votes
0answers
227 views

IPTables byte count inconsistent

I have the following IPTables rules - basically to allow only 2 IP addresses to access the internet. These rules are on my home wifi router running DD-WRT. Chain INPUT (policy ACCEPT 16114 packets, ...
2
votes
0answers
1k views

OpenSwan VPN Routing/NAT

I am setting up a vpn to one of our customer's networks. Due to a requirement on their end, we cannot have our traffic (appear to) come from a private ip address. I have been able to get a tunnel ...
2
votes
0answers
134 views

Route all traffic throuch a Linux machine

I want do route all traffic from and to two IP phones (SNOM D305) through a Linux machine for debugging purposes. The IP phones have a builtin 2-port switch each and the setup looks like this: ...
2
votes
0answers
570 views

DDWRT Firewall Rule Not Working

I am using a Netgear router flashed with DD-WRT firmware running a constant VPN connection. I do not use any VLANS or any other firewall rules. To help protect my IP address, I applied the following ...
2
votes
1answer
585 views

My iptables redirection rule does not effect

Here is my network topology, 101.101.101.101 and 202.202.202.202 are global IP while 10.0.1.1 and 10.0.1.251 are local IP. Host B is my computer. I can SSH to the router and then SSH to Host A on ...
2
votes
0answers
836 views

Centos 7 firewalld changes source address for local connection

I'm using CentOS 7 on my server. I have an application that accepts connections only from localhost. The problem is with firewalld that it changes local connection to use external address as a source ...
2
votes
1answer
6k views

How to redirect all traffic in eth0 to eth1 and back

I have a Ubuntu box with eth0 and eth1. How can I redirect all the traffic coming from eth0 to eth1 and back? Should I do DNAT and SNAT like below or just forwarding or both ? Edit My case is like ...
2
votes
0answers
2k views

Linux iptables script to block all internet access except for desired applications

CONTEXT: I wanted to have a shell script that would block all Inbound/Outbound traffic to my computer, UNLESS I decide I want to use the browser or some other application, in which case I would ...
2
votes
1answer
157 views

Disable OSX kernel space TCP handling

I'm writing a partial reimplementation of TCP for learning purposes, using Scapy. My TCP server.py does not get the chance to respond to SYN messages sent to it because the kernel responds to them ...
2
votes
0answers
41 views

How packets are forwarded between interfaces

I have problems with understanding this topic. I understand iptables packet flow as well as well as kernel hooks. Do not take into account iptables rules, just net.ipv4.ip_forward enabled and ...
2
votes
1answer
562 views

How to slow down traffic with tc?

I'm on Ubuntu 14.04; I'd like to learn the basics of traffic shaping, I made a simple script that should slow down my HTTP(S) traffic to ports 80 and 443. # usage: sudo ./filename.sh #delete ...
2
votes
0answers
120 views

How to verify whether the IPTables rules are disabled?

I am using Linux server and don’t have root access, used limited sudo access. Version of Linux I am using is: Red Hat Enterprise Linux Server release 6.6 (Santiago) I used this lsmod command to ...

1
2 3 4 5
16