巴中網(wǎng)站建設(shè)免費自助建站網(wǎng)站
網(wǎng)絡(luò)配置
使能網(wǎng)卡
使用ip link
查看是否存在eth0網(wǎng)卡,若無使用如下命令使能網(wǎng)卡:
ip link set eth0 up
兩次使用ip link
確認網(wǎng)卡eth0已經(jīng)使能。
配置IP、gws
本人設(shè)備連接到華為路由器下,故增加如下路由信息:
ip route add default via 192.168.3.1 dev eth0
ip route add 192.168.3.0/24 dev eth0 scope link src 192.168.3.130
配置dns
echo "nameserver 114.114.114.114" >> /etc/resolv.conf
記得使用cat出來,檢查無誤
ping包測試
[root@milkv]~# ping www.bing.com
PING www.bing.com (202.89.233.101): 56 data bytes
64 bytes from 202.89.233.101: seq=0 ttl=118 time=33.948 ms
64 bytes from 202.89.233.101: seq=1 ttl=118 time=33.871 ms