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.
1,904
questions
0
votes
0
answers
110
views
Iptables redirect outside requests to 127.0.0.1 (VirtualBox)
I have a virtual machine installed with the output:
ifconfig:
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::...
0
votes
1
answer
131
views
VNC Connection to a remote host with reverse ssh tunnel
I have the following setup:
Raspberry Pi with no public IP address
Public "jumpserver"
Currently i have autossh running on the Raspberry to connect to the jumpserver.
Works without ...
0
votes
0
answers
36
views
Packages droped after DNAT from Broadcast to Unicast
I have my normal network (192.168.1.0/24) and IoT network (192.168.2.0/24) seprated on different vlans (devices switch0 and switch0.30 respectively).
My firewall is setup so that clients from the ...
0
votes
1
answer
46
views
Docker exposed ports available from host, but not from other machines in iptables restricted container
I have custom container with VPN inside, with following iptables rules inside container:
# Flush all existing rules and chains
iptables -F
iptables -X
# Set default policies to DROP
iptables -P INPUT ...
0
votes
1
answer
124
views
IPTables rules and networking with problems
I'm using a Fritzbox for normal network and an own installed Router on rpi3 for an own network with openvpn, dnsmasq and iptables. Over the last few years the setup worked good. You can find the ...
0
votes
0
answers
318
views
How to configure iptables to forward all traffic to another host, but let said other host see the real IPs of clients?
I have a server (server a) with a public IP, and another server (server b) which is behind a NAT. I would like server a to pass all traffic (TCP, UDP, ICMP, etc) to server b, so that a client ...
1
vote
0
answers
54
views
How to prevent to lockout from vpn server?
I have a wireguard server on VPS, I am able to connect through ssh. It has to put on port forward ssh command to wireguard client.
iptables -t nat -A PREROUTING -p tcp --dport 22 -j DNAT --to-...
0
votes
1
answer
77
views
Prevent traffic from wlan0 to be routed to the internet via eth0 using iptables
I need to restrict traffic on a debian machine, e.g. using IP tables. Specifically, the server has 3 main network interfaces, eth0, wlan0, and tun0.
eth0 is the normal ethernet connection using which ...
2
votes
1
answer
2k
views
Using Wireguard to forward traffic from public facing VPS to private server
TL;DR; I'm trying to setup a bunch of internet facing services (web, smtp, other) on a machine running on my LAN and forward traffic to it from a public facing VPS machine using Wireguard in such a ...
0
votes
1
answer
72
views
How to SSH Out from a Subnet
I have a home networking setup like the figure below (excuse bad drawing). VM1 is a VPN "router" that redirect all traffics from VMBR1 to the WG (wireguard) interface. I've managed to ...
0
votes
0
answers
114
views
Use Ubuntu-server as RDP gateway
I need to reach a win10-machine (10.7.3.23) via an ubuntu-server (10.15.0.12).
Via VPN I can reach an ubuntu-server, but not the win10-machine. The ubuntu-server can reach the Win10-machine via port ...
0
votes
1
answer
166
views
unable to connect to WSL container by it's ip address
When I do php -S localhost:80 in WSL / Ubuntu 20.04.1 I am able to connect inside WSL but not outside of WSL.
My WSL instance has an eth0 IP address of 172.18.240.175 as doing ifconfig reveals. If I'm ...
1
vote
0
answers
33
views
IPtables doens't block client to client communication
I'm working on a project with my fellow students, and we've discovered a vulnerability in a IP camera. This camera uses port 8554 for the rtsp protocol (it's unauthenticated). I want to block this ...
0
votes
2
answers
140
views
Prevent Internet access when VPN fails
Consider the following scenario:
The VPN server is a FritzBox 7590 with the latest OS and VPN configured as IPSec.
I have two locations that I connect via a VPN as follows. Location A runs a VPN ...
0
votes
0
answers
154
views
Routing Traffic from PPTP VPN Server to OpenVPN Client on tun0
Thanks for taking the time to help me out. I'm trying to setup a routing between the traffic I get from my PPTP VPN Service on (ppp0) and route it to my OpenVPN (tun0) Interface. I have tried multiple ...
0
votes
0
answers
131
views
Why does route rule not work when I set mark after the net packet go through the 'forward chain' of iptables?
I want to that all the packets through 'farword chain' redirect to local loopback, so that I can proxy this traffic.
I set the route rules of iproute2 (all the packet with mark 1 is routed to local ...
1
vote
0
answers
110
views
How do I limit access to a port of a docker container with iptables?
I have a docker host running a container on a bridged network, providing vpn access to a endpoint on multiple ports (one for each system on the remote network). Now i want to limit the access to that ...
0
votes
0
answers
61
views
Can you forward packets from TUN to router on a Mac?
I'm intercepting packets on a toy packet sniffer I have that just pulls all traffic off a TUN device. I've setup a default route to the TUN on my mac via:
sudo route -n add default 10.1.0.10
where 10....
0
votes
0
answers
368
views
How to route Wireguard within a network namespace with public internet access?
I've been trying to wrap my head around this for several days now, so I drew a picture (at bottom of post).
Context
I have a VPS with two namespaces:
init namespace (root)
custom namespace (my cool ...
0
votes
1
answer
111
views
Linux Port Forward dependant on receiving IP
I have a Linux based router with two NIC’s.
Behind Eth1 is a network with 5 devices, device 1 has the IP 30.0.0.1, device 2 has the IP 30.0.0.2 - both are modbus devices with the port 502 open, the ...
0
votes
0
answers
133
views
Bandwidth control using traffic control `tc` on Strongswan ipsec connection
I am in the need to use traffic control tc to regulate the bandwidth.
From what I known is that I can manage the bandwidth using the following
DEV=eth0
RATE="100kbps"
tc qdisc del dev $DEV ...
0
votes
1
answer
63
views
Allow internet for a private network computer via other computer on the same private network
I am newbie in networking, and I would like to share Internet over a computer that has public and private network connection, for a computer that only has a private network connection.
I have a ...
0
votes
1
answer
160
views
How iptables SNAT deal with src port dilemma between port translation fr local ip and DNAT rule that forwards all traffic to the same local ip?
Say we have a Linux based router with WAN interface eth0 ip addr 4.3.2.1 (w/ whatever gw ip) and LAN interface eth1 ip addr 192.168.51.1/24, which means we need an iptables rule below to make the ...
0
votes
0
answers
61
views
port forward from lan to lan thought a wan ip
I have a linux router where port forwarding from wan to lan works fine.
But it doesn't work if the request comes from a lan ip to the wan ip
br0 interface for LAN (10.0.0.1/24)
eth1 interface for WAN (...
2
votes
0
answers
167
views
How Docker iptables work by default?
I am on Ubuntu 22.04
I am trying to understand iptables
iptables -L (Docker related)
Chain DOCKER (9 references)
target prot opt source destination
ACCEPT tcp -- ...
0
votes
0
answers
661
views
Shadowsocks + v2ray server on my local computer at home. NOT on VPS. How to configure redirection of traffic from the server to the eth1?
I created a shadowsocks + v2ray server on my local computer at home in a virtual machine. OS ubuntu 22.04. The ubuntu VM has 2 network interfaces: eth0 (192.168.1.10) and eth1 (192.168.2.10).
On the ...
0
votes
0
answers
47
views
Almalinux9 SSH port change is not accepting connections
can someone please give a hint what else may be wrong.
System Almalinux9, located at VPS.
I wanted to change a port of SSHD to 60022, but when i try to connect to it, it does not respond anyhow when i'...
0
votes
0
answers
164
views
Unable to forward all traffic from one interface to another with iptables
I have a Raspberry Pi (stretch) that is connected to the Internet via ethernet. I would like to forward all network traffic from wlan0 to eth0 but am having trouble doing so. Am I missing something?
//...
0
votes
0
answers
98
views
Routing traffic from from VPS to socks (redsocks+iptables)
I have an OpenVPN server running on a VPS with OpenVPN client running on my computer. I'm trying to route my client's traffic over an external 4g proxy after it reaches the OpenVPN server so my vps IP ...
0
votes
0
answers
105
views
Squid Proxy Block it RDP Connections, Solution?
This is my scenario:
I create my blocking rules inside the Squid proxy to block pages and ports. And my problem is that when I want to connect to a Windows Remote Desktop via IP, it doesn't connect ...
1
vote
2
answers
161
views
Forwarding www traffic through a remote computer
I am far from being an expert in networking so please be gentle. I did a part of this setup successfully before, following a tutorial on a certain website, which I cannot find anymore. I have two ...
1
vote
0
answers
88
views
Reroute and tunnel udp connection to another server
I have been trying to establish a connection between a vps and a dedicated bare metal server for a month now. Basically, vps will act as a tunnel to connect to my dedicated server, I'm doing this to ...
1
vote
1
answer
481
views
Cannot access Outline VPN on CentOS
I installed Outline VPN a few times on Ubuntu servers and each time it was fast and easy. Now I'm trying to install it to CentOS and the Outline VPN shell script executes smoothly and with no errors:
...
0
votes
0
answers
35
views
VPN router only accessible with new default routes instead of standard gateway setting
On my Ubuntu machines I configured a router for internal VPN Access as VM.
The VM is only used to have masked connections going out to the internet. No connections are made from outside to lan or so. ...
0
votes
1
answer
557
views
Connecting to Wireguard through another server
I'm trying to put a middle server or a proxy between my client and the wireguard server.
I don't want to directly connect to the Wireguard endpoint from my own computer.
If the wireguard endpoint is ...
0
votes
1
answer
61
views
VirtualBox - Internet with "Host-only" over PPP
I have a VM that uses Host-only Network. On the Host Machine I have a ppp0 interface through which I have access to the internet (as additional public IP-address). But if you send traffic from ppp0 to ...
1
vote
1
answer
731
views
iptables - How do I restrict access to just local devices on the network?
I have a WireGuard VPN Server running on a Debian 12 host with no problems, listening on a specific UDP port, and all is working great with no issues. I can connect from my phone WireGuard client ...
1
vote
0
answers
277
views
Unable to traceroute but able to ping
I need to connect to my own server that runs Linux Mint.
After installing Tailscale on both PCs (client and server) I can successfully ping the server from client, but I'm unable to traceroute it.
...
1
vote
2
answers
1k
views
block mac address with Iptables during attack
I have to setup Iptables to block every mac address from which 10 requests come in one minute. (ssh or http login)
To block the IP is achievable with
iptables -A INPUT -p tcp --dport 22 -m hashlimit --...
1
vote
1
answer
280
views
WireGuard Throughput Issues
I'm having quite an odd issue with WireGuard performance between a VyOS router [LTS 1.3.3] and a Cloud VPS [Debian 12] acting as a CHR.
I have a publicly facing /29 routed to the CHR via GRE, at an ...
0
votes
1
answer
183
views
Can't reach home networked Linux computer, but it's up and has internet access, not sure how to trouble shoot [closed]
I have a home server set up on a Raspberry Pi running Dietpi / Debian. Everything worked fine and I provided several services to the home network, e.g. Paperless. The server has a static IP, which I ...
0
votes
1
answer
435
views
ping is working but hping (icmp host unreachable) and nmap (host is down) are not working for all websites
I installed hping and nmap tools for the first time. Both tools can't connect to any website including google.com, but ping command works
Ping
[heman@Main ~]$ ping google.com
PING google.com(bom12s01-...
0
votes
0
answers
55
views
Trying to get 1:1 NAT working with OpenVPN (Layer 2 tap tunnel)
All. I have a small project which needs to have everything in the same collision domain (Layer 2). I was wondering which iptables commands I would need to run in order to get the printer (192.168.192....
1
vote
1
answer
492
views
One network interface with 2 gateways
I have 2 routers connected via ethernet cable. The secondary router has it's DHCP server disabled and has an IP address of 192.168.1.2. Both routers have different internet. If I create another ...
0
votes
0
answers
175
views
Port forwarding socks5 proxy across network namespaces
I've finally set up the netns veth openvpn connection that works, made overrides to systemd service files so openvpn depended on netns single shot service and tor of openvpn service. Tor works, at ...
0
votes
0
answers
256
views
Redirect marked network packets to specific interface using iptables
I'm developing application which connects to specific websocket endpoint (port 80). Application is behind Teltonika RUTX12 with two SIM cards. I am trying to configure this router in a way that ...
5
votes
1
answer
793
views
Iptables Fail to block inbound from specific ip
Hi I Have a online server which i use like gateway and iptables is acting weird
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i ...
0
votes
0
answers
48
views
Trouble Routing Traffic between 2 KVM Hosts
I am attempting to create a networked KVM setup as described in the following guide: https://c3rb3ru5d3d53c.github.io/2022/06/kvm-malware-lab/
My network topography is as follows:
┌────────┐
│...
1
vote
1
answer
683
views
Podman container port forwarding has issue with secondary NIC
My title may not be very clear
I have a server running CentOS 8:
eth0 connects to subnet 10.0.3.0/24, having IP 10.0.3.15
eth1 connects to subnet 10.0.103.0/24, having IP 10.0.103.15
As they have ...
0
votes
1
answer
407
views
Why can't I block YouTube with iptables?
Following this answer's advice on blocking sites with iptables, I have blocked many sites perfectly fine, but for some reason YouTube seems immune and is not blocked. It doesn't matter if I also block ...