Questions tagged [iptables]
Iptables is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel.
1,306
questions
0
votes
0
answers
10
views
Why tor need icmp in outbound iptables?
I'm trying to block everything in outbound except tor with iptables.
But without enabling icmp tor doesn't work, it's very strange since tor don't use icmp as my understanding.
That's what I'm using ...
0
votes
0
answers
60
views
Ubuntu 22.04 rsyslog "& stop" not stopping?
I want to log iptables messages in a separate log file, and not in /var/log/syslog.
I understand if you want to log something exclusively to a separate file, you make sure the syslog rules you want ...
0
votes
0
answers
26
views
Nginx configuration failure: iptables table does not exist
I tried to configure nginx on my Ubuntu system. During this process, I executed the command sudo ufw allow 'Nginx HTTP and I got an error:
WARN: initcaps
[Errno 2] iptables v1.8.7 (legacy): can't ...
0
votes
0
answers
487
views
"System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down" not WSL
When I install docker and try to run it, sudo systemctl start docker, it says it can't run as the title says.(Not WSL)
So when I run it with the sudo service docker start command, it turns off again ...
-1
votes
0
answers
26
views
Problem Running Iptables
I am having problem running ufw status. Its giving me iptables error showing iptables-present,use iptables-legacy to see them how can i fix this
I tried to update-alternatives --remove iptables /usr/...
-1
votes
0
answers
49
views
docker Wireguard port forwarding
I encountered a serious difficulty that I couldn't solve with AI. I want to have Wireguard, Pi-hole, and Nginx containers on my server. This part has been successfully resolved. However, I would also ...
0
votes
0
answers
60
views
Source address in iptables Masquerade/NAT
I'm trying to install OpenVpn on a remote Ubuntu 20 server and am following this tut. I'm able to step through it but cannot determine where this source address is in its example:
$ sudo iptables -t ...
0
votes
1
answer
56
views
ufw won't put custom rule in the correct place at reboot
My general issue is that I lose contact with my Ubuntu 23.10 on ssh once I close my ports using knockd. I would like for it to maintain existing connections.
I have a custom rule
> iptables -I ...
0
votes
0
answers
27
views
How to enable communication between 'software' netplan configured vlans
I have searched far and wide so I if it looks like I have no idea what i'm doing, that is because it is a correct assumpstion. Usually we do this ourselves with our MikroTik router setup. We have a ...
1
vote
1
answer
49
views
Permanent iptables redirect
I have an iptables command I run on Ubuntu 22.04.3 that forwards 443 to 8443. However I have to keep running it every reboot.
sudo iptables -A PREROUTING -t nat -p tcp --dport 443 -j REDIRECT --to-...
1
vote
0
answers
86
views
Clients got IP-addresses from DHCP but can't reach Internet
I'm trying to build home router from device with two ethernet ports (enp2s0 and enp3s0) and WiFI (wlo2), based on Ubuntu Server 22.
Everything is set, clients can connect via wifi to the router (it's ...
0
votes
2
answers
388
views
Route traffic on different ports through different network interfaces
My situation is this: I’m setting up a server running at home (Ubuntu Desktop 22.04.3 LTS) to run an email server and a few other online services. As we all know, for my email to work reliably and not ...
0
votes
0
answers
42
views
Checking this network connection (port forwarding)
I have the below setup, I want to be be able to reach the device (192.168.2.180 eth) from my desktop (192.168.1.3 wifi) I have a linux server in the middle (192.168.1.111 WIFI), (192.168.2.22 Eth)
...
3
votes
3
answers
251
views
Having issues locking down public server with iptables
I'm rather new to Ubuntu. I'm trying to lock it down to where I have complete access to it from my ip address and everyone else only has access to port 80 and 443.
To better understand it, I put my ...
0
votes
0
answers
65
views
Still getting [UFW BLOCK], which rules apply?
I still get a message UFW BLOCKED:
Dec 22 05:12:41 ge-domoticz kernel: [5324365.003868] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:a1:7b:8b:38:1f:8d:e9:e4:9f:08:00:45:00:00:28:92:8c:00:00:ff:06:2f:d4 SRC=...
0
votes
1
answer
153
views
Port Forward for LAN
I bought a server and have Ubuntu 22.04 installed.
When I run various Github projects like Text Generation Webui, Automatic1111 Stable Diffusion, etc., how do I forward the port to access it from my ...
0
votes
0
answers
132
views
Logging iptables Ubuntu 22.04
I used this configuration for my server:
iptables -F
iptables -A INPUT -j ACCEPT
iptables -A OUTPUT -j ACCEPT
iptables -A FORWARD -j ACCEPT
iptables -A INPUT -j LOG
iptables -A OUTPUT -j LOG
iptables -...
0
votes
0
answers
264
views
Ubuntu 22.04 iptables command not working
I posted this same question in another SE forum, later felt this forum is more appropriate considering the Linux Distro I am dealing with.
Totally new to netfilter thing, currently am running an ...
0
votes
0
answers
44
views
How to simulate a NAT network in Ubuntu host with iptables and iproute2?
I want to simulate NAT network mode of virtual machines without using any vm-specific tools. The detailed goals are the following:
The VMs have internal network IP 10.8.20.0/24
The physical nic eno1 ...
0
votes
0
answers
20
views
I'm attempting to execute a Flask test file, but when attempting to access it through the browser, an error stating that the site cannot be reached
I have tried creating an inbound rule in my firewall to allow port <5000> but its still showing site cannot be reached.
i have also tried to Check UFW (Uncomplicated Firewall) with this command
'...
0
votes
0
answers
71
views
nslookup works but network no
System information:
ubuntu server CLI only 22.04.3 LTS.
Kernel 5.15.0-88-generic
I'm using zerotier network to connect to my server. Everything worked fine and then maybe I changed something, maybe no,...
0
votes
0
answers
224
views
Setting up a reverse proxy on home lab
I'm very new to Linux and bash. I'm working on a homelab (machine a) project.
My ultimate goal is to set up Nginx on my server and connect externally (machine c) to Docker apps File Browser, possibly ...
4
votes
1
answer
419
views
I can't connect to Ubuntu server from local network, but can from outside
This is a weird one that has been driving me crazy for a while. I just can't work it out.
I'm running Ubuntu 22.04 (with all latest patches) on a Dell PowerEdge-r710 server. It's hosting a variety of ...
0
votes
1
answer
299
views
Ubuntu Router configuration with UFW
Going down the ubuntu 20.04 server route and using UFW.
Steps so far (from a clean install)
Network Layout attached
networking configured with netplan - YAML file below - question here is do I need ...
1
vote
1
answer
136
views
BIND9 on Ubuntu 20 - Cannot configure Zone to work properly
I installed it on Ubunto 20 and configured two zones
Options config file
acl internal {
localhost;
localnets;
192.168.70.0/24;
10.200.157.0/24;
};
options {
...
0
votes
0
answers
112
views
Restrict access to Docker container port to ip adresses
There are several docker containers on my server, exposing ports. Now I try to restrict the access to the ports to IP-Adresses being able to insert rules without allowing the policy. I apply IP-Tables ...
0
votes
0
answers
237
views
Use TPROXY feature of iptables with Ubuntu 22.04
I'm trying to use the TPROXY feature of iptables.
For example :
iptables -A PREROUTING -t mangle -p tcp -i eth0 -j TPROXY --on-port 5000 --tproxy-mark 1
This feature works perfectly on Ubuntu 16.04 (...
0
votes
1
answer
259
views
Iptables TCP NEW state vs TCP flags in Ubuntu 22.04
I would like to double check what is the behaviour of NEW state in TCP connections in iptables (Ubuntu 22.04).
Does it only accept SYN=1 and ACK=0/FIN=0/RST=0 in tcp flags?
More detailed example - let'...
0
votes
1
answer
1k
views
Ubuntu 22.04 as a router. 2 LAN (LAN with Internet + LAN with AP). AP network do not see IP addresses from first network
it's been a while when I setup similar config... that's why I'm a bit confused.
So I have box with Ubuntu 22.04 with two LAN cards. My network looks like that.
ROUTER [192.168.88.1/24]:
UBUNTU BOX [...
0
votes
0
answers
51
views
Automatically created iptables rules created by Docker seem strange
Here are the rules that I don't understand (those are created automatically by docker on my ubuntu machine):
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT
-A FORWARD -i docker0 -o docker0 -j ACCEPT
So ...
0
votes
0
answers
204
views
UFW allow all IP from ASN
How to allow access to ubuntu with UFW firewall for all addresses belonging to one ICT provider with its ASN number (Is it possible?)?
0
votes
0
answers
82
views
Simulate an NVA Appliance in Azure that forwards traffic with an Ubuntu VM
In Azure, I have 3 VirtualNetworks, A, B and C. A and B are peered to C.
I have an Ubuntu VM in all 3 of them.
I would like to have the VMs in VirtualNetworks A and B, be able to talk to one another ...
0
votes
1
answer
122
views
Port Forwarding to another machine Rust gameserver
I need to forward UDP port 28015 of my local machine to another machine with port UDP 28021. Rust Game Server. (Redirect incoming traffic on a specific port to a different IP address with altern port)
...
0
votes
0
answers
46
views
Port Forwarding to vboxnet0 with saving client's real IP
I set up the internet on a virtual machine that is running through VirtualBox and set up port forwarding. First, in rt_tables of Host Machine (iproutes2) I added this:
100 vm0
Then I run this:
ip ...
1
vote
1
answer
99
views
Unable to establish network route
I am struggling to establish a network route from my laptop to another device. I will admit that my networking background is lacking, so sorry for the ignorance. I have the following setup:
[Device-A] ...
0
votes
0
answers
164
views
Route traffic from VPN to web proxy
I'm struggling for days to do this:
I've got an Openvpn installed on a ubuntu server, I want this traffic to be routed to a web proxy (socks5), so it will look like this :
Device->VPN->Proxy->...
1
vote
1
answer
439
views
How to unblock my IP from Ubuntu Server 22.04?
Here is the output of iptables -L -v in Ubuntu 22.04:
https://pastebin.ubuntu.com/p/47ysNrXCcN/
Chain DENYIN (1 references)
pkts bytes target prot opt in out source ...
1
vote
0
answers
542
views
wireguard + ufw = unable to limit access to specific port
So I'm trying to limit access to port 5432 (postgres) by using ufw and unable to do so. The connection is allowed still
sudo ufw deny 5432/tcp
sudo ufw route deny in on wg0 from 10.0.10.2
root@vpn-...
0
votes
0
answers
378
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
109
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
269
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
65
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
51
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
205
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
561
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
68
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
259
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
698
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
47
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
91
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 ...