Ubuntu Server 12.04 静态IP简洁配置

(总结)Ubuntu Server 12.04 静态IP简洁配置 PS:很长时间没使用Ubuntu了,刚才安装个Ubuntu Server 12.04做测试。Ubuntu网络设置跟Redhat系是不一样的,配置IP时发现跟以前的Ubuntu桌面版本也有所不同,记录如下: 1、配置静态IP地址: # vim /etc/network/interfaces 原内容有如下4行: auto lo iface lo inet loopback 阅读详情

PS:很长时间没使用Ubuntu了,刚才安装个Ubuntu Server 12.04做测试。Ubuntu的网络设置跟Redhat系是不一样的,配置IP时发现跟以前的Ubuntu桌面版本也有所不同,记录如下:

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

这样网络配置就永久生效。

 : http://www.ha97.com/4895.html

Ubuntu Server 12.04(14.04) 静态IP简洁配置 PS:经笔者测试,在ubuntu server14.04 下 阅读详情

相关推荐

unbuntu linux固定ip配置,(总结)Ubuntu Server 12.04 静态IP简洁配置

PS:很长时间没使用Ubuntu了,刚才安装个Ubuntu Server 12.04做测试。Ubuntu网络设置跟Redhat系是不一样的,配置IP时发现跟以前的Ubuntu桌面版本也有所不同,记录如下:1、配置静态IP地址:# vim /etc/network/interfaces原内容有如下4行:auto loiface lo inet loopbackauto eth0iface eth0...

weixin_36178269的博客 313

【转】Ubuntu Server 12.04 静态IP简洁配置

原文网址:http://blog.csdn.net/njchenyi/article/details/8715417 1、配置静态IP地址: # vim /etc/network/interfaces 原内容有如下4行:auto loiface lo inet loopback auto eth0iface eth0 inet dhcp 以上表示默认使用DHCP分配IP,修改为如下:au...

weixin_33782386的博客 80

Ubuntu Server 12.04静态IP简洁配置

1、配置静态IP地址: # vim /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source

weltion的专栏 353

Ubuntu18.04 Server设置静态IP

前言:Ubuntu18.04 server安装成功之后,有分配到ip,可以上网。但是遇到重启路由,Ubuntu serverip地址可能会变掉。鉴于在局域网内,一般还是选择固定serverip。 方案:下面有两种方式。ifconfig or ip a查询当前的网卡enp0s31f6,or ens33 .. Version >=ubuntu18.04,增加透过netplan来设定固定i...

平凡之路 8167

ubuntu20.04设置配置静态ip

ubuntu20.04设置配置静态ip方法 1. 前言 本教程将会演示Ubuntu20.04 Server版系统的静态固定IP地址。 2. 确认你要修改的网卡号 先确认你要修改的网卡号,假设你的服务器有多张网卡: 1 ubuntu2004:~$ ip addr 我的服务器配置如下: 1 2 3 4 5 6 7 8 9 10 11 12 1

johnhuster的专栏 1万+

Ubuntu Server 16.04 配置静态ip及动态ip

Ubuntu Server 16.04 配置静态ip及动态ip 首先把需要用的指令列出 查看当前网路配置 ifconfig 查看设备拥有的网卡 ip addr # ip link 查看当前连接商在网卡情况 ip route show default via 192.168.1.1 dev eth0 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.110 192.168.1.0/24 dev eth1 proto ker

youlinhuanyan的博客 1444

如何在 Ubuntu Server 22.04 上设置静态IP地址 ?

强烈建议在 linux 服务器上有一个静态 ip,因为它将在整个重新引导过程中保持持久。静态 IP 在邮件服务器、Web 服务器、文件服务器等服务器中扮演着重要的角色。

xiaochong0302的博客 5402

Ubuntu Server 22.04.5 LTS重启后IP被重置问题

本文详细描述了如何解决Ubuntu22.04系统在重启后IP地址被重置的问题

驴大毛的博客 1万+

Ubuntu Server 20.04 系统安装(二):为Ubuntu 20.04 设置静态IPUbuntu22.04 设置静态 IP 的方法】

最近需要折腾K8S,而折腾K8S的第一步就是为每台主机设置静态IP, 本文以Ubuntu20.04为例,提供一种为Linux设置静态IP的简明教程。本文Ubuntu20.04开始被随机分配的ip为,我们的目的是,关闭自由分配的配置选项,将主机的IP设置为静态ip?第1步:把冰箱门打开 第2步:把大象装进去!第3步:把冰箱门关上和一样简单(手动狗头)

u013250861的博客 7050
上一篇: ubuntu apt-get update 失败解决。
下一篇: Ubuntu Server 安裝 Unity 圖型界面
MemRay
博客等级 码龄18年 447粉丝 28原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值