Questions tagged [iptables]
Iptables is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel.
1,302
questions
-1
votes
0
answers
38
views
UDP 53 not working
I have a small issue. I have a virtual server with Ubuntu Server 20.04.6, and I've installed a DNS server on it. However, it doesn't respond on UDP port 53. It only responds if I use the command "...
0
votes
0
answers
19
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
49
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
21
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
16
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
53
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
73
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
145
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
74
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
104
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
31
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
87
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
100
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
453
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
25
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
112
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
50
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
74
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
42
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
75
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
86
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
211
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 ...
0
votes
0
answers
233
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
109
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
77
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
160
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
43
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
49
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
104
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
261
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
45
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
153
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
402
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
45
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
81
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
146
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
204
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
78
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
29
views
Ubuntu iptables
How to accept traffic coming from server1 to server 2 and route to internet from server 2
Server 1 doesn't have internet connection it should get routed from server 2
0
votes
0
answers
39
views
How to deny some commands from a specific IP address?
I was inspecting some browsers securities and while entering a game page my snort rules detected this.
It was something about an privilege escalation from this server. I don't want to block it, ...
0
votes
0
answers
690
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
49
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
49
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
248
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
136
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
332
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
0
answers
142
views
Ubuntu Server Port 443 closed, Docker application not accessible in local network
I am using Ubuntu Server Ubuntu 22.04.2 LTS in my homelab (esx Server) to test some docker applications. First of all I was testing Bitwarden, a webbased Password-Manger. Without any success. I could ...
0
votes
0
answers
116
views
Tried to block an ip address to my server and docker containers
I am running a docker server under Ubuntu 22.04.2 with several ip addresses and container.
In my log files i see that an external ip is trying to connect to a minecraft server, that runs in a docker ...
0
votes
1
answer
98
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
369
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 &...