date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,626,650,735,000
I have configured Postgres to accept network connections from anywhere: In pg_hga.conf: host all all 0.0.0.0/0 md5 In postgresql.conf: listen_addresses = '*' I can see the server is listening: vagrant@vagrant-ubuntu-trusty-64:~$ sudo netstat -ntlp Active Internet connections (on...
The network adapter of your VM is by default in NAT mode. This means you can't ssh/telnet/etc to you VM from outside of it. Switch to Bridged in the VM settings and it should work.
Basic Hosting Postgresql in Virtualbox + Ubuntu 14.04
1,626,650,735,000
I am configuring a remote CentOS 7 webapp server to wrap https and ssh inside OpenVPN, while keeping smtp running outside of OpenVPN. I notice that, when I establish an OpenVPN connection from a Windows 7 Client using SecurePoint, I am only able to successfully connect to https : / / 10.8.0.1 and to ssh [email prote...
You haven't added your tun0 device to any zone, so it defaults to the default zone, which in your case is the public zone. As root, run: firewall-cmd --zone=internal --add-interface=tun0 You can then leave ssh and https enabled in the internal zone and disable it in the public zone.
firewalld settings for OpenVPN with https, ssh, and smtp
1,626,650,735,000
I am new to virt-manager. After having configured a virtual network (new interface virbr0) with 2 VMs that should be able to communicate, I discovered that most ports are filtered. For example, the two nodes are mutually reachable via port 22, but for other ports, for example higher than 9000, I get a no route to hos...
If you cannot reach another VM there are two possibilities: The target system blocks the connection with Netfilter (iptables). libvirt itself blocks on the virtualized LAN (not meaning VLAN), see http://libvirt.org/formatnwfilter.html In your case it should be a Netfilter problem. You can be sure about that by runni...
libvirtd and filtered ports
1,626,650,735,000
iptables -A FORWARD -s 192.168.20.7 -d 10.10.48.3 -p tcp --dport 25 -o eth1 -j ACCEPT iptables -A FORWARD -s 10.10.48.3 -d 192.168.20.7 -p tcp --sport 25 -i eth1 -j ACCEPT Tuning the firewall of my organization I found these two lines which confused me. The eth1 interface is connected to the 10.10.x.x network, so... ...
Based on the man page for iptables I'd be inclined to agree with your assessment as well. [!] -i, --in-interface name Name of an interface via which a packet was received (only for packets entering the INPUT, FORWARD and PREROUTING chains). When the "!" argument is used before the interfa...
Does -o and -i make sense when the target host is already connected to the interface specified?
1,368,615,668,000
I have a linux webhosting server which attracts DDOS attacks. I want to use Cisco ASA 5500 Series Adaptive Security Appliances to protect the linux server from them. I know there are many factors should you know before you choose the suitable hardware firewall like the amount of this DDOS and pps ..etc Please suggest ...
Let's step back a bit... DDoS attacks involve hundreds or thousands of zombie machines on the internet that send traffic at your machine (usually faster than the server OR your ISP uplinks can process). The important piece here is that thousands of zombies sending traffic at your machine can consume 50Mpbs or a lot mo...
Linux tools to choose suitable Cisco ASA 5500
1,368,615,668,000
I am using the Cloudflare IPv4 and IPv6 lists to block all connections to my server from any IP that is not owned by Cloudflare. When I run sudo ufw status on the server I get: Status: active To Action From -- ------ ---- 80,443/tcp ALLOW ...
The problem was that Docker opens exposed ports but they are not shown in UFW. Sorry I didn't mention Docker. I couldn't image it was related to it. See this thread: https://serverfault.com/questions/962012/ufw-not-blocking-incoming-traffic
UFW not blocking connection
1,368,615,668,000
192.168.100.50 is connected to 192.168.178.20 over the internet via wg0 interface. wg0 is opening up the tunnel 10.102.242.1/24. The wireguard client interface has 10.102.242.2. Through a static route on 192.168.100.1 I can connect from any device in 192.168.100.0/24 to the wireguard client using ssh [email protected]...
Some more testing brought my attention to the fact that I need to include the other remote subnet into the forwarding rule: ufw route allow in on eth0 out on wg0 to 192.168.178.0/24 Voilá!
Why is UFW blocking acces to SSH via Wireguard?
1,368,615,668,000
I have a Linux machine with ufw firewall, a program runs WS-Discovery that works as intended when ufw is disabled but fails to return anything when it is enabled, what I tried without success: Enabling outgoing traffic sudo ufw default allow outgoing Allowing both 3702/udp and 1900/udp What am I missing here?
I found couple of solutions: The first one using ipset as detailed in this answer to Stateful matching of multicast responses in iptables; replace 1900 with 3702 as that's the port used for WS-discovery. The second one which I used, is to allow incoming packets whose source port is 3702; with ufw you do it like this...
How to allow packets for WS-Discovery (onvif)?
1,368,615,668,000
I don't have direct control over the firewall. I'm trying to troubleshoot a connection to a SFTP site from a Unix machine. Pinging the host results in a timeout, and nmap is telling me the host may be down (although it is not). I suspect the outbound connection is being blocked by firewall settings - how can I confirm...
Not much info, but here a guideline i would follow to debug this kind of issue if not in control of the firewall: Ping won't help, ICMP is a protocol that could be blocked as well somewhere/somehow along the path. Make a test using a different connection if applicable. Make a test connecting to other SSH/SFTP site. E...
Need to determine if firewall is blocking an outbound connection
1,572,647,506,000
There are a lot of network-related settings in /etc/sysctl.conf and a number of files in /etc/sysctl.d/. My data centre operator who has preconfigured the Ubuntu OS to work best in their environment has also added a custom file in there. I guess they come in a good state with the OS and I only need to make changes the...
Here's a partial answer about what I found out so far. Reading the source code of UFW, I found it just loads in the settings from its own config file when UFW starts. This means that at this point, it will add all settings from that file to the already existing configuration. This will override just the values that ar...
Why does UFW use a different sysctl.conf file?
1,572,647,506,000
I am attempting to use ebtables to match a specific VLAN ID (non zero) along with a specific VLAN PCP value. I tried the following: ebtables -A FORWARD -p 0x8100 --vlan-id 5 --vlan-prio 3 -j DROP Ebtables does not complain (as the check has been commented out in ebtables), but the rule reported back using "ebtables -L...
The explanation isn't really making sense, but here it is in the kernel at linux/net/bridge/netfilter/ebt_vlan.c: if (GET_BITMASK(EBT_VLAN_ID)) { if (!!info->id) { /* if id!=0 => check vid range */ if (info->id > VLAN_N_VID) { pr_debug("id %d is out of range (1-4096)\n", ...
Matching vlan id and priority with ebtables
1,572,647,506,000
I need to add this 81.212.0.0/14 ip range to ipset. But it doesnt calculate lower than /16. I want to add from 81.212.0.0 to 81.215.255.255 IP addresses. Is there any other way but /14. Im trying to allow connections from a specific IP range. What I tried: ipset -A allowiplist 81.212.0.0/14 What I expected: That sh...
I think the problem is 81.212.0.0/14 have bigger IP count than 65535, maybe idk. You may be exactly correct here. If you are using an IPset of type hash, it has a maximal number of elements it can store, settable by the maxelem parameter when creating the IPset... and the default value for maxelem is 65536. And if y...
ipset How to add IP range from x to y
1,572,647,506,000
I created a bridge named eth2 with the interface gre1 between 2 virtual machines VM1 and VM2. The following is VM1 with bridge device eth2. # brctl show bridge name bridge id STP enabled interfaces eth2 8000.162f8564eb74 no gre1 The interface IP of VM1 is 172.80.1....
I set the policy to accepted for my gre tunnel interface gre1. iptables -I INPUT -p gre -j ACCEPT This helped me to get it working.
Starting iptables stops communication between two virtual machines connected by a bridge
1,572,647,506,000
I have three virtual machines: A, B and C, all of them are running on debian. I have set up C to route traffic between A and B. Also C has two interfaces: enp0s3 and enp0s8, not sure if it's important in this case. The routing works fine. But now I want to set up iptables on the router to block all incoming requests e...
iptables -A FORWARD -p tcp --dport 8080 -j ACCEPT This rule will allow forwarding of all packets going to port 8080 However packets from port 8080 (Responses to the SYN Packet) are not forwarded unless the port making the request is also port 8080. As mentioned in one comment this is most likely not the case! You wou...
debian - iptables doesn't work for allowing one specific port
1,572,647,506,000
I found something weird in my debian 9 config. I changed my hostname by editing /etc/hostname and rebooting from "myhost" to "myhost-hello". Since this modification connecting to the machine via it's ip (I don't use WINS or other functions like that at all) shows the server not reacheable. I said myself.. maybe it's s...
Seems that the error got solved editing also the /etc/hosts making the machine able to understand that the hostname must be searched locally instead being passed via the default gateway. So.. TL;DR: /etc/hosts edit the line myhost 127.0.0.1 for example to myhost-hello 127.0.0.1 ... that's all
Changing system hostname makes samba being unaccessible
1,464,869,156,000
My router currently provides the NAT to all the PCs and the Ubuntu desktop (with some server functions) in the network. I want to use the Ubuntu system as a proper firewall, but it only has one Ethernet interface. As such, I envision the following to get it running: Ubuntu/firewall router/WAN DHCP I...
I've accomplished what I've described in the question. Here's the Ubuntu configuration that allowed me to do so: $ sudoedit /etc/network/interfaces auto eth0 iface eth0 inet static address 192.168.0.10 netmask 255.255.255.0 gateway 192.168.0.1 (Actually br0 in my files, from bridging VM to ph...
Route incoming and outgoing on same interface
1,464,869,156,000
This is about a cPanel server which, like most servers, is under constant attack from lands afar. Considering that I only host to clients in the US and Canada, there is less of a reason to allow full access to Asia and South America, among other areas. Too many firewall rules can increase latency, or worse, crash your...
Alright, I've not gotten any good responses and it took trial and error, as well as monitoring to determine what works to achieve this. I found some things were said to be needed, so the example up above might not work on all systems because a full path should be used on the executables. Also, when specifying a range ...
Using IPTables to Block Ports to Class A Subnets While Allowing Web Ports (80/443)
1,464,869,156,000
I set up my Pi 2 as a wifi access point following this tutorial. I'd like to implement a rudimentary QoS, according to the DSCP field in every packet's header. That means, blocking packets using low priority services (for connected hosts sending, e.g., emails) and forwarding packets with high priority services (for co...
libnetfilter_queue library from netfilter project seems the way: from netfilter.org: libnetfilter_queue is a userspace library providing an API to packets that have been queued by the kernel packet filter. It is is part of a system that deprecates the old ip_queue / libipq mechanism. I put packets in a queue wit...
Blocking or forwarding packets as access point
1,464,869,156,000
I'm having a discussion with a software developer in my nears. He is using MySql direct connections for a software. There is no PHP/SSH/whatever-Bridge involved for the communication, neither at startup, while running or before logging out. The software goes from account login to management and so on. As you may know,...
I don't know which OS platform & version you are using But TCP Wrappers can help Edit your /etc/hosts.allow file #first Allow all local connections ALL: 127.0.0.1 #allow ssh Access to IPs this is important as you need to allow some users to login via ssh sshd: 1.1.1.1 sshd: 2.2.2.2 #change above Ips to your need t...
Linux firewall techniques: MySql-Account
1,464,869,156,000
I have a unique situation. Let's say my webserver ( e.g. 10.0.0.2) is connected to eth0 of my firewall (gw 10.0.0.1). A local network (192.168.0.0/24) is also connected to eth1 (192.168.0.1/24) of my firewall. Now I want to allow traffic from web server initialized from internal network. How should I use iptables comm...
You can try adding the following rules to your iptables firewall: $ sudo iptables -A INPUT -p tcp --dport 80 -s 192.168.0.0/24 -m state \ --state NEW,ESTABLISHED -j ACCEPT $ sudo iptables -A OUTPUT -p tcp --sport 80 -d 192.168.0.0/24 -m state \ --state ESTABLISHED -j ACCEPT
Allowing web server communication in Linux firewall
1,464,869,156,000
I have two ethernet interfaces, namely eth0 and eth1. I want to implement an advanced routing rule but I am totally new to firewall/routing rules in CentOS. Here is what I am trying to do: Both my interfaces are up and connected to internet. I want to be able to decide dynamically based on the type of traffic through ...
This Advanced Routing & Traffic Control HOWTO should have what you need. Once you setup your networks, you'll want to write some rules that will mark packets to go over the alternate connection in iptables (see Chapter 11 Netfilter & iproute - marking packets).
Firewall/routing rule in Centos for this setup
1,350,977,846,000
I have a problem with my nftables setup. I have two tables, each one has a chain with the same hook but a different name and priority. The tables are in different files which are loaded by an include argument. Because of the priority, I would think that the VPN-POSTROUTING chain will be executed before the INTERNET ch...
Historically there used to be one NAT chain in a given hook (prerouting, input, output, ...). Executing a nat statement or simply accept-ing the packet being terminal for the chain, with a single chain it was also ending treatment within the hook. With nftables allowing to use more than one chain in the same hook, ter...
nftables table and chain priority
1,350,977,846,000
I have a machine where I can connect it using ssh from different networks. But when I have moved to other country I have not be able to connect it. What may be the cause? I am able to ping the server but I get an error time out trying to do an ssh connection. UPDATE 1: Traceroute 1 1 ms 1 ms 1 ms <ip> ...
This sounds like a firewall problem to me. Try using ssh with the -v flag for debugging output. This will give you a better clue as to what the problem may be. Also try to telnet to your ssh server on port 22 like this: telnet yourserver 22 You should get a response back with the ssh version number.
Connection Timeout for ssh connection depending to the ip location?
1,350,977,846,000
I'm new to ufw, and followed this link and entered exact command as instructed. ufw allow ssh 2222 Since my SSH is 2222, I want to add that rule in, but I kept getting ERROR: Need 'to' or 'from' clause Any hints for me ? I don't want to get lock out.
The ufw man says: Example rules using the simple syntax: ufw allow 53 This rule will allow tcp and udp port 53 to any address on this host. To specify a protocol, append '/protocol' to the port. For example: ufw allow 25/tcp This will allow tcp port 25 to any address on this host. ufw will also check /...
UFW - Allow SSH in custom port
1,350,977,846,000
I have read all the man pages related to firewalld and also explored all of the files that come pre-installed in firewalld before it is configured. How can I configure the zones of the firewall to provide maximal security for a private web application? Here is the use case: 1.) Twenty known users will have http/ht...
You should also check out this page on the Fedora Wiki. I think you will want to use the drop zone because it's the most strict way. create an advanced rule so that you can connect from your ip to port 22 (or your different ssh port) with firewall-cmd ---permanent -zone=home --add-forward-port=port=22:proto=tcp:toadd...
CentOS 7 Firewalld zone configuration for private web application
1,350,977,846,000
A newer server admin tried to set me up to authenticate SSH using a public key. It wasn't configured correctly, and SSH kept asking me for password (and he kept telling me to hit enter). Unexpectedly, I am no longer able to connect to the server at all on any port. (It is a public web server.) I spoke to the more se...
After doing a lot of detective work and finally checking the list of running services more carefully: systemctl list-units --type=service --all | grep running I found that lfd.service (ConfigServer Firewall & Security - lfd) was running (not being a Linux sysadmin, I didn't know anything about it), and this turned ou...
After SSH authentication failures (Centos 7) something blocked my IP
1,350,977,846,000
I have a server that receives its IP address by DHCP. This seems to work and the connectivity is working (at the moment). However, I have not rebooted since installing a new /etc/sysconfig/iptables file so I could lose big upon the next reboot in case DHCP functionality depends on the connections now blocked. I have...
The consequence of blocking that access is that your DHCP client will not be able to renew it's IP address lease until it expires. When the lease expires and the client still cannot reach the DHCP server by unicast, the DHCP client will unconfigure the current IP address, and then will start the DHCP request process f...
Consequence of blocking outgoing UDP 68->67 (DHCP client)?
1,350,977,846,000
I have two computers, one is running Debian GNU/Linux 9 and the other Ubuntu 18.04.1 LTS. I have installed openssh on both computers. sudo apt install openssh-client sudo apt install openssh-server Now, I am able to use ssh to connect from Debian to Ubuntu, but not from Ubuntu to Debian. On the Debian computer nmap...
You have a NAT firewall between your two machines. You can see this because your Debian system's IP address is 192.168.0.24 but the Ubuntu system sees the associated inbound connection coming from 10.20.81.24. Unless you control and manage this NAT firewall, it will be impossible for you to connect directly from your ...
ssh works only one way
1,350,977,846,000
I am trying to only allow SSH incoming and outgoings on my firewall, but the problem is that FTP can also be used even though I DROP at the end of the script # Incoming SSH $iptables -A INPUT -p tcp --dport ssh -j ACCEPT # Outgoing SSH $iptables -A OUTPUT -p tcp --dport ssh -j ACCEPT The way I DROP is by: iptables -...
The first line of each of your INPUT and OUTPUT chains accepts everything. You can remove them with these two commands iptables -D INPUT 1 iptables -D OUTPUT 1 But be sure you will still have access (ideally physically at the console) before running them. Now you've provided your script it's possible to suggest alte...
Only allow SSH incoming and outgoing
1,350,977,846,000
I want to make a bunch of websites unaccessible on my computer. My hosts.allow file: sendmail: all # /etc/hosts.allow: list of hosts that are allowed to access the system. # See the manual pages hosts_access(5) and hosts_options(5). # # Example: ALL: LOCAL @some_netgroup # ALL: .foobar...
hosts.deny is for servers, not clients running on your computer therefore you can't block websites with it. I suggest reading the hosts_access(5) man page for your system (Debian version, FreeBSD version). By the way, there's a proposal by Lennart Poettering to get rid of tcpwrappers/tcpd in Fedora and OpenSSH will do...
Linux hosts.deny settings are not applied
1,350,977,846,000
I'd like to establish a connection between my client and raspbian. Within my network, I can connect to my service at any time without any problems. Now I want to connect to my service via the internet. This is unfortunately not working when I try to use my internet ip for the connection. client = new MqttClient("tcp:...
"Is there anything else I have to configure?" Your router, perhaps. You really have not provided enough information to provide a definitive answer, all you've done is point out is not because of iptables...perhaps. Iptables rules are processed in order. If that was the last rule appended (-A) and is last in the li...
Socket Connection Refused (raspbian) but ports are open for connections
1,350,977,846,000
Using the terminal I was wondering if it would be possible to see a list of all the active firewalls on a particular system that I have shelled into. I want to be able to see which ports are active pertaining to each firewall, so that I can change the restrictions.
You could scan your localhost for open ports using a tool like nmap. nmap -v -sT localhost nmap can be built from source or installed from the repo of most (if not all) major distros.
How To See Which Ports Are Open On A Particular Firewall
1,350,977,846,000
Currently I'm updating my iptables rules using a bash script, where I call the command: iptables -F then I apply the rules. The problem being that I need to update the rules to gain access to port 80, then I drop everything, in a cron job every 10 minutes. So every 10 minutes I call iptables -F to delete old rules an...
If there are specific rules that need to be updated regularly, I would put them in a separate chain, calling that chain from INPUT in an appropriate slot iptables -N mychain # Create new chain "mychain" iptables -A INPUT mychain # Insert it into INPUT iptables -A INPUT …other rules… # Append...
How to update, instead of flush and re-write, iptables rules
1,350,977,846,000
I am trying to run the following nft commands: nft add table netdev filter nft -- add chain netdev filter input { type filter hook ingress device vlan100 priority -500 \; policy accept \; } nft add rule netdev filter input ip daddr 198.18.0.0/24 udp dport 1234 counter drop However, when I try to run the second comman...
In the nftables wiki, the netdev family is described like this: The netdev family is different from the others in that it is used to create base chains attached to a single network interface. Such base chains see all network traffic on the specified interface, with no assumptions about L2 or L3 protocols. "No assump...
nftables refuses to add chain
1,350,977,846,000
We have RedHat 8 server. Firewalld is active. I need to connect to port 5050 from my lap top and from the second server, so I added it to the rules iptables -I INPUT -p tcp -m tcp --dport 5050 -j ACCEPT service iptables save When trying to connect from second server: telnet 10.244.176.1 5050 Trying 10.244.176.1... te...
If you're using firewalld, why not add the rule to firewalld instead of iptables? You can list the different zones in your firewalld configuration like this: firewall-cmd --get-zones If you want to see the rule sets for all zones: firewall-cmd --list-all-zones If you want to see the rule sets for a specific zone: fire...
Firewall is active, added port to iptables but still cannot connect
1,350,977,846,000
Something is unclear to me about inbound traffic and firewalls. My first assumption is that a firewall - say for a home router - should block all inbound ports. If you don't block all inbound ports, then surely hackers on the Internet can send packets to the devices on your network? But if all inbound ports are blocke...
The term firewall is loosely defined. My answer to your question is that not all firewalls are stateful. However, I might use the term "packet filter firewall", to describe one type of stateless firewall. For a stateless firewall, there is still a lot of protection that can be achieved but not as much as a stateful ...
How does inbound port blocking work on a firewall?
1,350,977,846,000
I'm trying to block only outbound connections to specific IP addresses, however I want to allow inbound connections from the same IP addresses. From what I understand about blocking outbound connections, they shouldn't block if an inbound connection has been made successfully. I basically set up rules like this: --app...
You are nearly there with your attempted firewall rules. Here's what you need to allow inbound traffic from host 10.10.10.10 while stopping outbound traffic to that address: Allow inbound (presumably to any port) Allow outbound replies to established inbound connections Block remaining outbound traffic So, iptables ...
Iptables outbound block denies inbound
1,350,977,846,000
I'm trying to audit firewall rules on a host. This is typically pretty straightforward to do with nmap or a similar scanning tool. The problem is that I can only run the audit on the host itself. Normally, if you run a port scan with nmap against the current host, nmap will use the loopback interface. This is a pr...
The problem is that the Linux routing tables always route traffic locally through the loopback interface and do not put it on the physical network if the local system has a network interface listening for the destination IP address. You can see the local routing table with ip route show table local - all packets matc...
How can I port scan a host from itself without using the loopback interface?
1,350,977,846,000
I've added a new service in my CentOS server using the following command: firewall-cmd --permanent --add-service=wiremock sudo firewall-cmd --reload then I've removed it through firewall-cmd --permanent --remove-service=wiremock sudo firewall-cmd --reload when I do firewall-cmd --get-services, I can still the servic...
The man page is a bit vague about these options, but the --add-service and --remove-service options are actually used to enable or disable a specific firewalld service. See the Fedora Wiki page for clearer examples. On the other hand, the --get-services option returns a list of firewalld services predefined on that pa...
Cannot remove a firewall service previously created
1,350,977,846,000
On remote server, the iscsi service listens on port 3260. What determines the local port used on the iscsi client ? I am using the open-iscsi package, and the /usr/sbin/iscsid as client. In the example below, can see with netstat -ptn, that my client (1.2.3.4) listens on port 38770: tcp 0 0 1.2.3.4:38770 1.2.3.5:3260...
Is this port completely random, or can it be specified somewhere on the client side ? All TCP/UDP connections work by picking a random port for the client (while the server has a well-known port). You don't get to specify the port, the OS picks it for you (though possibly the client can work around that, if you add ...
iscsid: iscsi client local port
1,350,977,846,000
I have a server with a docker and a UFW firewall (I know it might have conflit because docker open some port despite UFW rules) but: When I telnet this server from outside on a random closed port, Telnet stay in "Trying..." instead of sending a "Refused connection" If I go to the server and do the same with telnet 127...
Many firewalls will "stealth" a port rather than actually "close" it. What this means is, rather than affirmatively sending back a "Connection Refused", it will instead waste the client's time making it think it will get a response back before its own timeout. In this way, the thinking goes, a potential attacker's p...
Telnet to a closed port does not reply connnection refused
1,350,977,846,000
I'm trying to install naxsi on ubuntu 18.x. After googling and trying I found: nginx-naxsi is no more available for ubuntu, so you have to compile by yourserlf. Well to understand which module and setup I've installed apt install nginx-extras then nginx -V and I found this: nginx version: nginx/1.14.0 (Ubuntu) ...
Your options when compiling are being interpreted as commands, which is why it is saying command not found. Most likely you are not escaping a newline, so the shell thinks the option on the next line is a command to run. This newline in your example is not escaped properly: ./configure --conf-path=/etc/nginx/nginx.con...
compile nginx and naxsi on ubuntu 18.x
1,350,977,846,000
I have installed ejabberd on a new installation of Ubuntu 16.04 on digitalocean cloud and am able to connect to it from pidgin from my local machine without configuring any firewall rules. Curious to see the ports open I did nmap <ip_address> PORT STATE SERVICE 22/tcp open ssh 5222/tcp open xmpp-client 5269/t...
Your misunderstanding is this: If there is no configuration for Netfilter (iptables) then everything is allowed. The default policy for all chains is ACCEPT.
Ubuntu ports open but iptables rules are empty
1,350,977,846,000
I opened up port 8887 on a server that had it disabled using ufw allow 8887/tcp. I'm not trying to close it again. I used ufw status numbered to get a list of rules and then ufw delete <NUMBER>. The problem is that I can still see the web portal on port 8887 when I'm expecting it to be closed. When I run ufw status I...
This might have been caused by the fact that I was using a pre-configured droplet from Digital Ocean labeled Ubuntu 16.04 with Docker pre-installed. One of the aspects setup was firewall which allows 2 ports needed by Docker Swarm and 22 for ssh. I'm thinking when I tried to setup my own firewall settings on the node ...
UFW Firewall not working? [closed]
1,350,977,846,000
I get unintuitive results from "nmap -A " which I want to clarify. Setup: sshd (ssh deamon service) is successfully running. postfix is installed and so smpt service is running. However, it only configured to send mail, not to receive. apache not installed, iptables empty, ufw not installed. From this primary nmap do...
These are common ports blocked by internet service providers. It is impossible to tell if that is your issue from the information provided but 25 is often blocked to limit open spam relays. 135, 139 and 445 are often blocked to protect customers with unintentionally open file shares which used to be very common. In t...
nmap "filtered" results on a pretty naked server - could "filtered" just mean "silence"?
1,350,977,846,000
So I'm trying to get Vuurmuur installed on a headless linux box that I've been using as a home router. So far, I've been using iptables but wanted to switch to using something more convenient/easier to use. SERVER SETUP I'm running: Ubuntu 16.04.3 LTS Xenial 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 20...
So turns out their are two options: Option 1 Run the vuurmuur command with the below option: -t Option 2 (what I did) Use the 0.8rc5 version from the Vuurmuur website and I was able to start Vuurmuur.
How to resolve "no connection tracking support in the kernel" in Vuurmuur?
1,350,977,846,000
I want to block the user to start the firewall on Linux machines so I want to use mask on servers as the following: systemctl mask firewalld regarding that, I have few questions. I see that when mask the firewall service its creates a symbolic link of the firewall.service to /dev/null, thus disabling the service. So...
As I understand the question, the users you are talking about have root access (since they can unmask a service). In this case there's nothing you can do. If you want your users not to enable a service, don't give them privileged access. About your first point, the firewalld service is defined in /usr/lib/systemd/syst...
linux redhat 7 ( or centos 7 ) + firewalld mask the firewall
1,350,977,846,000
What is the elegant way to verify if firewall is stop/inactive on redhat 7 machines? example: we stop the firewall: systemctl status firewalld.service and my approach to verify the firewall status is like this: systemctl status firewalld.service ● firewalld.service - firewalld - dynamic firewall daemon Loaded: lo...
RHEL 7 introduces a command firewall-cmd to work with firewall. But the catch is it requires root access. If you are running your script as root, then you can use the following code: if [[ `firewall-cmd --state` = running ]] then firewall_status=active else firewall_status=inactive fi But if you are not runni...
how to check if firewall is stopped on redhat 7
1,350,977,846,000
I am trying to allow an IPv6 address connect to a certain IP on my server but not the others. The following is not working with ip6tables but it does work with just plain iptables. When I remove -d xx.xx.xx.77 from the ip6tables command it will work however, that will allow this ip6 address to connect to any IP on the...
IPv6 can not connect to an IPv4. in ip6tables everything needs to be ipv6
ip6tables will not accept -d destination but iptables will
1,350,977,846,000
I know I can use iptables -A INPUT -p tcp --syn -m limit --limit 1/s -j ACCEPT in order to limit the acceptance of tcp syn packets. So if the tcp synpackets doesn't cross this rate, they will jump to ACCEPT. Is there a way to write this rule in the opposite direction? I want to write rules as following: If ok (doesn't...
I just realised a simple solution: iptables -A INPUT -p tcp --syn -m limit --limit 1/s -j ACCEPT iptables -A INPUT -p tcp --syn -j DROP Continue to do whatever I want
Using iptables '-m limit' in the opposite direction
1,350,977,846,000
Objective Given the following interfaces on a Raspberry Pi: eth0 (192.168.0.0/24) - Private network (i.e. NAT) wlan0 (192.168.10.0/24) - Public network with Internet access (i.e. LAN) tun0 (VPN) - VPN connection Build a firewall that achieves the following: Deny ALL inbound traffic to: wlan0, tun0 (block incoming c...
So I think I'm going to leave this answer up as I believe I may have just figured out the missing piece (thanks to /var/log/ufw.log) unless someone else sees otherwise: # Allow DNS queries # [UFW BLOCK] IN= OUT=wlan0 SRC=192.168.10.x DST=192.168.10.1 LEN=66 TOS=0x00 PREC=0x00 TTL=64 ID=50892 DF PROTO=UDP SPT=22617 DPT...
A better VPN killswitch using UFW with NAT table?
1,440,610,426,000
I have the desktop-server Debian Jessie machine running for testing purposes just for 19 hours now. I have already set a few rules as you can see above. But I am not really into networking. So it needs some revision. Here is my iptables -L -v: Chain INPUT (policy DROP 1429 packets, 233K bytes) pkts bytes target pr...
The above iptables config will only let TCP and UDP packets get past the firewall (unless they came from loopback). The default rule of the INPUT chain has been set to DROP, meaning that every packet that isn't explicitly ACCEPTed will be discarded. There should be no weird packets from loopback, so only TCP/UDP pac...
iptables - how to drop protocols [closed]
1,440,610,426,000
How do I allow certain IPs and block all other connection in iptables on AMAZON EC2?
You can accomplish this using UFW. Enable UFW and set default incoming to deny: $ sudo ufw enable && sudo ufw default deny incoming Then you can allow specific IP's with: $ sudo ufw allow from 192.168.1.10 to any This will allow IP-address 192.168.1.10 to any port on your firewall.
to allow certain ips and block all other connections on AMAZON EC2 ubuntu 12.04
1,440,610,426,000
I previously ACCEPTed all output traffic by default. Recently changed the policy to DENY output by default, only opening ports needed for server/application functionality. When I tried to mount a drive this morning, there was a timeout (the destination server is up). If I set the output policy to ACCEPT, I'm able to...
You also need port 445 and make sure that you also have incoming related/established traffic allowed. grep 445 /etc/services microsoft-ds 445/tcp # Microsoft Naked CIFS microsoft-ds 445/udp
mount times out with iptables --policy OUTPUT DROP
1,440,610,426,000
I want to isolate a host on my home intranet using iptables on my linux router. So say for instance, I have a host that has the IP of 10.0.1.50 and I want it to be able to talk to the rest of the Internet, but I don't want the router to allow it to talk to any other host in 10.0.1.0/24. However, I want to be able to ...
You're most probably doing it wrong. Your router can't prevent 10.0.1.50 from talking to the rest of the 10.0.1.0/24 subnet, because they're in the same subnet. A packet from 10.0.1.50 to another host in this subnet will not pass through the router, so you can't filter it. What you need to do is to set up a separate s...
Isolate a hosts networking with iptables
1,440,610,426,000
As you know, at least 3 types of NAT are used. Of course i need to two types of them.DNAT and SNAT. DNAT : hiding server behind NAT, SNAT : hiding your client behind NAT. Question: I read a quick tutorial of PF filrewall, but didn't distinguish DNAT and SNAT in PF Firewall. How can i define ruleset as DNAT and SNAT?
I've been using NAT for a long time and this the first time I've seen the terms DNAT and SNAT. I had to go look at Wikipedia. To help you, pay attention to Wikipedia when it says "This use of DNAT is also called port forwarding". I've only ever heard it called port forwarding. The keyword you'll want on your rules ...
PF and types of NAT(Network Address Translation)
1,440,610,426,000
-A INPUT -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT every Firewall rule usually starts with this. Q: Does it matter that is it RELATED,ESTABLISHED OR ESTABLISHED,RELATED?
No, it's simply a list of co-equal packet states. In this case, order does not matter.
EST/REL or REL/EST in iptables firewall scripts?
1,440,610,426,000
I would like to install apache, php and mysql on Ubuntu 22.04 toolbox which is running in a Fedora 39 desktop VM. I am following the steps instructions provided in this link, but is seems to have some problem trying to set the ports in the firewall; when I run ⬢[lab@toolbox lab]$ sudo ufw allow in "Apache" WARN: initc...
You are in toolbox (a container) which doesn't have its own networking stack. Since toolbox runs in host networking mode, it should inherit whatever firewall rules you set outside toolbox. Have you tried running sudo ufw allow in "Apache" outside toolbox?
Install apache, php and mysql on Ubuntu 22.04 toolbox
1,440,610,426,000
I will filter inbound traffic with iptables. I have 2 goals. a) Allow HTTPS inbound at port 443. b) Redirect port 443 to process listening port on 9443. Not sure about the processing of that 2 rules. Do I need to set my INPUT rule to ACCEPT inbound HTTPS to port 443 or 9443?7 Depends on if redirection is done before...
The PREROUTING chain in the nat table handles the redirection for you: iptables -t nat -I PREROUTING --protocol tcp --dport 443 --jump REDIRECT --to-port 9443 Then the INPUT chain (implicitly in the filter table) handles permitted traffic: iptables -I INPUT --protocol tcp --dport 9443 --jump ACCEPT Notice that the r...
Iptables: order of redirect and input-filter
1,440,610,426,000
I rely on my specific service to load iptables rules at startup in my debian installation, this service calls iptables-restore my_rules.v4 ip6tables-restore my_rules.v6 and do some other scripts however I realized that there's a small delta of time where default rules are applied between the enabling of the interfac...
In Debian 12, iptables is by default a wrapper for the new nftables subsystem. The iptables-persistent package depends on package netfilter-persistent, which creates a service named netfilter-persistent.service which is aliased to both iptables.service and ip6tables.service. The netfilter-persistent.service is defined...
Load iptables or nftables rules as fast as possible during boot and before the network interfaces be put online
1,440,610,426,000
I'm dealing with a RHEL version 6.4 server's firewall setting and the goal is to allow remote device to connect tcp port 6162, regardless of the type of services. The iptables rules are shown below(iptables -L --line-numbers), and service iptables has been restarted. num target prot opt source desti...
Your port 6160 works because it seems to have a Veeam Installer Service running (process name is something like veeamdeploymen* according to your netstat -tulpn output). Because there is no service running on port 6162 yet, the port will not open, although you seem to have already have unblocked it in firewall setting...
RHEL 6.4 basic firewall rule port 6162 does not take effect
1,440,610,426,000
In a FreeBSD 13.1 install, I enabled the IPFW firewall and set firewall_type="workstation" in /etc/rc.conf. This allows outgoing requests, while denying incoming requests. When I checked the firewall log at /var/log/security, I see this entry: Apr 5 12:34:56 mycomputer kernel: ipfw: 65500 Deny UDP 192.168.1.1:67 192....
"Would this cause issues when the DHCP lease expires?" Yes. DHCP uses UDP as its transport protocol. DHCP messages from a client to a server are sent to the 'DHCP server' port (67), and DHCP messages from a server to a client are sent to the 'DHCP client' port (68). Source: RFC 2131
What are the consequences of blocking incoming UDP port 68 on my computer?
1,440,610,426,000
I have configured the following s2s VPN (in pfSense) connection which is working in general. Unfortunately, I can connect (ping, netcat, ssh) only from client to the server, but not back. If I can ssh normally, it means that firewall is not the problem, right? Since packages are travelling in both directions? How to ...
A firewall can certainly control the direction TCP connections can be established in, by passing TCP packets with the SYN flag set but the ACK flag unset in one way only. The fact that you can SSH normally only indicates that packets either with no SYN flag at all or with both SYN and ACK flags set are allowed in both...
What subsystem is responsible if I can connect via s2s VPN connection only in one direction?
1,440,610,426,000
Yesterday I had issues with my database server dropping packets with: [Tue Feb 28 21:01:00 2023] nf_conntrack: nf_conntrack: table full, dropping packet I know there a plenty of solutions easy to find in google to increase the table size. So I did sysctl -w net.netfilter.nf_conntrack_max=4194304 But they also say to ...
I finally found the answer... it can be done with sysctl.conf. The parameter is net.netfilter.nf_conntrack_buckets
What is the correct way to increase nf_conntrack in ubuntu 18.04?
1,440,610,426,000
The Qemu VM can be connected to LAN mainly in two ways: type=user or type=tap. The user mode completely isolate the VM in private network, which is sNATed to host main network stack. The use of tap is more complicated, it needs a virtual bridge to become a master of a physical interface (eth0) and virtual interface (t...
There are two possible solutions: Use nftables bridge family and do filtering below layer 3. Use the host as a router. The first solution is the more efficient option, but limits you to filtering on properties of the Ethernet frames. You can’t filter on IP addresses or ports, or anything else at layer 3 or higher, b...
How to secure the tap interface with nftables
1,440,610,426,000
I have to setup an stateful firewall on centos8 using firewalld. I'm new to firewalld but have experience with old style iptables for this purpose. since it is recommended by Redhat here, I prefer to not combine two methods like firewalld and iptables. I want to know is there a way to use firewalld in stateful mode? ...
Firewalld configures iptables or nftables, and the resulting configuration is stateful (based on connstate status: established, related, untrack, invalid, new). You can check the actual configuration with iptables -L -n -v and nft list ruleset. You can choose which backend you want to use in /etc/firewalld/firewalld.c...
how to use firewalld in stateful mode
1,440,610,426,000
On my host Ubuntu 18.04 I am running two lxc containers using default setups. Containers use Ubuntu 18.04 as well. I have an app running on container1 that offers an https based service on https://localhost:3000/. Container2 is not able to even establish a connection with container1. Container2 can ping container1 and...
Port 3000 is only listening for localhost. You need to configure your application correctly so that the port is open to 0.0.0.0 (as you can see in other ports).
Connection refused between 2 linux containers
1,440,610,426,000
I connected to my remote Linux server to adjust my network settings, but I accidentally changed some rules using iptables instead of my preferred method, ufw. I added the rules in ufw and then ran iptables -F to flush the rules from iptables. However, I forgot that this would block my SSH connections. I would like to ...
ufw doesn't need to flush iptables rules on reboot. That happens automatically...or, more precisely, there are no iptables rules on a freshly booted Linux system until something sets them. ufw does exactly that. It will set the iptables rules to exactly what its configuration files tell it to set them as. That's w...
Does UFW reset iptables on reboot?
1,440,610,426,000
Could anyone help me with a review of my iptables rules (running a new Tor relay server), please? I'm running a Debian GNU/Linux 11 (bullseye), fully updated. I drop everything in INPUT chain by default, SSH port is censored, so if you see XXYYZ... I changed it to a custom port so that the bots have a little bit more ...
For your reference: *filter -N RNNS -A RNNS -p tcp ! --syn -j REJECT --reject-with tcp-reset # accept (new) syn -A RNNS -j ACCEPT -N ALLOW # tcp (r)eset (n)ew but (n)ot (s)yn # -j RNNS is fine too since the chain has a "fallback" verdict at the end -A ALLOW -p tcp --dport 9001 -g RNNS -A ALLOW -p tcp --dport 9030 -g ...
Review iptables on a VPS (running Tor non-exit relay)
1,440,610,426,000
I just freshly install a new machine running on linuxmint-19.2-xfce-64bit. I set the Gufw to block all incoming and outgoing traffic but my system still receive an IP address! The software manager fetch result on query (unless this is local ??) but Firefox is at least blocked. So how I can simply block everything? Als...
On Linux, the standard network stack forbids to send an IP packet with source IP 0.0.0.0 (probably since kernel 2.2). As this is required by the DHCP protocol, DHCP tools must bypass this limitation. Thus DHCP clients rely on RAW sockets to craft this forbidden packet with source IP 0.0.0.0 and actually use them for t...
Looking for a simple but effective firewall
1,440,610,426,000
I installed firewalld on my Debian 10 laptop. Now Transmission cannot upload properly. If I go in to Edit->Preferences->Network and click [Test Port], it says the port is closed. If I systemctl stop firewalld and restart Transmission, then it says the port is open. How can I use Transmission with a firewall?
Firstly, in the same Network tab of the Preferences window, make sure that "Pick a random port every time Transmission is started" is unchecked. Also check what the Listening Port is set to. The default port number is 51413. In your firewall, allow the TCP port number set above. Since you are using firewalld, you ...
Transmission (Gnome BitTorrent client) v.s. firewall on Debian 10
1,440,610,426,000
My iptables output looks like this: Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP all -- 0.0.0.0/0 0.0.0.0/0 match-set sshd src Chain FORWARD (policy ACCEPT) num target prot opt source destination Cha...
You can use -C flag in iptables to check if a set exists: sudo iptables -C INPUT -m set --match-set sshd src -j DROP Return code is > 0 if the set does not exist.
how to check whether an ipset was hooked up to iptables
1,440,610,426,000
I have VMs in virt-manager. Normally, they can connect to the internet. These VMs are connected to my default virtual network, device virbr0. To reach the internet, the virtual network is configured as "NAT forwarding". But the VMs can no longer connect to the internet. They can ping the host, on the IP address 192....
now sudo iptables-save shows as empty, but the VMs still cannot connect to the internet. The NAT forwarding on the virtual network uses iptables rules. Therefore if the iptables rules are empty, it cannot work :-). The problem happened because I had already stopped and started firewalld, to diagnose a different iss...
Virtual network virbr0 cannot connect to internet anymore
1,440,610,426,000
I'm quite stumped/frusterated as I can't get postfix to work on one of my VM's. It is a "template" VM and I have setup other VM's with this template fine. The only difference I can really think of is this VM's purpose which is ZoneMinder security software. I tried using telnet mail.domain.com 25 & ssh [email protected...
I'm not 100% the issue (but it's fixed now!), but I found these two threads helpful. From 192.168.0.146 icmp_seq=1 Destination Host Unreachable Host unreachable and I do not get why Basically it was one of two things: A duplicate IP address conflict A duplicate MAC address conflict But, the trick was also to make su...
No Route To Host from one VM on LAN
1,440,610,426,000
I've recently learned about the route-to functionality in the pf firewall, and I wonder how it works. Is it similar to the "policy-based routing" system in linux? How does route-to allow the overriding of the system routing table?
Pf's route-to allows to define policy-based routing (PBR) using the same firewall's ruleset. The PBR itself is then being done at kernel-level during traffic processing according to firewall ruleset shipped onto kernel level by pf's user-space utility pfctl. In Linux, Netfilter (which many people erroneously call ipta...
How does route-to work in the BSD pf firewall?
1,440,610,426,000
I deploy an Ansible playbook to some debian:stable machines aiming to update package index cache, install ufw and setup it in the Ansible architecture-agnostic and version-agnostic way. - name: Update all apt package index cache (apt update) apt: update_cache=yes - name: Install a latest ufw apt: name: ufw ...
If you just want to run shell commands, you use the Ansible shell or command modules. As far as ufw goes, I think it directly edits the rules files. Looking at the source code, it's running this, before and after the actions to check if these files have changed contents. grep '^### tuple' /lib/ufw/user.rules /lib/uf...
Ansible orchestration for ufw with ufw --force enable
1,440,610,426,000
Simple question: What is the priority if we have both firewalld and iptables in use? Which takes the priority in the rules. For example, if I block ICMP with firewalld and with iptables I accept it, what happens?
Firewalld uses iptables to implement its rules. If require some iptables features not implemented in firewalld, you can configure iptables rules directly in firewalld . Using more than one tool to manage iptables rules might otherwise cause problems. Iptables rules are evaluated in order, processing for a packet stops...
Firewalld and iptables priority
1,440,610,426,000
I have a server with a proxmox installation and only 1 outbound connection (eth0). To make the machines network between each other I created a network bridge (vmbr0) in the interfaces configuration and configured it accordingly to the Proxmox Network Model (Subpoint NAT). The bridge has the IP 10.1.1.1 and acts in my...
man ping, bolds mine: -I interface interface is either an address, or an interface name. If interface is an address, it sets source address to specified interface address. If interface in an interface name, it sets source interface to specified interface. The issue is with forcing the interface with ping -I...
Does ping omit iptables / postrouting rules
1,515,464,161,000
Do I need port 993 unfiltered to get emails from a WordPress site? For example, in WordPress I've installed a plugin called "Contact form 7" (CF7) that gives you a basic contact form. In the plugin settings you can insert your email (say, [email protected]) and messages left in your WordPress CF7 contact form will be ...
You most likely won't need it. Port 993 is related to IMAP, which implies email clients (mutt, thunderbird, ...) connecting to their mailboxes on your server. Assuming from your question, you're looking to setup a smtp relay, hence do not need to allow in traffic for potential clients - and probably won't have a servi...
Do I need port 993 to get email in a WordPress site?
1,515,464,161,000
I've got many rules like: -A POSTROUTING -s IP_LOCAL1 -j SNAT --to-source IP_PUBLIC1 -A POSTROUTING -s IP_LOCAL2 -j SNAT --to-source IP_PUBLIC2 ... ... -A POSTROUTING -s IP_LOCAL100 -j SNAT --to-source IP_PUBLIC100 Is there any possibility to make an ipset with declaration IP_LOCAL1:IP_PUBLIC1 and then make only one ...
No. Currently it is not possible to use ipset as SNAT directives.
IPset and making firewall simple
1,515,464,161,000
I am building a secure server (Debian with GUI) for offline signing transactions. I don't need internet access. However I would like to have my system automatically update. How can I achieve this?
A local repo or repo-cache is needed. For a local deb mirror: setup a web server get apt-mirror configure apt-mirror: there are three items that should be modified within the apt-mirror config file. /etc/apt/mirror.lst point within your web hosted pages. set base_path <somewhere_in_your_web_hosted_page> in my spec...
How to allow only apt internet access any deny / block everything else
1,515,464,161,000
I have a router, which I want to configure to block all outgoing traffic to the Internet. As far as I understand, I need to drop forwarded packets. In addition I want to allow traffic between one machine and several other machines in the internal LAN. To do tried the following: IPT="/sbin/iptables" LOCAL_CONTROLLER="...
The FORWARD queue is only used when the server is question is the router, for dealing with incoming/outgoing packets outside of your network; it is used for blocking/accepting the routing of packets outside your network (at router level). For controlling connections at host level, you normally use INPUTor OUTPUT queu...
IPTables - allow communication between two hosts , drop everything else
1,515,464,161,000
I'm a little lost and hope someone can point me into the right direction to solve my problem. I have a server running with a Debian distribution and I'm using UFW as firewall. The configuration and setup was pretty easy and I started the firewall as documented with: manly@server:~$ sudo ufw enable Command may disrupt ...
So after some digging and talking to the support, we finally figured out, what stops UFW. The system also had APF (Advanced Policy Firewall - R-fx Networks) configured, which adds a cron-job to the system. The job removes all rules on midnight and resets the rules defined for APF.
UFW (Uncomplicated Firewall) turns off (inactive) after a while
1,515,464,161,000
Following IPTables rules exist on my system as some preventive measures against DDoS attacks -A INPUT -s 255.0.0.0/8 -j LOG --log-prefix "Spoofed source IP" -A INPUT -s 255.0.0.0/8 -j DROP -A INPUT -s 0.0.0.0/8 -j LOG --log-prefix "Spoofed source IP" -A INPUT -s 0.0.0.0/8 -j DROP Is it restricting private IP Address...
The -A INPUT -s adds a rule for any packets with the source subnets specified on the line. Therefore, in your example, you are logging and dropping all packets that have a source IP address that starts with 255 and all that start with 0, such as 255.1.2.3.4 or 0.56.78.90 The idea here is that there should will never b...
Understanding Iptables rules to prevent DDoS
1,515,464,161,000
Will VyOS still work right if I install Shorewall-lite on it? Shorewall seems like an easier way to setup a network, but VyOS seems pretty great for day-to-day management of a router / firewall. So I was wondering if they are compatible. From what I understand about Shorewall, it just generates a bunch of iptables ...
Shorewall-lite is a very light weight tool to manage a firewall configuration generated on another server. It is not suitable for setting up the configuration, but does manage the generated configuration. It runs quite well on OpenWRT, which is a distribution intended for routers. The current version of Shorewall ...
Can Shorewall be used on VyOS?
1,515,464,161,000
I have iptables firewalls and its logging for all DROP packets or Deny. I want to tell it to no LOG any packet for ICMP protocol. How do i tell that *filter :INPUT DROP [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [24:5541] :DROPLOG - [0:0] -A INPUT -s 108.34.21.45 -j ACCEPT -A INPUT -s 210.23.72.22 -j ACCEPT -A INPUT -...
I suggest that you insert a -A INPUT -p icmp -j DROP before -A INPUT -j DROPLOG Drop the ICMP packets, then send the others to DROPLOG to get logged (and dropped).
iptables logging for all except ICMP
1,515,464,161,000
I need to isolate Subnets on a linux machine CentOS that act as gateway. I have the following scenario. CentOS eth0 pub ip addres eth0.1 192.168.1.1 eth0.2 192.168.2.1 Now eth0.1 and eth0.2 can communicate but i need to disable this. I can't use VLANs so i need to disable this communication with IPtables. Any idea ?...
It's a bit tricky. You can isolate only traffic that passes through your gateway. For instance you can use that rules: iptables -I FORWARD -s 192.168.1.0/24 -d 192.168.2.0/24 -j DROP iptables -I FORWARD -d 192.168.1.0/24 -s 192.168.2.0/24 -j DROP or: iptables -I FORWARD -i eth0.1 -o eth0.2 -j DROP iptables -I FORWARD...
Isolate subnets on the same interface
1,515,464,161,000
Looks like this rule works to blocking facebook domain, when not visiting the facebook domain (ex.: "like/share" etc. buttons on other pages then facebook): ! don't allow facebook outside facebook.. ||facebook.com$domain=~www.facebook.com ||facebook.net$domain=~www.facebook.com ||fbcdn.net$domain=~www.facebook.com f...
You should try Ghostery to see if it doesn't do what you want. It's not a set of adblock rules, but rather an entire plugin devoted to webbugs, profiling, etc.
Adblock rule to block g+ / twitter / etc. [closed]
1,515,464,161,000
I have set up Apache, MySQL, PHP, SSH (which I use to connect to the VPS), Node.js, MongoDB and ProFTPd. Now, I want to have a firewall on the system, so that no one hacks the system. For instance, MongoDB is open for all on the default port unless I set it to secure mode and provide a password and so on. But it is re...
Any iptables tutorial should do the trick. Positive security is best. Block everything and only allow the traffic you specify. Layers of security is rarely a bad thing. MongoDB is famous for its insecurities, so I suspect secure mode is a good start. What hosting provider are you using?
How to set up firewall on Debian Squeeze
1,515,464,161,000
Is it possible to match only the DSCP portion of the IPv4 ToS or IPv6 traffic class byte using ebtables? I see that ebtables has the --ip-tos match option for IPv4 packets and the --ip6-class match option for IPv6 packets. To my understanding, those match the entire ToS or traffic class byte (i.e. the 6 DSCP bits and ...
Answering my own question, it doesn't seem that this is possible with ebtables (thank you for the comment @A.B), as there's no mask or specific keyword for dscp. Trying this in a legacy project that uses eb/iptables, but going to migrate to nft as there's a built-in dscp keyword that should work at the bridge layer.
Matching DSCP portion of ToS or traffic class byte using ebtables
1,515,464,161,000
I run a server with a web server running as a rootless podman container. This exposes ports 10080 and 10443 because, as a rootless container, it is not allowed to expose ports 80 and 443. So that my website can be accessed from outside, I use ufw as a firewall and have set up port forwarding there. To do this, I added...
After rethinking solution is simple: just do the port forwarding only when destination is my servers IP, so I changed before.rules to: *nat :PREROUTING ACCEPT [0:0] -A PREROUTING -d <ServerIP> -p tcp --dport 80 -j REDIRECT --to-port 10080 -A PREROUTING -d <ServerIP> -p tcp --dport 443 -j REDIRECT --to-port 10443 COMMI...
How to define port forwarding
1,693,265,506,000
I am trying to enable remotelogin on MacOS (Ventura). "sudo systemsetup -setremotelogin on" says it is already enabled (confirmed by the GUI), but if I try to login from my Linux PC I get % ssh [email protected] ssh: connect to host 10.42.100.13 port 22: Connection timed out Both system application firewall and packe...
My fault: System Integrity Protection was still off. After turning it on again I can login via ssh. Hope this is helpful for somebody out there running into the same pitfall.
how can I enable sshd on MacOS ventura, if "systemsetup -setremotelogin on" doesn't work?
1,693,265,506,000
I have Debian 11 using the new Firewall Daemon, and I have a device connected to eth1. I want to block all connections from internet or any IP other than the local IP in the range 10.147.20.0/24. Is it possible using firewall? I tried block zone, internal but i can still ping www.yahoo.com. [Update 1] eth0 -> connecte...
I found a solution to my issue, in which i created a bridge br0, and masqueraded eth0 that has internet. In such a case any interface connected to br0 will be open to the internet. It is not a firewall issue rather than a network design issue. Solution: First masqueraded eth0 to pass internet. Second changed the bri...
How to block connection from eth1 through firewall daemon?
1,693,265,506,000
I have a server with default deny and several UFW rules. UFW is enabled on startup (systemctl enable UFW). When I reboot only some of the rules don't get applied properly and I can't access some services. I can SSH into the server, and the lower ports (<1024) seem to work, but some services above 1024 still drop. If ...
In this case I discovered there were entries in /etc/iptables.up.rules. In my case I believe iptables.up.rules existed because of an old edit in Webmin, which I also run. Moving /etc/iptables.up.rules to /etc/iptables.up.bak and rebooted. The issue is fixed. It turns out I had ifupdown installed and it was loading the...
UFW not fully loading rules on startup
1,693,265,506,000
The following two rules allow for passive transfers which i added as Firewall rules for my FTP server. //The following two rules allow the inbound FTP connection iptables -A INPUT -s $hostIP -p tcp --dport 21 -i eth0 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -d $hostIP -p tcp --sport 21 -o eth0 -m ...
I assume $hostIP in your rules means a host you wish to allow FTP access for, otherwise your existing rules won't make sense to me. If you are using unencrypted FTP, you should replace your wide-open FTP data connection rules with connection tracking. First, add a rule that attaches a FTP connection tracking helper to...
How to make Firewall rules for Passive FTP which uses dynamic port?
1,693,265,506,000
I want to connect to a remote computer and start Jupyter notebook on the remote computer. Every time I try to connect to jupyter notebook there is an error. When I turn off my firewall the jupyter notebook works. Is there any way to not turn off the firewall and get around this? My computer has windows and the remote ...
I assume that you are turning off the firewall on your client machine, you need to add a outbound rule to allow a SSH connection. If you are using Windows firewall then you can use the following command to add a outbound rule via command-line (CHANGE THE PORT YOU ARE USING FOR SSH ACCORDINGLY): netsh advfirewall fire...
how to get around the firewall when connecting to the remote server
1,693,265,506,000
As follow is the list of the iptables rules that I have : # firewall-cmd --direct --get-all-rules ipv4 filter INPUT 0 -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT ... ... ipv4 filter INPUT 1 -d 127.0.0.1 -p tcp -m tcp --dport 4118 -j ACCEPT ipv4 filter INPUT 2 -i lo -j DROP ipv4 filter FORWARD 0 -j DROP ipv...
A rule was indeed missing. I had to add the option --dport in addition to --sport for the port to be open as needed.
iptables/firewall-cmd DROP rules set last block ip rule set before
1,693,265,506,000
Today I want to expose my cloud redis into public network, for some security reason, I just want my specific ip could access the redis port 6379. Now I do it in my cloud host like this: firewall-cmd --new-zone=special --permanent firewall-cmd --reload firewall-cmd --zone=special --add-source=61.173.91.1/32 --permanent...
expand the ip range: firewall-cmd --zone=special --add-source=61.173.91.1/24 --permanent works.
why the firewalld add port and ip witle list not working as expect
1,620,033,444,000
I'm connected via PuTTY ssh to a Linux Server (so it's not supposed to have a GUI). when I npm install something, due to some intranet network configuration, the http request is redirected as follows npm i express npm WARN registry Unexpected warning for http://registry.npmjs.org/: Miscellaneous Warning SELF_SIGNED_CE...
Apparently solved after clearing the npm cache rm ./package-lock.json rm -r ./node_modules npm cache clear --force and having reconfigured the https connection but without check. npm set strict-ssl false and npm config set registry https://registry.npmjs.org/ or equivalently npm config rm registry (not sure if any...
authentication for npm install during PuTTY ssh?
1,620,033,444,000
I added a large number of domains to my /etc/hosts, in the hope of preventing outgoing traffic to those sites. Now I have found however that my /etc/hosts is having no effect. It's meant to serve as a primitive outgoing firewall. Does anyone know why these would have no effect at all? 127.0.0.1 a.ns.facebook.com 127...
One approach, in the absence of a decent application firewall, is: Identify an IP range that needs blocking e.g. a range that is associated with an unfriendly server. Add a firewall rule to block all outgoing traffic to that range. This at least works.
My /etc/hosts is having no effect