首页 > 代码库 > ping: sendto: No route to host

ping: sendto: No route to host

root@tuhooo:/home/ # ping www.baidu.com
PING www.a.shifen.com (61.135.169.125): 56 data bytes
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host

 

解决办法

emacs /etc/rc.conf

 

hostname="tuhooo"
ifconfig_em0="inet 192.168.31.130 netmask 255.255.255.0"
ifconfig_em0_ipv6="inet6 accept_rtadv"
 defaultrouter="192.168.31.2" # 设置默认网关                                         
sshd_enable="YES"
ntpd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable                      
dumpdev="AUTO"
 
ntpdate_enable="YES"

ntpdate_program="ntpdate"
ntpdate_flags="0.cn.pool.ntp.org"

mysql_enable="YES"

ping: sendto: No route to host