ubuntu 13.04 设定静态IP
切换到root用户,然后进入/etc/network目录。备份interfaces文件(备份文件是一个好习惯)
下面编辑interfaces文件,添加如下语句:
# Assgin static IP by eric on -SEP-
iface eth0 inet static
address 192.168.196.135 #change to your static IP
netmask 255.255.255.0 #change to your netmask
gateway 192.168.196.255 #change to your getway
#We must specify dns-nameserver here
#in order to get internet access from host
dns-nameservers 192.168.196.255
auto eth0
编辑完成后的interfaces文件内容如下:
root@ubuntu:/etc/network# cat interfaces
# interfaces() file used by ifup() and ifdown()
auto lo
iface lo inet loopback #add by andy at --
# Assgin static IP by eric on -SEP-
iface eth0 inet static
address 192.168.196.135 #change to your static IP
netmask 255.255.255.0 #change to your netmask
gateway 192.168.196.255 #change to your getway
#We must specify dns-nameserver here
#in order to get internet access from host
dns-nameservers 192.168.196.255
auto eth0
下一步就是重启网卡:
root@ubuntu:/etc/network# /etc/init.d/networking restart
重启完成后,测试一下:
root@ubuntu:/etc/network# ping www.baidu.com.cn
PING www.a.shifen.com (220.181.112.244) () bytes of data.
bytes from 220.181.112.244: icmp_req= ttl= time=6.12 ms
bytes from 220.181.112.244: icmp_req= ttl= time=14.7 ms
OK。静态IP设置完成。
ubuntu 13.04 设定静态IP的更多相关文章
- Ubuntu 14.04 配置静态IP
命令行手工配置静态IP比较麻烦,记录于此备查. 1,ubuntu的网络配置文件在: # /etc/network/interfaces //这个文件里 2,默认安装时,网络配置是使用DHCP自动分配I ...
- ubuntu 18.04配置静态ip,解决无法上网问题,解决resolv.conf配置文件被覆盖
Netplan 是 Ubuntu 17.10 中引入的一种新的命令行网络配置实用程序,用于在 Ubuntu 系统中轻松管理和配置网络设置. 它允许您使用 YAML 格式的描述文件来抽像化定义网络接口的 ...
- ubuntu 16.04 配置静态ip 后默认的网卡eno1变成eth0了不能联网的问题解决
我这次是在真实机器上面安装的ubuntu16.04 在配置了静态ip后不懂什么原因默认的eno1网卡变回了eth0网卡之后就不能上网, 同一个网段的其他集群节点也不能ping 通 因为ubuntu16 ...
- Ubuntu 18.04 更改静态IP
2018年4月26日,ubuntu 18.04发行,第一时间下载安装了SERVER版本.使用VM14版本的虚拟机,开始使用DHCP获得IP地址,没有意外,可以直接上网.然而在更改VM的网络模式为桥接模 ...
- ubuntu 18.04 设置静态ip方法
1. 前言 本教程将会演示如何设置Ubuntu16.04 Server版和Ubuntu18.04 Server版系统的静态固定IP地址. 2. 确认你要修改的网卡号 先确认你要修改的网卡号,假设你的服 ...
- Ubuntu 16.04 设置静态IP 注意事项
目录 查看动态ip下的网络信息 查看默认网关 设置静态网络 查看动态ip下的网络信息 1 ifconifg # 查看网卡信息: 可以看出网口名称为 eno1, 以及子网掩码(mask) 查看默认网关 ...
- Ubuntu 14.04 设置静态IP
使用Network Manager UI界面中指定 手动时,无法保存. 通过修改配置文件解决来此问题.记录以下. 如果输入过密码后,就会出现在这个目录下面, 以如下chinaNet为例 gaojing ...
- [转载]Ubuntu 14.04设置固定ip
参考链接: ubuntu14.04设置静态ip Ubuntu10.10的网络配置 (总结的比较好些) 由于我的虚拟机中的Ubuntu 14.04中,只安装了一个gitlab,gitlab中配置了固定i ...
- Ubuntu12.04配置静态ip地址
Ubuntu12.04配置静态ip地址 $sudo gedit /etc/network/interfaces 原有内容只有如下两行: auto lo iface lo inet loopback 向 ...
随机推荐
- PS 如何附加增效工具.
编辑-首选项-增效工具,选择目标增效工具文件夹
- 显式启动Activity和隐式启动Activity
1.显式启动Intent intent = new Intent(this, class);startActivity(intent); 2.隐式启动AndroidManifest.xml中定义某个A ...
- Linux 查看某个程序所在端口的 PID
lsof -i:8085 加入显示的是2001 kill 2001 就可以杀死程序了
- (五)Thymeleaf标准表达式之——[7->8]条件表达式& 默认表达式
2.7 条件表达式 模板名称:condition-express.html <1>a ? b:c (if then:else) <2>a?c (if else) 条件表达式( ...
- WebLogicSSL解决苹果IOS itms下载问题
前提: 安装好openssl工具. 通过windows cmd 命令进入 openssl工作文件夹 如解压文件夹为:E:\ openssl-1.0.2-beta1 则工作文件夹为E:\openssl- ...
- day14—JQuery编程基础
JQuery 1.什么是jQuery jQuery是一个优秀的JavaScript框架.一个轻量级的JavaScript类库.jQuery的核心理念是Write less.Do more. 使用jQu ...
- js 元素Dom新建并插入页面createElement
纯js var o = document.createElement('script'); o.type = 'text/template'; o.id = 'demo'; document.docu ...
- sklearn函数白板
#使用make_classification构造500个样本,每个样本有20个feature from sklearn.datasets import make_classification X, y ...
- spark+kafka 小案例
(1)下载kafka的jar包 http://kafka.apache.org/downloads spark2.1 支持kafka0.8.2.1以上的jar,我是spark2.0.2,下载的kafk ...
- apache重定向无效
这个问题让我纠结了蛮久啊,因为之前一直不注意SEO,网站带www和不带www的一级域名都被收录了,而且不知道为什么不带www的一级域名被收录比www还多,这可不是我的初衷!这次吸取教训了,以后再开站不 ...