Results 1 to 2 of 2

Thread: need help with ufw - can't ping local machines...

  1. #1
    Join Date
    May 2024
    Beans
    1

    Lightbulb need help with ufw - can't ping local machines...

    hi guys,
    i set up these ufw rules and they look correct to me but I can't ping any other device on the same network...

    # set firewall rules
    echo "Setting firewall rules..."
    # all
    sudo ufw default deny incoming
    sudo ufw default deny outgoing
    # local
    sudo ufw allow from 192.168.178.0/24
    sudo ufw allow to 192.168.178.0/24
    # ssh
    sudo ufw allow ssh
    # transmission
    sudo ufw allow in 51413/tcp
    sudo ufw allow out 51413/tcp
    # wireguard
    sudo ufw allow in on wg0
    sudo ufw allow out on wg0


    # apply firewall rules
    echo "Applying firewall rules..."
    sudo ufw enable

    what am I missing?

  2. #2
    Join Date
    Feb 2019
    Location
    Virginia
    Beans
    375
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: need help with ufw - can't ping local machines...

    It would help when you post to show commands, code, & outputs within code tags.

    By default, ufw denies incoming, allows outgoing, and denys routing. Even with deny incoming it doesn't block ping by default, you have to go out of your way to block ping. Other things are probably causing this, likely your network.

    I think before anyone can help you, you should tell more about your network. What is this host (i.e. a VM, hypervisor host, container, or a single bare metal OS)? If this is a VM, then which hypervisor are you using? Do you have a bridge set up for your VMs to communicate on the network? If not, then you may be running on the default hypervisor network which I think is NAT for KVM, which would inhibit communication between hosts on the network.

    If this machine is not exposed to the internet, perhaps you could temporarily disable your firewall and then try ping. If ping still doesnt' work, then you know it's likely your network. Remember to enable it again after this quick test.

    If ping does work when the firwall is brought down, and then breaks again when the firewall is enabled, then it could be your firewall, or, whatever you are doing with Wireguard on your network such as dropping ping packets to quiet down requests on your LAN.

    You could try checking the result of this simple command to have a look at your firewall rules which you have set. Sometimes you can have extra rules set that you did by accident or through various trial & error along the way:

    Code:
    sudo ufw status
    Last edited by aljames2; 1 Week Ago at 12:47 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •