Ubuntu配置IP
来源:互联网 发布:简单的网络通信协议 编辑:程序博客网 时间:2024/06/06 00:21
Ubuntu配置IP
- Ubuntu配置IP
- 描述
- 操作
- DHCP方式配置网卡
- 配置静态IP地址
- 配置DNS
- 配置文件生效
- 参考
描述
由于需要,有时候需要给服务器/PC配置静态的IP,为了以后查关键字方便,在博客这里记一下。
操作
1. DHCP方式配置网卡
配置文件:
$ sudo vim /etc/network/interfaces
修改:
# The primary network interface - use DHCP to find our addressauto eth0iface eth0 inet dhcp
2. 配置静态IP地址
仍然修改相同的配置文件:
# The primary network interfaceauto eth0iface eth0 inet staticaddress 192.168.3.90gateway 192.168.3.1netmask 255.255.255.0#network 192.168.3.0#broadcast 192.168.3.255
其中的IP地址和网关等,填写自己的地址等信息。
3. 配置DNS
配置文件:
$ sudo vim /etc/resolv.conf
添加:
nameserver 8.8.8.8nameserver 10.8.4.4nameserver 10.8.8.8
DNS也可以填写自己的localhost,或者选择google的DNS等,一个或多个均可。
4. 配置文件生效
配置完对应的配置文件,需要使其生效:
$ sudo /etc/init.d/networking restart
参考
Ubuntu命令行修改网络配置方法
0 0
- ubuntu配置IP
- ubuntu配置IP & DNS
- ubuntu命令配置IP
- Ubuntu Server 配置IP
- ubuntu配置静态IP
- linux ubuntu IP配置
- ubuntu的ip配置
- Ubuntu 配置ip
- ubuntu ip配置
- Ubuntu配置ip
- ubuntu配置ip dns
- Ubuntu Server 配置IP
- ubuntu配置静态ip
- ubuntu静态IP配置
- ubuntu ip配置
- 配置Ubuntu的IP
- Ubuntu配置IP、DNS
- Ubuntu Server 配置IP
- linux如何进入图形界面
- 妈的,好久没写博客了,搞个收藏吧
- cd---命令cmd打开文件夹
- apache和tomcat
- C Primer Plus8-6
- Ubuntu配置IP
- easyui控件与Activex控件遮挡问题
- UISegmentedControl小技巧
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下
- AJAX笔记
- Android5.0材料设计(三)
- 命令中运行jar文件
- iOS 【原生API NSURLConnection 网络请求】
- JSP 概述