Ubuntu设置IP
来源:互联网 发布:linux 端口没有监听 编辑:程序博客网 时间:2024/06/07 12:52
一、配置ip
ubuntu的网络配置信息放在/etc/network/interfaces 中,操作:
sudo vim /etc/network/interfaces
如果配置动态获取ip,则在上述文件中加入以下内容:(注:服务器通常不用动态IP)
auto eth0
iface eth0 inet dhcp
如果配置静态ip,则添加如下内容:
auto eth0
iface eth0 inet static
address 192.168.1.201
netmask 255.255.255.0
gateway 192.168.1.1
要是配置生效,需要重启网卡:
ifconfig eth0 down
ifconfig eth0 up
接着用ifconfig命令查看ip是否配置成功
若还有没有配置成功,则需重启下网络服务
/etc/init.d/networking restart
二、配置dns服务器
ubuntu 的dns服务器信息,放在/etc/resolv.conf中,
添加dns服务器地址,如100.110.105.53,则在上述文件中加入
nameserver 100.110.105.53
ubuntu的网络配置信息放在/etc/network/interfaces 中,操作:
sudo vim /etc/network/interfaces
如果配置动态获取ip,则在上述文件中加入以下内容:(注:服务器通常不用动态IP)
auto eth0
iface eth0 inet dhcp
如果配置静态ip,则添加如下内容:
auto eth0
iface eth0 inet static
address 192.168.1.201
netmask 255.255.255.0
gateway 192.168.1.1
要是配置生效,需要重启网卡:
ifconfig eth0 down
ifconfig eth0 up
接着用ifconfig命令查看ip是否配置成功
若还有没有配置成功,则需重启下网络服务
/etc/init.d/networking restart
二、配置dns服务器
ubuntu 的dns服务器信息,放在/etc/resolv.conf中,
添加dns服务器地址,如100.110.105.53,则在上述文件中加入
nameserver 100.110.105.53
阅读全文
0 0
- ubuntu 7.04 IP设置
- Ubuntu网络IP设置
- ubuntu设置静态IP
- Ubuntu设置静态IP
- ubuntu设置ip
- ubuntu设置IP地址
- ubuntu ip设置
- Ubuntu设置静态 IP
- Ubuntu虚拟机ip设置
- ubuntu ip静态设置
- Ubuntu的ip设置
- Ubuntu设置静态IP
- Ubuntu的ip设置
- Ubuntu设置固定IP
- ubuntu 设置静态IP
- ubuntu设置ip地址
- ubuntu设置固定IP
- Ubuntu IP 相关设置
- 打造扛得住的MySQL数据库架构-第一课--影响数据库性能的因素
- 通过Roslyn构建自己的C#脚本(更新版)
- 依赖注入之Autofac使用总结
- Web前端知识体系精简
- 谈一下我们是怎么做数据库单元测试(Database Unit Test)的
- Ubuntu设置IP
- .Net Core 图片文件上传下载
- 数据结构导论第一章导图
- DllImport 自动选择x64或x86 dll
- 来腾讯云开发者实验室 学习.NET
- 不请自来 | Redis 未授权访问漏洞深度利用
- WebAssembly,开发者赢了
- JS中的事件冒泡
- Unity 游戏用XLua的HotFix实现热更原理揭秘