如果当前你连接的无线网络内有dhcp服务器的话
直接输入
dhclient ath0
返回结果类似于
Internet Software Consortium DHCP Client 2.0pl5
Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
All rights reserved.
eth1: unknown hardware address type 24
eth1: unknown hardware address type 24
Listening on LPF/ath0/00:02:6f:20:14:81
Sending on LPF/ath0/00:02:6f:20:14:81
Sending on Socket/fallback/fallback-net
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 7
DHCPOFFER from 192.168.0.254
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.254
bound to 192.168.0.152 -- renewal in 7200 seconds.
通过阅读返回结果,你可以确认是否被DHCP分配了IP地址信息等。
然后,你可以ping DHCP服务器来测试是否联通了。根据以上的返回信息,我们可以得到DHCP服务器的IP地址192.168.0.254
输入
ping 192.168.0.254
如果返回正常的ping结果,则网络联通了。