Results 1 to 2 of 2

Thread: Ping via direct ethernet connection to macOS fails

  1. #1
    Join Date
    Apr 2024
    Beans
    0

    Question Ping via direct ethernet connection to macOS fails

    I have a PC running Ubuntu connected to my Mac mini running Sonoma via an ethernet cable. I can log onto the Ubuntu system over the ethernet cable using Microsoft Remote Desktop on the macOS. Therefore I do have connectivity.


    However, while I can ping the Ubuntu system from the macOS using ‘ping 192.168.1.2’ successfully when I try to ping the macOS from Ubuntu using ‘ping 192.168.1.3’ it fails with:


    PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
    From 192.168.1.242 icmp_seq=1 Destination Host Unreachable


    I searched the internet and tried to fix it by adding two lines to the ufw configuration file /etc/ufw/before.rules. They are shown below but commented out:


    # ok icmp codes for INPUT
    -A ufw-before-input -p icmp --icmp-type destination-unreachable -j ACCEPT
    -A ufw-before-input -p icmp --icmp-type time-exceeded -j ACCEPT
    -A ufw-before-input -p icmp --icmp-type parameter-problem -j ACCEPT
    -A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT


    # Allow outbound ICMP Added by My-Name-Redacted
    # -A ufw-before-output -p icmp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
    # -A ufw-before-outut -p icmp --icmp-type echo-request -j ACCEPT


    # ok icmp code for FORWARD
    -A ufw-before-forward -p icmp --icmp-type destination-unreachable -j ACCEPT
    -A ufw-before-forward -p icmp --icmp-type time-exceeded -j ACCEPT
    -A ufw-before-forward -p icmp --icmp-type parameter-problem -j ACCEPT
    -A ufw-before-forward -p icmp --icmp-type echo-request -j ACCEPT


    When I uncomment the two rules "ufw-before-output' rules I added to the file and run the command ‘sudo ufw reload’ I get the following:


    ERROR: problem running ufw-init
    iptables-restore: line 79 failed


    Problem running '/etc/ufw/before.rules'


    Line 79 is the last line in the file which just says 'COMMIT'


    Do you have a suggestion why I still cannot ping my macmini from Ubuntu?


    Also note that I can ping the macOS system from Ubuntu if I ping to the wifi address of the mac as in ‘ping 192.168.1.176’.


  2. #2
    Join Date
    Apr 2024
    Beans
    41

    Re: Ping via direct ethernet connection to macOS fails

    Is your mac mini configured to deny/drop icmp

    that is a basic security precaution, in linux we have to manually enable that as an option.

    If your computers aren't given Ip addresses by dhcp, via for example a typical router on the lan, than how are they being linked together initially?

    Also note that I can ping the macOS system from Ubuntu if I ping to the wifi address of the mac as in ‘ping 192.168.1.176’.
    I think you answered your own question...

    You're on the local network using IP addresses' typically assigned by dhcp by the router
    and then attempting to connect outside of that network, defined by the router, and wondering why it doesn't work.
    Last edited by hyperlinxe; 3 Weeks Ago at 01:24 AM.

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
  •