Ubuntu Server 12.04(14.04) 静态IP简洁配置
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(14.04) 静态IP简洁配置的更多相关文章
- Ubuntu Server 12.04 静态IP简洁配置
PS:很长时间没使用Ubuntu了,刚才安装个Ubuntu Server 12.04做测试.Ubuntu的网络设置跟Redhat系是不一样的,配置IP时发现跟以前的Ubuntu桌面版本也有所不同,记录 ...
- 【转】Ubuntu Server 12.04 静态IP简洁配置
原文网址:http://blog.csdn.net/njchenyi/article/details/8715417 1.配置静态IP地址: # vim /etc/network/interfaces ...
- U盘安装ubuntu server 12.04的问题检测不到CDROM的解决
U盘安装ubuntu server 12.04的问题检测不到CDROM的解决 ========================== 我是u盘安装ubuntu 14 64Bit 也是出现同样的问题 用u ...
- [Linux] Ubuntu Server 12.04 LTS 平台上搭建WordPress(Nginx+MySql+PHP) Part II
接着上一节继续搭建我们的LNMP平台,接下来我们安装PHP相关的服务 sudo apt-get install php5-cli php5-cgi php5-fpm php5-mcrypt php5- ...
- vagrant Ubuntu server 12.04 dpkg: dependency problems prevent configuration of python-gi
Ubuntu server 12.04因为尝试安装过xfce,导致sudo apt-get install xxx 都会返回,如: vagrant@precise32:~$ sudo apt-get ...
- 安装Drupal7.12+Postgresql9.1(Ubuntu Server 12.04)
怀揣着为中小企业量身定做一整套开源软件解决方案的梦想开始了一个网站的搭建.http://osssme.org/ OS环境准备 这次是从OS开始安装的.最开始装Ubuntu12.04这里就不再赘述, 唯 ...
- CVE-2015-1328 Ubuntu 12.04, 14.04, 14.10, 15.04 overlayfs Local Root
catalog . 引言 . Description . Effected Scope . Exploit Analysis . Principle Of Vulnerability . Patch ...
- [Linux] Ubuntu Server 12.04 LTS 平台上搭建WordPress(Nginx+MySQL+PHP) Part IV
接下来我们去下载 WorePress 用最新的 3.7.1 下载地址是:http://cn.wordpress.org/wordpress-3.7.1-zh_CN.zip 我们先建立一个文件夹 /va ...
- Ubuntu Server 12.04安装图解教程
Ubuntu S ...
随机推荐
- 【转载】汇编调试程序Debug使用
https://blog.csdn.net/Notzuonotdied/article/details/70888205
- Leetcode经典试题:Longest Substring Without Repeating Characters解析
题目如下: Given a string, find the length of the longest substring without repeating characters. Example ...
- docker学习------centos7.5下的swarm集群可视化构建
1.swarm集群 manager : 192.168.211.175 agent1 : 192.168.211.176 agent2 : 192.168.211.177 2.环境 ...
- #1 macos和windows下对多Python环境配置的记录
为啥会发现环节配置的问题 因为scrapy的setting前期走弯路的时候,碰到了修改了Windows下的Python中的scrapy的默认setting,但是我电脑上还有anaconda,而且我是使 ...
- asp.net core NLog将日志写到文件
1.安装Nlog包 Install-Package NLog.Extensions.Logging -Pre 2.在项目添加nlog.config文件 2.1.nlog.config <?xml ...
- sketch格式文件转换成psd
在做响应式页面的时间需要把px单位转换成rem才可以,但是sketch文件的格式不能随意转换成rem,最高只能到CSS rem 16px,不能满足我们的需求,因此需要一个工具来转换成psd格式文件,他 ...
- Mac终端命令自动补全
在这里我们首先说一下mac终端执行命令的时候,不会像在windows系统中安装的linux一样支持自动补全,需要自己去调试 步骤如下: (1)打开终端输入nano .inputrc(这里一定要注意na ...
- spring.http.multipart.maxFileSize提示无效报错问题处理
在SpringBoot项目中,配置spring.http.multipart.maxFileSize用于限定最大文件上传大小. 但是,SpringBoot版本不同,关于这一块的配置也不相同. 1.Sp ...
- 通过配置文件新建solr的core
目录solr-7.5.0\server\solr 1. 新建文件夹 test-core 2. 在文件夹test-core下新建core.properties name=test-core confi ...
- tftp--实现服务器与客户端的下载与上传【转】
转自:https://blog.csdn.net/xiaopangzi313/article/details/9122975 版权声明:本文为博主原创文章,未经博主允许不得转载. https://bl ...