For Debian Linux
成都創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供旅順口網(wǎng)站建設(shè)、旅順口做網(wǎng)站、旅順口網(wǎng)站設(shè)計、旅順口網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計與制作、旅順口企業(yè)網(wǎng)站模板建站服務(wù),10余年旅順口做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡(luò)服務(wù)。
先臨時設(shè)定ip,然后登陸上去 root@ubuntu:~# ifconfig eth0 10.11.12.2/24 root@raspberrypi:~# vim /etc/network/interfaces # Please note that this file is written to be used with dhcpcd. # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'. auto lo iface lo inet loopback #auto eth0 #allow-hotplug eth0 #iface eth0 inet manual auto eth0 iface eth0 inet static address 10.11.12.19 netmask 255.255.255.0 gateway 10.11.12.13 DNS-nameservers 180.76.76.76 223.5.5.5 auto wlan0 allow-hotplug wlan0 iface wlan0 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf auto wlan1 allow-hotplug wlan1 iface wlan1 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf root@raspberrypi:~# 重啟網(wǎng)絡(luò) root@ubuntu:~# ifdown eth0 && ifup eth0 或者: root@raspberrypi:~# /etc/init.d/networking restart [....] Restarting networking (via systemctl): networking.serviceWarning: Unit file of networking.service changed on disk, 'systemctl daemon-reload' recommended. . ok root@raspberrypi:~# echo $? 0 測試 root@raspberrypi:~# ping www.baidu.com PING www.a.shifen.com (115.239.210.27) 56(84) bytes of data. 64 bytes from 115.239.210.27: icmp_seq=1 ttl=57 time=2.76 ms 64 bytes from 115.239.210.27: icmp_seq=2 ttl=57 time=2.78 ms ^C --- www.a.shifen.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 2.761/2.770/2.780/0.053 ms root@raspberrypi:~#
For Redhat Linux
臨時修改網(wǎng)卡IP ifconfig eth0 172..16.0.5/16 up 添加網(wǎng)關(guān) route add default gw 172.16.0.111 臨時修改默認(rèn)的DNS vim /etc/resolv.conf vim /etc/sysconfig/network-scripts/ifcfg-eth2 DEVICE=eth2 HWADDR=00:0C:29:36:**:** TYPE=Ethernet UUID=7eaffa26-ee97-4d23-a333-a84da8341*** ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=static IPADDR=172.16.0.103 NETMASK=255.255.255.0 GATEWAY=172.16.0.111 DNS1=114.114.114.114 DNS2=8.8.8.8