Questions tagged [iptables]
Iptables is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel.
1,309
questions
0
votes
0
answers
701
views
Connection via SSH works once or twice then never again for that client
I have recently set up a Ubuntu Server minimized. I initially used the server through an SSH with client1 but after one use I kept getting Connection Timed Out when attempting to ssh from client1. I ...
0
votes
0
answers
143
views
iptables & ip_forward issue
I am having a very annoying issue and I don't know what's wrong. I also feel like I am very close to having it working, so there must be something obvious I'm doing wrong.
I am trying to connect to my ...
0
votes
0
answers
311
views
Issues setting up wireguard on an Ubuntu 22 machine
It's the first time I'm trying to set up a wireguard server on a Ubuntu 22 machine and I don't understand what exactly am I doing wrong. I'm using https://github.com/angristan/wireguard-install as an ...
0
votes
0
answers
67
views
Iptables is constantly in loop and banning same IP indefinite
1 IP is constantly banned and added to iptables, it fills my iptables with 50.000+ of DROP lines for "Same" ip.
How is this possible? If 1 IP is banned and goes to drop rule, that ip should ...
-2
votes
1
answer
57
views
Is this a good firewall to keep brute force atackers out?
I am wondering, is the script below a good firewall script to keep brute force attackers out off my desktop?
iptables -F
iptables -A INPUT -i lo -p all -j ACCEPT
iptables -A OUTPUT -o lo -p all -j ...
0
votes
0
answers
314
views
What is the best way to seperate routing tables in Ubuntu?
I'm building a lab environment with multiple routing devices and 2 Ubuntu machines as clients (22.04.2). The ubuntu machines need to act as 8 independent clients (from networking point of view) ...
-2
votes
1
answer
1k
views
How to see IPTABLES LOGS?
i want to see some logs from an specific IPTABLES rules, i didnt set any path previously, so i think it may be the default path. The report below is the log im seeking.
Iptables report
0
votes
0
answers
102
views
should i block all ping requests?
My intention is seek for protection, no needed to be a server, so i whant to avoid all kinds of SSDP, i've found some codes and need to know if its enough or too much:
iptables -I INPUT 1 -p icmp -j ...
0
votes
0
answers
352
views
PBR routing doesn't work on Ubuntu 22.04 Server
I'm attempting to configure my server, but it's proving to be impossible. Thus, you are my last hope!
To provide some context, my virtual server (Ubuntu 22.04 server TLS) has 3 network devices ...
1
vote
0
answers
910
views
How to allow SSH only from WireGuard and one IP
This is production server and I need to add rules very carefully, I don't sure what is correct rule.
Currently my UFW rules allow SSH connection from any IP and from WireGuard, also my own IP (YYY.YYY....
0
votes
0
answers
54
views
Is it possible to connect a WiFi route to some server and forward every connection to that server?
I'm facing some package loss issues I'm having in my home-network. I'm looking at some log entries and some game reports I've detected, a somewhat strange IP route added, and a snort made me some ...
0
votes
0
answers
100
views
UFW on ubuntu virtual router not blocking correct traffics
I have a virtual router running on Ubuntu Server 22.04. The virtual router has two ethernet interfaces enp1s0 and enp2s0. The interface enp1s0 is connected to the external network and the interface ...
0
votes
0
answers
301
views
Diference between IPTABLES RAW PREROUTING and MANGLE PREROUTING
I'm looking for configs to prevent DDoS attacks and UPnP Flood, since I've started to create rules, every advice was to add rules to filter table, but it takes too much CPU process, so started to ...
2
votes
1
answer
543
views
Fail2Ban bans, iptables lists the block but connection is still not blocked
I am using Ubuntu 22.04 LTS and I am trying to prevent repeated connection attempts to our mail server using fail2ban. Fail2ban creates a proper entry in the iptables configuration, but the related IP ...
1
vote
0
answers
123
views
iptables show ACCEPT but connection got refused
I have a Django application accessible at port 8080. My current iptables is set
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
...
0
votes
0
answers
1k
views
Port Forwarding in Ubuntu Server 22.04 not working for me
I am fairly new to ubuntu and need help. I am running ubuntu server on my vps and home server. They are connected via Wireguard and I would like to forward the port 25565/tcp,udp to my home server. I ...
0
votes
1
answer
156
views
Unable to remote access the web server running on Ubuntu machine
I'm unable to remote access nginx server or express server or any server running on Ubuntu in the same network
I tried every solution found on Google, chat gpt but no benefit
I'm able to ssh on Ubuntu ...
0
votes
0
answers
157
views
Block IPv6 Traffic using iptables on Linux using Layer 2 info [bad substitution/argument]
i'm trying to block IPv6 traffic on my router's end following the tutorial here by Claudius's suggestion, with the following command:
ip6tables -I FORWARD -d ${IP(Node1)} -j REJECT
But i'm getting ...
0
votes
0
answers
336
views
Port forwarding not working
I have a machine on my home network I am trying to port forward (for rust if that helps) and I need to get these done
TCP: 27015, 27036, 28016, 28083
UDP: 27015, 27031-27036, 28015
I have allowed all ...
0
votes
1
answer
268
views
How i can change ping (icmp) packet size by iptables in VPS?
How i can change ping (icmp) packet size from default (64 byte) to 1 byte with iptables for both VPS input and output ping to specific IP in VPS?
I executed this command but when I get ping again 64 ...
0
votes
0
answers
530
views
Share two network interfaces on linux
I have a Linux PC (ubuntu 22.04) with a network layout as below:
Internet <-> Router <-> PC <-> edge device <-> Switch <-> APs <-> devices
And with two Lan ...
0
votes
1
answer
363
views
Can not block torrent traffic in my Ubuntu 22.04 vps
I have an Ubuntu 22.04 vps which I want to block all torrent traffic on it.
I tried Iptables by this commands :
iptables -I FORWARD -m string --algo bm --string "BitTorrent" -j DROP
iptables ...
0
votes
0
answers
1k
views
UFW allow rule with destination and port
Setting up UFW firewall on Ubuntu I wish to allow connections on port 22 from my local network only. I use next command:
ufw allow from 192.168.1.0/24 to any port 22
For me is unclear in the part &...
0
votes
1
answer
964
views
UFW - Port is reachable for everyone although only certain IP's are opened
I run an Ubuntu 22.04 server on an VPS with a current version of UFW.
Further i run an docker instance with firefox - https://hub.docker.com/r/jlesage/firefox
The port is routed to 5800 to access this ...
1
vote
0
answers
107
views
how can i set data traffic limit for per user ? (based on uid/gid )
I need to set a traffic limit for each user , which should be based on the username or group name. I have already tried nethogs software and some similar programs, but they limit the bandwidth. In ...
0
votes
1
answer
879
views
How to forward all or part of openvpn server traffic to another server through SSH tunnel?
I need to route all OpenVPN client traffic from Server A to Server B via SSH tunnel.
Client Server A Server B
------------------- ------...
3
votes
0
answers
5k
views
How to check if ip forwarding is enabled
i have 2 vps services from 2 diffrent providers and i want to use iptables for prerouting .
i can do it easily on one but cant do it on the other one , i almost read all articles and tried them but ...
0
votes
0
answers
1k
views
22.04: How to add persistent routes in netplan
What is the best way to add the following rules to netplan?
1 ip rule add from 172.16.9.132 table 128
2 ip route add table 128 default via 172.16.9.1
3 ip route add table 128 to 172.16.9.0/24 dev eth0
...
0
votes
0
answers
1k
views
The same iptables NAT commands works in ubuntu 18.04 and 22.04 but not in 20.04
My layout is:
My goal is to ping the Internet from eth0 through enp45s0 and wlo1.
The commands below works well in ubuntu 18.04, 22.04 but not in 20.04(unable ping the Internet like google.com, DNS).
...
0
votes
0
answers
282
views
Add custom iptables rule to UFW to be persistent
I would like to add the following rule to block the access for a specific user in Ubuntu 22.04 and persist whenever UFW is on. Is there a mechanism to do this while playing nicely with the UFW?
-A ...
0
votes
1
answer
113
views
Iptables: DROP software if NOT run by a specific group (not working)
I'm trying to mimic the Windows firewall to define rules by software.
So a software has access to internet only if started by a specific group. I can then create a .sh file for each program that I ...
-1
votes
1
answer
225
views
Connection closed by port 80 ubuntu
i have executed this code to copy a folder by my desk to my ubuntu instance
francesco@AirdiFrancesco ~ % scp /Users/francesco/Desktop/chimica [email protected]:/home/ubuntu
only that after this ...
2
votes
1
answer
293
views
How to tunnel all the traffic for one interface through another interface
I have two working interfaces on my ubuntu machine:
tun0 - OpenVPN server with the internal address of: 10.8.0.0/24
wg0 - WireGuard peer interface with the internal address of: 10.7.0.0/24 which is ...
0
votes
0
answers
286
views
How can I make my docker containers use my proxy?
I have two Ubuntu servers.
Machine A (Internet is heavily restricted)
Machine B
Also I have one Socks5 tunnel on machine A.
My Socks5 proxy command on machine A:
ssh -D 3080 -q -C -N -f root@Machine-...
0
votes
3
answers
3k
views
I want to deploy k8s 1.26 on ubuntu22.04, but apt install kubelet fails
I want to deploy k8s 1.26 on ubuntu22.04, but apt install kubelet fails
$ apt-get install kubelet kubeadm kubectl
You might want to run 'apt --fix-broken install' to correct these.
The following ...
0
votes
1
answer
6k
views
Problem with my iptables configuration on reboot
I tried many times to save the iptables configuration to have it start up automatically when I reboot my Raspberry Pi (Ubuntu 22.04.1 LTS) but when I look with this command:
$ sudo iptables -L
my ...
0
votes
0
answers
128
views
Make port 80 globally accessible
I am trying to set up a VPS server (Ubuntu 22.04 LTS) bought from Microsoft. I am able to set up NGINX on my own by watching this tutorial. After setting up all the configs stated in the video I ran ...
0
votes
0
answers
2k
views
can't initialize iptables table `filter': Table does not exist (do you need to insmod?) - iptables is not present
I am trying to install NGINX and Certificate by following this
enter link description here in WSL
But at the Step 5: Allow Nginx Traffic, I am getting error after the command sudo ufw allow 'nginx ...
2
votes
1
answer
3k
views
Ubuntu Server 22.10 on Virtualbox - host-only network and NAT can't coexist together?
I'm trying to create a Virtualbox VM (running Ubuntu Server 22.10) which has NAT (for internet access) and host-only adapter with static IP. It seems that I can get only one of both working. Optimally ...
2
votes
0
answers
320
views
redirect cloudflare port to my custom port in Ubuntu server
I use port 32147 on my server for tls packet, but because this port is not supported in the domain that is connected to the Cloudflare proxy, so i use one of the ports supported by Cloudflare (for ...
0
votes
0
answers
288
views
Port forwarding in Ubuntu 20.04 causes pings to fail
I'm trying to forward ssh port to connect my servers together. Something like this:
Local Machine === (ssh) ===> Server A === (ssh) ===> Server B
My Servers aren't in a same location. They're ...
0
votes
0
answers
928
views
Opening Ports in Ubuntu 22.04
I understand that this may seem simple enough and there are many tutorials out there, but I've tried almost everything. My goal is to open any port on my Ubuntu desktop (starting with 22 for ssh) and ...
2
votes
0
answers
198
views
iptabels firewall rules for INPUT while Tor traffic on lubuntu 22.04 LTS
i do have lubuntu 22.04 LTS and TOR daemon with the torrc config
VirtualAddrNetwork 10.192.0.0/10
AutomapHostsOnResolve 1
TransPort 9040
DNSPort 9053
and iptables rules
#exclude locals
TOR_EXCLUDE=&...
0
votes
2
answers
785
views
Generate iptables rules while connecting to VPN Server
I'm building a virtual Ubuntu Server(LXC on Proxmox) that shall act as router and tunnel some devices(e.g. AppleTV) of my local network through a VPN (expressVPN).
Connecting and routing to different ...
1
vote
1
answer
516
views
How to drop an existing connection on Ubuntu 20.04 server?
I executed the following command to ban them. But it didn't work. It only works when there is a new connection from that IP.
sudo ufw insert 1 deny from 46.1.67.244 to any && sudo ufw reload
...
0
votes
1
answer
600
views
iptables to block http and ssh in one direction
I have a topology where there is a Linux as a router that connects two Linux, and I want to use iptables to filter ssh and HTTP in one direction.
I used the below code but it didn't work!
I really ...
0
votes
0
answers
516
views
Forward OpenVPN traffic through server
Here's my setup:
------------------- ----------------------- -----------------------
| OpenVPN Client | | Ubuntu Server 22.04 | | Ubuntu Server 22.04 |
| Windows 10 |----->...
0
votes
0
answers
298
views
I need a secure method to access the internet over a hotel's open wi-fi (TOR proxy?)
I need to communicate securely over a hotels open wi-fi. I've read many articles and how-to's.
Using a TOR server/proxy sounds good. I can't access my bank, my email, etc. through the clear-text
...
0
votes
2
answers
1k
views
iptables -t nat seems not working properly
I'm working on Ubuntu 20.04.
I set the following iptables rules:
sudo iptables -t nat -A POSTROUTING -d 192.168.10.162 -j MASQUERADE
sudo iptables -t nat -A PREROUTING -p tcp --dport 445 -j DNAT --to-...
0
votes
0
answers
433
views
Port 3003 is not working while ports 3000 - 3002 are working fine
I have several node.js apps on an Ubuntu server working just fine on ports 3000 - 3002. Now I added one more app to port 3003 and it is not working anymore. I switched the apps on port 3002 and 3003 ...