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.

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

How to add iptables rule to redirect http(s) traffic for specific service only (OpenVPN) and not affect another services (Apache2 etc)?

I have own VPS (Ubuntu 18). I have there runned Apache2 and OpenVPN servers. Also I have there Squid proxy that I want to use with OpenVPN to intercept traffic and change headers like user-agent. To ...
0
votes
0answers
12 views

VPN Kill Switch with SSH exception

I am running a FreshTomato Router which is constantly connected as a VPN Client. To force all internet traffic through the tunnel, I am using this as a kill switch (recommended setup from VPN provider)...
0
votes
0answers
9 views

Routing a port from my PC over a VPN-Server, making it accessible from the outside

I host a service on my PC, which I want to forward to from my VPN Server. Idea is, that a connection to <VPN-Server public ip>:12345 gets forwarded internally to <PCs internal ip>:12345. ...
0
votes
1answer
17 views

What is a reason to have ACCEPT and DROP rule for the same traffic in iptables?

I found this in my server's iptables: -A INPUT -i eth2.600 -p udp -m udp --sport 53 -m limit --limit 10000/sec --limit-burst 200 -j ACCEPT -A INPUT -i eth2.600 -p udp -m udp --sport 53 -j DROP Will ...
0
votes
0answers
37 views

Iptables drop all packets

I use these rules for prevent ddos but these does't works. All of packets droped. ### 1: Drop invalid packets ### /sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP ### 2: ...
0
votes
0answers
16 views

Get 502 status code after apply iptables

I add these rules to prevent DDOS but some times Nginx proxy gets 502: #! /bin/bash ### 1 #/sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP ### 2: Drop TCP packets ...
0
votes
0answers
9 views

KPN IPTV Routing via Ubuntu 18.04 - Or how to route VLANs

I have KPN FibreOptic internet, a Dutch ISP that also delivers TV over that optic cable. It is setup in such a way that VLAN6 delivers Internet and VLAN4 delivers IPTV. Internet is setup via PPPoE and ...
0
votes
1answer
88 views

Why iptables drop all packets?

I set this role for drop invalid packets: iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP but it drop all packets. this is all my iptables rules:
0
votes
1answer
17 views

Is it possible to route incoming traffic permanently in linux?

I was trying to route my incoming connections to a teamspeak server on another machine using below iptables commands iptables -t nat -A PREROUTING -p udp -s 0/0 -d LOCALIP --dport 9987 -j DNAT --to ...
0
votes
2answers
587 views

Iptables: How do I block all outgoing traffic on a network interface except for a single port

I am very new to using Iptables, and I am attempting to only allow the outgoing tcp traffic from port 51355 on eth0 Here is an attempt based on what I have found online so far: iptables -A OUTPUT -o ...
0
votes
0answers
7 views

iptables MSS clamping confusion

I have a Raspberry PI (Raspbian), which I'm using as a gateway for my home internet. It just uses a set of iptables rules. Everything is working fine with this, except for one very specific issue ...
0
votes
0answers
12 views

multi route load sharing not working when add second table route and its rule

I am trying to configure Multi Routing Load SPLIT with Fail Over on 2 different ISP's. I did this years ago in Centos and Fedora and its works like a charm and I implemented 7 Linux base routers in my ...
0
votes
0answers
34 views

Why this simple Iptables rule set is not working?

This setup is a host machine 192.100.200.1 connected to two virtual machines 192.100.200.100 and 192.100.200.110. There's also another virtual network 182.158.50.0 connected to the same host on the ip ...
0
votes
0answers
10 views

WiFi Hotspot Disable Neighbor discovery

I am using WiFi hotspot feature of Ubuntu 18.04 to create a hotspot for my devices. I need to prevent different devices on the network from contacting each other. More specifically, I have two phones ...
0
votes
0answers
25 views

How can I restart iptables without losing the limit tables?

I want to restart iptables but don't want the limit tables be be purged. How can I do this? /proc/net/xt_recent/* /proc/net/ipt_hashlimit/*
1
vote
0answers
9 views

iptables: Limit hit /24 per ip (NETSCAN-Limit) dst limit for ip

in centos we have nat and vpn: 1- detect connections per IP to any /24 if more than 3 different ips in /24 within 5 seconds 2- set dst limit all /24 only for the source ip wich wanted to hit them 3- ...
0
votes
1answer
46 views

TCP handshake failed after forward LAN connection through VPN

We have some secured web services, including websites, that are only accessible when connected to a VPN provided by the service owner, and since the VPN account is only allowed to be connected by one ...
0
votes
0answers
11 views

In Kubernetes cluster some destination can't communicate with a worker node

I have 2 worker nodes (worker 0 and worker 1). some destinations can't communicate to my worker 0 node. for example my zabbix server can't add worker 0 node to icmp check. worker 0 and worker 1 are in ...
1
vote
1answer
19 views

Port Forwaring to a Linux KVM Guest

I have a setup where I run PopOS and and Run Windows 10 in KVM for my games. I recently experienced disconnects from COD:MW due a Strict NAT Type, the web suggest to forward some ports in your router ...
1
vote
1answer
614 views

RULE_APPEND failed (iptables)

I'm working on an assignment in which I have to create some custom firewall rules on a Debian router. I'm using iptables to create the rules. Here's the thing, whenever I try to add this rule: ...
-1
votes
0answers
48 views

Iptables - Config : command not found

[root@localhost init.d]# iptables-config bash: iptables-config: command not found... [root@localhost init.d]# uname -a Linux localhost.localdomain 3.10.0-1127.8.2.el7.x86_64 #1 SMP Tue May 12 16:57:42 ...
0
votes
0answers
7 views

I want to log everything with iptables. How can I do so? [duplicate]

I want to log everything with iptables. I have tried- iptables -I INPUT 1 -j LOG iptables -I FORWARD 1 -j LOG iptables -I OUTPUT 1 -j LOG iptables -t nat -I PREROUTING 1 -j LOG iptables -t nat -I ...
1
vote
0answers
20 views

Redirect all http traffic to static address in OpenWrt on Raspberry

I have an ISP router with IP 192.168.1.254. I installed OpenWrt on my Raspberry PI 3 B. Raspberry is connected to the ISP router via ethernet On the Raspberry I configured 2 networks: wan wifi ...
1
vote
0answers
39 views

IP Forwarding in is not working in a Linux VM IPtables

I am trying to use IPtables and it's NAT functionality in a Linux VM to make a network connection work I have a RHEL Linux Box. It has two interfaces eth0 & eth1. I have a Windows Servers behind ...
0
votes
0answers
23 views

Add NAT rules in a RHEL 7.8 Linux VM

I am new to using the Iptables and NAT on a Linux machine and I am hoping i you can help me. I have a RHEL 7.8 Linux VM. I need to use this VM as a router so that I can NAT the traffic. My goal here ...
0
votes
1answer
70 views

OpenVPN port forwarding not working on VPS to Linux client

Been through several Superuser and ServerFault questions and I am not able to get this working with iptables. I am trying to port forward a specific port 12345 through OpenVPN running on my Linux VPS (...
0
votes
0answers
10 views

How to specify multiport iptables with mac address source?

As per the subject - I want to have a rule which match the MAC address of the source I want to allow and allow 80 and 443 only. I have the following rule which works correctly: multiport when I ...
0
votes
1answer
30 views

How do I exclude a port from OpenVPN on Raspbian?

I am running an OpenVPN tunnel 24/7 on my RaspberryPI, but also want to reach it under my real public IP address with port 25565. I forwarded the port already with my router, and without OpenVPN ...
0
votes
0answers
18 views

IPTables: How to filter network access by application?

I see how IPTables can control network access by IP address and port, but how do you filter by application? (So, for example, YUM and Firefox can access TCP ports 80 and 443, but not the myriad other ...
0
votes
0answers
26 views

IPTables NAT Prerouting not working

I am trying to use IPTables NAT to reroute a request to myip:3240 to an ip from an OpenVPN client, 10.8.0.8:3240. The command I am using is iptables -t nat -A PREROUTING -d 192.99.154.95 -p tcp --...
2
votes
0answers
28 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 ...
1
vote
1answer
20 views

configuring a multihomed host as a router

I have two linux hosts on my home network, host1 and host2. I'm trying to configure it so that host1 is connected to a vpn, and host2 can send packets out over the vpn by routing through host1. My ...
0
votes
0answers
11 views

how to create a rule that allows connecting via nat to a single external client from the vpn network

I have a gateway running OpenVPN server, clients connected to the VPN server can see the local network, but they can't connect to the external network via NAT. How to configure iptables rules on ...
0
votes
1answer
24 views

Not able to ping router's WAN IP from a machine on LAN network

I have a machine (Linux ubuntu) that acts as a router, the routing is working fine. iptables -A FORWARD -i wg0 -j ACCEPT iptables -A FORWARD -o wg0 -m state --state RELATED,ESTABLISHED -j ACCEPT ...
0
votes
0answers
24 views

How to create and debug a NAT rule with iptables?

My question involves 3 parties: An agent located in a house behind a router or a firewall A server on the cloud (VM on digitalocean) A client that want to connect to the agent through the server The ...
0
votes
0answers
19 views

How to setup a prerouting rule on iptables?

I would like to redirect port 3666 of my VM to another SSH server on a VPN tunnel. My VPN works and from this VM on x.x.x.x I can perfectly reach my remote server with ssh 10.8.0.42, but when I ...
1
vote
1answer
39 views

Configuring iptables to port forward ssh connection to a server

I have a network topology that looks like so: Internet--------------------Firewall-------------------------Server 0.0.0.0/0-----172.8.45.140 & 192.168.1.1-----192.168.1.2 I need to configure ...
0
votes
3answers
49 views

Router won't forward ranges of ports to Linux server. Is there a software solution?

I need to forward a large range of ports to a Linux machine running Asterisk. The machine is behind a household router. The router can be successful configured to forward single ports to Asterisk, e.g....
0
votes
1answer
38 views

kernel missing nf_tables_inet module in Solus

the title says it all. Solus Linux kernels are missing numerous kernel modules essential to successfully operating nftables! why is it even a pkg in the eopkg repos if they don't compile their kernels ...
1
vote
0answers
22 views

All connected users have LAN ipaddress (VPN)

Problem: All connected clients(users) have local network IP address! I have 1 Dedicated Server at home, and 1 VPS at hosting! I want to make VPN server to VPS what will connect to Router. VPS ip: ...
0
votes
1answer
24 views

Cannot open 8080 port on EC2

I use AWS Ubuntu Instance and try to open port 8080. This is my "Security Groups" settings: ec2 image I have added port 8080 to iptables: sudo iptables -L Chain INPUT (policy ACCEPT) target ...
0
votes
1answer
57 views

CentOS 8.1: Forwarding OpenVPN Clients to LAN without NAT

So there's an OpenVPN Server with multiple clients, which I successfully divided into multiple subnets. 10.0.30.0/26 for generic clients which are only allowed to communicate with the OpenVPN Server ...
0
votes
0answers
9 views

Allow certain ports only on one subdomain

I have multiple domains and subdomains, and I have a serivce on a port, that I'd like to setup so that it's accessible only on one certain subdomain. So for example foo.bar:9999 works, but bar:9999, ...
0
votes
0answers
46 views

socat recipe for port forwarding TCP traffic between Linux namespaces

Newbie to socat and hence the query. Have access to an Admin process (with root permissions), say 'config'. Device has two Linux namespaces (say, 'outside', 'inside'). 'inside' namespace has a ...
0
votes
1answer
19 views

How to set iptables rule - access to only one ip/domain

I need help with create iptabes rule, that user's ip (specified in local eth) can connect only with definied ethernet ip address/domain and all other traffic should be dropped. Should works only one ...
0
votes
1answer
28 views

How to route tcp traffic from all/range of ports to a single port?

I would like to do something that's possible with IPTABLES(for linux), on a Windows 10 - that is to route multiple ports to a single port. I thought I'd manage to do it with netsh, but it doesn't ...
0
votes
0answers
284 views

How to implement ipv6 while keeping ipv4 with reverse proxy?

I'm configuring ipv6 for containers on proxmox. All the containers should be accessible from the outside, so, I guess, I need to configure GUA (Global Unicast Address) for each of the container. ...
0
votes
0answers
28 views

How to loopback from my localhost but destination ip is outside

I have a proxy, and I want to establish a connection to outside destination ip in the proxy . If I directly connect the outside destination ip in proxy which can't trigger the frontend rule, so I need ...
0
votes
0answers
119 views

How to tunnel all traffic through shadowsocks with v2ray config?

Recently I was working ShadowSocks with V2ray plugin, but there was a problem since I encounter routing all the system traffic through ShadowSocks The problem is I don't know to forward the whole ...
0
votes
0answers
11 views

Forward requests sent to port 80 on a specific domain to another port on the same server

I want to forward all requests addressed to http(s)://cloudii.tk on the server to another port (5000 | 5443) on the same server. That means: If the server gets a request addressed to cloudii.tk (port ...

1
2 3 4 5
32