ubuntu设置静态ip

1. 配置静态ip地址

$sudo vi /etc/network/interfaces

原有内容只有如下两行:

auto lo

iface lo inet loopback

向末尾追加以下内容:

auto eth0

iface eth0 inet static

address 192.168.0.33

gateway 192.168.0.1

netmask 255.255.255.0

network 192.168.0.0

broadcast 192.168.0.255

然后保存退出;

2. 手动配置 dns

$sudo vi /etc/resolv.conf

想末尾追加如下内容:

nameserver 192.168.0.10

然后保存退出。

3. 重启 network 使修改生效

$sudo ipdown eth0

$sudo ipup eth0

$ifconfig

时间: 2024-07-31 14:42:42

ubuntu设置静态ip的相关文章

Ubuntu设置静态IP以及DNS

Introduce 安装虚拟机无法DHCP获取地址,搜了点资料设置成功,记下来以后好找文档. 设置静态IP vi /etc/network/interfaces # The primary network interface auto eth0 #表示让网卡开机自动挂载eth0 iface eth0 inet static address 192.168.2.1 gateway 192.168.2.254 netmask 255.255.255.0 /etc/init.d/networking

虚拟机ubuntu设置静态IP与主机、外网互ping配置流程

方案一.VMnet8(NAT模式) 1.选择自定义模式,VMnet8(NAT模式) 2.进入虚拟机,设置静态IP之前确认三者可互ping通,命令ifconfig,查看当前的IP 3.主机通过命令ipconfig查看主机的IP地址,注意是VMnet8的IP 4.配置虚拟机. 5.设置静态IP,命令vim /etc/network/interfaces ,添加以下命令: auto eth0iface eth0 inet staticaddress 10.4.99.128(设置的IP地址)gatewa

Ubuntu 设置静态ip地址

1. 找到文件并作如下修改: sudo vim /etc/network/interfaces 修改如下部分: auto eth0iface eth0 inet staticaddress 192.168.0.117gateway 192.168.0.1 #这个地址你要确认下 网关是不是这个地址netmask 255.255.255.0network 192.168.0.0broadcast 192.168.0.255 2. 修改dns解析 因为以前是dhcp解析,所以会自动分配dns服务器地址

ubuntu设置静态ip地址

每次设置都忘了之前怎么设置的,所以今天记录下来. 1. 找到文件并作如下修改: sudo vim /etc/network/interfaces 修改如下部分: auto eth0iface eth0 inet staticaddress 192.168.0.7gateway 192.168.0.1 #这个地址你要确认下 网关是不是这个地址netmask 255.255.255.0network 192.168.0.0broadcast 192.168.0.255 2. 修改dns解析 因为以前

ubuntu 设置静态IP GW

网卡配置静态IP地址 编辑文件/etc/network/interfaces: sudo vi /etc/network/interfaces 并用下面的行来替换有关eth0的行:# The primary network interface auto eth0 iface eth0 inet static address 192.168.3.90 gateway 192.168.3.1 netmask 255.255.255.0 #network 192.168.3.0 #broadcast

centos ubuntu 设置静态IP

ubuntu官网:https://help.ubuntu.com/lts/serverguide/network-configuration.html centos: 网卡信息查询: dmesg | grep -in eth lspci | grep -i ethernet网卡模块:lsmod | grep 1000 配置文件路径:/etc/sysconfig/network-sripts/ifcfg-eth0 1 DEVICE=“eth0" 网卡名称 2 HWADDR=”“ MAC地址,只有一

给ubuntu设置静态ip —— How to set static IP Address in Ubuntu Server 16.04

原文: http://www.configserverfirewall.com/ubuntu-linux/ubuntu-set-static-ip-address/ ------------------------------------------------------------------------------------------------- How to set static IP Address in Ubuntu Server 16.04 It is really impo

ubuntu 设置静态IP

首先修改网卡的配置文件 vim /etc/network/interfaces 然后修改静态的 DNS vim /etc/resolv.conf 最后重启网卡,使配置生效 /etc/init.d/networking restart

VMware下为Ubuntu设置静态IP

参考:http://www.cnblogs.com/objectorl/archive/2012/09/27/vmware-ubuntu-nat-static-ip-settings.html