linux
来源:互联网 发布:node js 离线文档 编辑:程序博客网 时间:2024/06/06 02:15
ubuntu下IP、DNS配置
一、配置ip
ubuntu的网络配置信息放在 /etc/network/interfaces 中,
如果配置动态获取ip,则在上述文件中加入以下内容:
auto eth0
iface eth0 inet dhcp
如果配置静态ip,则添加如下内容:
auto eth0
iface eth0 inet static
address 192.168.33.201
netmask 255.255.255.0
gateway 192.168.33.1
要是配置生效,需要重启网卡:
ifconfig eth0 down
ifconfig eth0 up
不是root,命令前面加sudo
接着用ifconfig命令查看ip是否配置成功,配置成功的结果如图一所示:
若还有没有配置成功,则需重启下网络服务
/etc/init.d/networking restart
二、配置dns服务器
ubuntu 的dns服务器信息,放在 /etc/resolv.conf中,
添加dns服务器地址,如202.112.125.53,则在上述文件中加入
nameserver 202.112.125.53
小结:
只要按上面的步骤配置完,就能上网了,如果还不行就重启下机器试试。
0 0
- linux
- linux
- Linux
- Linux
- LINUX!
- Linux
- linux
- linux
- linux
- Linux
- linux
- linux
- linux
- linux
- Linux
- linux
- linux
- Linux
- Multiplication Table
- 框架基本都是为了 解耦
- 转换到 COFF 期间失败: 文件无效或损坏
- Edit Distance
- 安卓中静默安装出现的权限问题
- linux
- Latex 设置字体和名称中文化
- web前端SEO--初识
- CSDN博客快速转载
- Ubuntu 16.04 安装 php 7 并支持 mysql_connect
- 最长增长子序列 LIS
- java获取文件MIME类型
- 一个渐变的优雅的分割线条(使用css定义)
- latex摘要栏设置