Solved I receive "No route to host" when I ping an IP adress.

I recently installed FreeBSD 12.1 on my computer.
After connecting the computer to the modem with a LAN cable, I realized that if I ping 8.8.8.8 or any other IP address, the output of the command is "No route to host".
I realized that there is no file named resolv.conf in /etc, so I made one and put this text in it and rebooted my computer. But the problem was still not fixed
Code:
nameserver 8.8.8.8
nameserver 8.4.4.8
Edit: wireless network has the same problem
 
After connecting the computer to the modem with a LAN cable, I realized that if I ping 8.8.8.8 or any other IP address, the output of the command is "No route to host".
Is your network interface configured? Did you enable DHCP or did you use static addresses? Look at the output from ifconfig(8).

I realized that there is no file named resolv.conf in /etc,
That file is only required for name resolving, i.e. translating hostnames to IP addresses. It has no influence on basic TCP/IP connectivity. If there's no basic TCP/IP connectivity there would be no name resolving but without name resolving basic TCP/IP still works.
 
Is your network interface configured? Did you enable DHCP or did you use static addresses? Look at the output from ifconfig(8).


That file is only required for name resolving, i.e. translating hostnames to IP addresses. It has no influence on basic TCP/IP connectivity. If there's no basic TCP/IP connectivity there would be no name resolving but without name resolving basic TCP/IP still works.
Well I released that on other OS I installed on my computer(Linux) I have the same problem. It's probably from my network card.
 
Post the output from ifconfig(8).
WhatsApp Image 2020-08-13 at 6.15.06 PM.jpeg
 
The msk0 doesn't show there's a connection attached. Media is still set to auto-detect and there's no status. A connected ethernet would show status: active and the media would indicate the connected speed and duplex settings.
 
After connecting the computer to the modem with a LAN cable, I realized that if I ping 8.8.8.8 or any other IP address, the output of the command is "No route to host".
There is a discrepancy in the information you provided. You asked about a wired connection but your screenshots show a wireless connection.
 
The msk0 doesn't show there's a connection attached. Media is still set to auto-detect and there's no status. A connected ethernet would show status: active and the media would indicate the connected speed and duplex settings.
I connected by wireless network when I saw I can't connect to the internet by LAN cable. But the problem is still
 
Do you have ping to your default gateway at 192.168.8.1 ?

p.s.
resolv.conf is generated by resolvconf when you get your DNS settings via DHCP or manually when you setup your network via bsdconfig
 
That means you have connectivity and the issue is not with FreeBSD's configuration. You need to check your router and see if these packets are correctly NAT'ed and sent to the internet.
 
Yes it's look good.
Check the routing on your router or try traceroute -n 8.8.8.8 and route show 8.8.8.8

Edit:
Are you trying to connect to your router via LAN cable or Wireless? I just re-read your initial post and i get confused.
 
That means you have connectivity and the issue is not with FreeBSD's configuration. You need to check your router and see if these packets are correctly NAT'ed and sent to the internet.
As I said the problem is most likely from my network card. I'm sure the router works correctly because other devices can easily connect to the Internet through this router. I will configure and test another network card from my computer to see if the problem is resolved.
 
Yes it's look good.
Check the routing on your router or try traceroute -n 8.8.8.8 and route show 8.8.8.8

Edit:
Are you trying to connect to your router via LAN cable or Wireless? I just re-read your initial post and i get confused.
I tried both and they both had this problem
WhatsApp Image 2020-08-13 at 8.09.33 PM.jpeg
WhatsApp Image 2020-08-13 at 8.10.53 PM.jpeg
 
During your traceroute the message "network is down" mean that your wifi is no longer associated (connected) to the access point.

Can you post the content of your /etc/rc.conf
 
During your traceroute the message "network is down" mean that your wifi is no longer associated (connected) to the access point.

Can you post the content of your /etc/rc.conf
Code:
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA DHCP"
sshd_enable="YES"
moused_enable="YES
ntpd_enable="YES"
dempdev="AUTO"
 
Back
Top