Ping works from guest(linux) towards internet but Curl/Wget doest not
Describe the issue
I have a very weird networking issue on the guest side, so far all the things looks good and ping works but curl / wget doesnot works ( network mode is in shared network mode)
I have created a vm ubuntu 22.04 x86_64 which using the official iso image.
After installation and reboot i get the ipaddress from dhcp
and on Guest i see following
routes
ip r
default via 192.168.64.1 dev enp0s1 proto dhcp src 192.168.64.2 metric 100
192.168.64.0/24 dev enp0s1 proto kernel scope link src 192.168.64.2 metric 100
192.168.64.1 dev enp0s1 proto dhcp scope link src 192.168.64.2 metric 100
I am able to successfully login form hostVM to the guest VM using ssh
ssh [email protected]
Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-60-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Thu May 25 02:20:20 PM UTC 2023
System load: 0.92626953125
Usage of /: 41.1% of 13.16GB
I am able to ping towards internet
ping goole.com
PING goole.com (217.160.0.201) 56(84) bytes of data.
64 bytes from 217-160-0-201.elastic-ssl.ui-r.com (217.160.0.201): icmp_seq=1 ttl=52 time=57.8 ms
64 bytes from 217-160-0-201.elastic-ssl.ui-r.com (217.160.0.201): icmp_seq=2 ttl=52 time=60.1 ms
64 bytes from 217-160-0-201.elastic-ssl.ui-r.com (217.160.0.201): icmp_seq=3 ttl=52 time=53.9 ms
However i cannot make Tcp based connection either via telnet or via curl
telnet goole.com 443
Trying 217.160.0.201...
telnet: Unable to connect to remote host: Connection refused
curl -v https://www.google.com
* Trying 142.250.74.68:443...
* connect to 142.250.74.68 port 443 failed: Connection refused
* Trying 2a00:1450:400f:802::2004:443...
* Immediate connect fail for 2a00:1450:400f:802::2004: Network is unreachable
* Failed to connect to www.google.com port 443 after 51 ms: Connection refused
* Closing connection 0
curl: (7) Failed to connect to www.google.com port 443 after 51 ms: Connection refused
On my host ( mac os i see this bridge interface)
bridge100: flags=8a63<UP,BROADCAST,SMART,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
options=3<RXCSUM,TXCSUM>
ether be:d0:74:94:6f:64
inet 192.168.64.1 netmask 0xffffff00 broadcast 192.168.64.255
inet6 fe80::bcd0:74ff:fe94:6f64%bridge100 prefixlen 64 scopeid 0x1c
inet6 fdea:8a95:8314:ecb0:10ec:e47d:9e71:f561 prefixlen 64 autoconf secured
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x0
member: vmenet0 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 27 priority 0 path cost 0
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
Configuration
- UTM Version: 4.2.5
- macOS Version: 13.4 (22F66)
- Mac Chip (Intel, M1, ...): M1
Debug log
debug.log
Additionally , i am unble to make any changes in network mode via UI. ( ie can see all the 4 option ) but only can select shared network mode.
Weird.
I have the same configuration: Ubuntu 22.04LTS x86-64 running under UTM 4.2.5 on macOS 13.3 M1.
When I do curl -v https://www.google.com from the terminal it spews a lot of (javascript) vomit which is actually the contents of the site.
Try sudo apt update && sudo apt update and reinstalling curl.
Thanks for testing,
For me , Since it does not have internet access both sudo apt update && sudo apt update fails.
seems like your macOS is at 13.3, and mine is at 13.4 could that be an issue..
Let me check in another mac of mine to confirm it.
@sudhirpandey did you find a solution for this? Running on an M4 MacBook Pro on macOS 15.5, my ARM64 Debian 12 installs can NEVER get proper internet connectivity.
Ping works fine, however, wget to any website ALWAYS fails. If I repeat this with an Ubuntu installer, it works fine.
I have noticed that UTM requires you to tweak down the MTU (no, I'm not joking; there is an UTM MTU problem!) from the default 1500. A typical symptom is that really small payloads can be transferred fine but anything large fails. On a Mac guest, try networksetup -setMTU en0 1400; on Linux (specifically Debian) I used sudo ip link set dev enp0s1 mtu 1400 (obviously change enp0s1 to whichever network device you are using for your default route; ip a displays your route table). This is using "Shared Network" mode.