標籤:des blog http io 檔案 問題 html htm
之前在hyper-v中裝了openwrt的ATTITUDE ADJUSTMENT (12.09, r36088)這個最新版本 我之前的文章有提到怎麼安裝 link
但是發現用opkg update不能用,說wget不能連到openwrt.org這個網路
發現ping也ping不同baidu.com,出現提示
[email protected]:~# ping baidu.com
ping: bad address ‘baidu.com‘
是dns解析問題,在/etc/resolv.conf中,添加我家的網關:192.168.100.1
在檔案中添加:
nameserver 192.168.100.1
現在再ping baidu.com
[email protected]:~# ping www.baidu.com
PING www.baidu.com (119.75.217.56): 56 data bytes
ping: sendto: Network is unreachable
發現路由應該不正確
所以查看了一下路由:
[email protected]:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.100.0 * 255.255.255.0 U 0 0 0 br-lan
沒有default,所以連不上外面的網路
後來我不假思索的就寫了個
route add 0.0.0.0 netmask 0.0.0.0 gw 192.168.100.1
結果還是連不上,route的結果和我預想的不一樣
default 192.168.100.1 255.255.255.255 UGH 0 0 0 br-lan
掩碼是255.255.255.255
所以就去多方尋找,看手冊等,找到要用橋接的方式連就可以了
route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.100.1 dev br-lan