How to configure network interface in Ubuntu

如何在Ubuntu中配置静态IP地址
本文指导您如何在Ubuntu系统中通过编辑/etc/network/interfaces文件来配置静态IP地址,解决网络接口变动导致的IP地址频繁变化问题。
<?xml version="1.0" encoding="utf-8"?> How to configure network interface in Ubuntu

How to configure network interface in Ubuntu

It is likely that the computers in a network use dhcp to get ip addresses, that means these ip addresses will change frequently if you move the computer to another interface of the router or switch (which is exactly what I am facing right now), I want to configure my computer to use static ip address, the easiest way to do this is modify the configure file in /etc/network/interfaces, following these steps:
1.Use ifconfig to figure out which interface you are currently using (eth0/1); 2.Use ip route show to find the default gateway (the first line starting with default); 3.Sudo gedit /etc/network/interfaces:
Add the following information to that file:

iface eth0 inet static
address 172.31.8.22
gateway 192.31.8.1
netmask 255.255.255.0
dns-nameservers 202.202.0.33 8.8.8.8 8.8.4.4

4.Restart networking services:
sudo service network-manager restart
sudo service networking restart
sudo service resolvconf restart

Author: wujing

Created: 2014-12-25 四 10:06

Emacs 24.3.1 (Org mode 8.2.10)

转载于:https://www.cnblogs.com/wujingcqu/p/4183988.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值