Ubuntu Server 12.04 静态IP简洁配置
来源:互联网 发布:eclipse js格式化 编辑:程序博客网 时间:2024/04/29 19:52
转自:http://blog.csdn.net/njchenyi/article/details/8715417
1、配置静态IP地址:
# vim /etc/network/interfaces
原内容有如下4行:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
以上表示默认使用DHCP分配IP,修改为如下:
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.80.129
netmask 255.255.255.0
gateway 192.168.80.2
保存退出。
注意:只需要设置address(IP地址)、netmask(子网掩码)、gateway(网关)这三项就OK,network和broadcast这两项参数是可以不写的。
2、手动设置DNS服务器:
# vim /etc/resolv.conf
添加如下内容(这点所有Linux发行版都通用):
nameserver 192.168.80.2
nameserver 8.8.8.8
保存退出。
注意:重启Ubuntu后发现又不能上网了,问题出在/etc/resolv.conf。重启后,此文件配置的dns又被自动修改为默认值。所以需要永久性修改DNS。方法如下:
# vim /etc/resolvconf/resolv.conf.d/base
nameserver 192.168.80.2
nameserver 8.8.8.8
3、重启networking服务使其生效:
# /etc/init.d/networking restart
这样网络配置就永久生效。
- Ubuntu Server 12.04 静态IP简洁配置
- Ubuntu Server 12.04 静态IP简洁配置
- Ubuntu Server 12.04 静态IP简洁配置
- Ubuntu Server 12.04 静态IP简洁配置
- Ubuntu Server 12.04静态IP简洁配置
- Ubuntu Server 12.04 静态IP简洁配置
- (总结)Ubuntu Server 12.04 静态IP简洁配置
- (总结)Ubuntu Server 12.04 静态IP简洁配置
- Ubuntu Server 12.04(14.04) 静态IP简洁配置
- Ubuntu静态IP简洁配置
- ubuntu server 12.04配置静态IP地址
- ubuntu server 12.04 静态IP
- Ubuntu Server 12.04(14.04)配置静态IP的方法
- Ubuntu Server Edition 配置静态IP地址
- ubuntu server 配置静态IP,无线上网
- Ubuntu server中静态IP配置
- Ubuntu Server 14.04 静态IP简单配置
- Ubuntu Server 16.04 配置静态IP
- W3C SQL 测验
- 多字段联合非重复验证 unique
- Android Volley框架的几种post提交请求方式
- iOS 滚动视图
- MySQL数据库设置主从同步
- Ubuntu Server 12.04 静态IP简洁配置
- 关于FP的一些概念
- C++头文件的编写--类在头文件中的写法
- DES, RC4, RC5, AES, RSA, MD5, SHA1 安全算法分析
- Spring定时任务的几种实现
- (转)设计模式六大原则(6):开闭原则
- Spring Web MVC 简介
- iOS开发UI篇—ios应用数据存储方式(偏好设置)
- Android5.0开关机模块——zygote进程