0

I have run into a curious problem. When I connect my MacBook via LAN cable, the Internet doesn't work, but I can still ping other devices in my network (including the router) and also can access my network hard disk.

When I connect via Wi-Fi to the same router, the Internet works, so does anything else as it's supposed to.

I prefer using the LAN cable as it's faster and more reliable, so I really would like to solve this issue.

Please, note that I cannot restart my computer, because I'm running a very important operation, which cannot be interrupted and will take several weeks.

I hope someone will point me to the right direction as to investigating this issue.

MacBook:

  • macOS Catalina Version 10.15.7
  • MacBook Pro (15-inch, 2018)
  • Processor 2,6 GHz 6-Core Intel Core i7
  • Memory 32 GB 2400 MHz DDR4
  • Startup Disk Macintosh HD
  • Graphics Radeon Pro 560X 4 GB
                   Intel UHD Graphics 630 1536 MB

Router: AirPort Time Capsule 802.11ac

UPDATE # 2 as per Allan's question: Yes, I turn off Wi-Fi when I try to connect via Ethernet and yes, I can ping 8.8.8.8 and I also can ping other websites if I use their IP address but I cannot connect to a university VPN.

UPDATE # 2 as per Allan's question: output of ipconfig getpacket en0 | grep "domain_name_server" with Wi-Fi turned off => nothing. en0 is my Wi-Fi interface by the way and en8 is my Ethernet, so just in case I issued the command also with en8 instead of en0: output of ipconfig getpacket en8 | grep "domain_name_server" with Wi-Fi turned off => domain_name_server (ip_mult): {192.168.1.1}

Output of both commands with Wi-Fi on is the same => domain_name_server (ip_mult): {192.168.1.1}

UPDATE # 3 as per Allan's suggestion: output of nslookup apple.com 192.168.1.1:

;; connection timed out; no servers could be reached

UPDATE # 4 as per Allan's comments: I am able to successfully ping my router with ping 192.168.1.1

I am still unable to ping www.apple.com or www.google.com nor am I able to access the Internet after setting the DNS manually with networksetup -setdnsservers Ethernet 8.8.8.8, wherein I replaced Ethernet with my the name of my LAN netowork service (found out using networksetup -listallnetworkservices).

With networksetup -getdnsservers Ethernet I get 8.8.8.8

UPDATE # 5 as per jksoegaard's suggestion: I tried manually configuring my IPv4 settings under my Ethernet connection in Network preferences, without success:

enter image description here

I also tried changing the default gateway through Terminal:

% sudo route add default 192.168.1.1
route: writing to routing socket: File exists
add net default: gateway 192.168.1.1: File exists
% 

The internet is still not working properly (cannot browse), though.

Just for note, I am able to successfully ping Google, but not by its web address, but rather using its IP address: I had to use nslookup with my Wi-Fi on because otherwise (with only my Ethernet on) it wouldn't work. en0 is my Wi-Fi interface.

% nslookup www.google.com
Server:     8.8.8.8
Address:    8.8.8.8#53
Non-authoritative answer:
Name:   www.google.com
Address: 172.217.19.100

% sudo ifconfig en0 down % 
ping 172.217.19.10 
PING 172.217.19.10 (172.217.19.10): 56 data bytes 
64 bytes from 172.217.19.10: icmp_seq=0 ttl=113 time=127.881 ms
64 bytes from 172.217.19.10: icmp_seq=l ttl=113 time=129.241 ms
64 bytes from 172.217.19.10: icmp_seq=2 ttl=113 time=128.347 ms
64 bytes from 172.217.19.10: icmp_seq=3 ttl=113 time=128.451 ms
^C
— 172.217.19.10 ping statistics —
4 packets transmitted, 4 packets received, 0.0% packet loss 
round-trip min/avg/max/stddev = 127.881/128.480/129.241/0.489 ms
%

UPDATE # 6 as per jksoegaard's update:

networksetup -setdnsservers Ethernet 1.1.1.1

didn't help. Here's the output of the other 2 commands:

% dig @1.1.1.1 www.google.com

; <<>> DiG 9.10.6 <<>> @1.1.1.1 www.google.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached
% nslookup www.google.com

;; connection timed out; no servers could be reached

% 
  • Do you turn off wifi when connected via Ethernet? Can you ping 8.8.8.8? – Allan Oct 16 at 22:12
  • @Allan yes and yes, please see my update – yssup Oct 17 at 8:47
  • if you can ping that 8.8.8.8 IP then Internet is working. Can you ping www.apple.com? – Allan Oct 17 at 13:28
  • @Allan Well, I can't browse any website nor connect to the VPN. I'm unable to ping www.apple.com, but I'm able to ping their IP address 2.23.109.203 (found using nslookup www.apple.com) – yssup Oct 17 at 13:51
  • That's a DNS issue. Start by flushing your DNS cache. Type the following command: sudo killall -HUP mDNSResponder then try pining apple.com again – Allan Oct 17 at 14:10
1

According to your question you can access local network devices when on cabled LAN. You have set your DNS server to 8.8.8.8, but still cannot lookup names.

You're able to ping your router at 192.168.1.1 and other local devices, but not internet servers such as apple.com or google.com.

This suggests to me that your problem is that the default gateway is set incorrectly. Fix it this way:

  1. Open System Preferences > Network

  2. Choose the Ethernet port in the list on the left

  3. Ensure the Router field is set to: 192.168.1.1

If it is setup to use DHCP, take a note of your IP address, subnet mask and router addresses, and then change the setting "Configure IPv4" to "Manually" and enter the same values - however note that router should be set to 192.168.1.1.

After applying, you should be able to access web sites and ping servers on the Internet.

You can also try changing this from the Terminal by running:

route add default 192.168.1.1

UPDATE:

Your new update indicates now that you can ping outside IPs successfully, but not when using domain names. This means this is a DNS issue, and not a routing issue.

Change the DNS server IP like this in the Terminal:

networksetup -setdnsservers Ethernet 1.1.1.1

Then check if web sites start working. If not, run these two commands in the Terminal:

dig @1.1.1.1 www.google.com
nslookup www.google.com

The output should tell if it is at all possible to lookup DNS via 1.1.1.1 (if not, you probably have some sort of firewall or filtering issue) - or it is due to the specified DNS server not actually being used at all.

| improve this answer | |
  • Did not help, please see my update. – yssup Oct 18 at 11:50
  • @yssup Your update indicates now that you can ping outside IPs successfully... then this is only a DNS issue, and not a routing issue. I have updated the answer accordingly. – jksoegaard Oct 18 at 12:36
  • Please see update. – yssup Oct 18 at 13:46
  • @yssup This indicates that there's something filtering your DNS requests. Try connecting to WiFi and check in System Preferences => Network which IP-address the DNS server has when connected via WiFi. Then use the same DNS IP address when you're cabled network. Did that work? ... I assume you have some kind of "safe dns" filter enforced by an ISP, or an employer, or similar. – jksoegaard Oct 18 at 15:17
  • My DNS server address is 8.8.8.8 under the DNS tab in the Advanced window of my Wi-Fi network settings. – yssup Oct 18 at 15:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .