-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N f2b-sshd
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A f2b-sshd -s 62.204.41.56/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -s 61.177.173.48/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -s 167.172.187.120/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -s 43.156.124.69/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -s 43.154.46.209/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -s 61.177.172.98/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -s 122.160.233.137/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -j RETURN
My usual incantation and response:
# sudo iptables -A IN_public_allow -p tcp -m tcp --dport 80 -m
conntrack --ctstate NEW,UNTRACKED -j ACCEPT
iptables: No chain/target/match by that name.
# sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N f2b-sshd
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A INPUT -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW,UNTRACKED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -m conntrack --ctstate
...
But no open ports in spite of the output shown.
I am considering moving to ufw
As the bare-iron server came from my long-time cloud provider (since
Debian 6), incoming ports 80 and 443 are blocked.
A little more digging shows the new server is using fail2ban and nft tables, so Ineed help on how to properly allow https and http inbound.
Therefore, something outside of your machine is blocking the
ports, or you are misreading or misusing the tools that are
telling you the ports are blocked.
Tell us how you are checking the ports
I am running an Apache server and using Qualys Lab’s server checker. It shows no access to the server.
Whatever attempt I make to change the ports disappears when I reboot.
-Tom
I am running an Apache server and using Qualys Lab’s server checker. It shows no access to the server.Have you tried to telnet to port 80 from home? Do you see apache listening this port using ``ss``?
On Sat, May 28, 2022 at 05:51:38PM -0500, Tom Browder wrote:
…
... wow. Just wow. How can such a short excerpt contain so many failures?
On Sat, May 28, 2022 at 17:51 Tom Browder <tom.b...@gmail.com> wrote:On Sat, May 28, 2022 at 17:30 IL Ka <kazakev...@gmail.com> wrote:I am running an Apache server and using Qualys Lab’s server checker. It shows no access to the server.Have you tried to telnet to port 80 from home? Do you see apache listening this port using ``ss``?On the new host I did:$ sudo su# telnet 80Trying 0.0.0.80...and gave up waiting.
On the local host try running `telnet 127.0.0.1 80`
$ sudo su# telnet 80Trying 0.0.0.80...
3. You should also check that Apache is running and listening to this port, use ``ss -lt``.For this command you _may_ use sudo to get process names (``sudo ss -ltp``). Read ``ss --help``If you were able to connect on this host, then try to connect to this machine from outside using public IP
Does anyone have a good reason for me to NOT install and enable UFW?
$ telnet x.y.z.w 80Trying x.y.z.w...telnet: Unable to connect to remote host: No route to host
Does anyone have a good reason for me to NOT install and enable UFW?ufw can't be used with ipset AFAIK, and I use ipset for many reasons (fail2ban, block access outside of my country etc).But If you only SSH your host from one static IP, you probably do not need fail2ban at all.
Anyway, I am not sure that port 80 is blocked by your firewall and not your hosting firewall
Good to know. But does fail2ban require ipset?
They never have before in over 15 years, and, before I got this server started, its mate was serving fine. But if the ufw doesn't work, I'll ask them.
Do I have to switch all four *legacy *tables?
I am not familiar with nft, bit you can switch to iptables using ``update-alternatives``# update-alternatives --set iptables /usr/sbin/iptables-legacy
# update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
# update-alternatives --set arptables /usr/sbin/arptables-legacy
# update-alternatives --set ebtables /usr/sbin/ebtables-legacy
Do I have to switch all four *legacy *tables?yes
When running those, I'm told neither the arptablrs nor the ebtables are registered (not installed). Should I install them?
> and ``iptables -S`` ?
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N f2b-sshd
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A f2b-sshd -s 61.177.173.50/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -s 61.177.173.7/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -s 43.154.179.253/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -j RETURN
btw, are you able to ping server?
I must say, I can not realy understand how you can ping and not
telnet/access your web server.
ssh gives me a login prompt
On 5/30/2022 12:26 AM, Tom Browder wrote:
> On Sun, May 29, 2022 at 15:55 Greg Wooledge <gr...@wooledge.org> wrote:
Unless this machine is more than just a web server...?
IMHO: It is better to have a firewall and block (policy -- drop) INPUT and FORWARD by default.And open only ports that must be opened.This will help if you install some software that listens for 0.0.0.0 by accident
On 5/30/22 09:41, Greg Wooledge wrote:
> On Mon, May 30, 2022 at 07:13:54AM -0500, Tom Browder wrote:
>> No worries. All those responses about the subject IP now are the norm for a
>> bare-iron server ready for use by a customer, yours truly. It is the same
>> server I messed up the firewall with and locked myself out of. The OS has
>> been reinstalled and is ready for me to use again.
> when does it actually start operating? Does it do so then, or does it take
> a reboot?
Apparently, if you 'enable' 'ufw', it will start and be enabled at boot.
According to (1), ufw should work with nftables, I did not follow the
reasoning on why to use iptables but only if you have issues use legacy
iptables.