网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

DebianRedhat标准网卡配置

For  Debian Linux

成都创新互联专业为企业提供旅顺口网站建设、旅顺口做网站、旅顺口网站设计、旅顺口网站制作等企业网站建设、网页设计与制作、旅顺口企业网站模板建站服务,10余年旅顺口做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。

先临时设定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:~# 



重启网络
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

临时修改网卡IP
ifconfig eth0 172..16.0.5/16 up

添加网关 
route add default gw 172.16.0.111

临时修改默认的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

分享名称:DebianRedhat标准网卡配置
网页网址:http://bjjierui.cn/article/pssiij.html

其他资讯