ubuntu 网络设置
来源:互联网 发布:德尔三层实木地板知乎 编辑:程序博客网 时间:2024/05/22 16:16
1、服务器版本
设置IP地址
ubuntu 12.04的网络设置文件是/etc/network/interfaces,打开文件,会看到
auto loiface lo inet loopback
这边的设置是本地回路。在后面加上
auto eth0iface eth0 inet staticaddress 192.168.1.230(ip地址)netmask 255.255.255.0(子网掩码)gateway 192.168.1.1(网关)
其中eth0就是电脑的网卡,如果电脑有多块网卡,比如还会有eth1,都可以在这里进行设置。iface eth0 inet 设置为dhcp是动态获取IP,设置为static则用自定义的IP。这边要自定义IP地址,所以选择static选项。
重新启动网络服务
sudo /etc/init.d/networking restart
重启好后,用ifconfig看下eth0,是不是改成自己需要的IP地址了。
设置dns
ip设置好后,如果直接ping www.baidu.com会发现ping不通,因为dns还没设置,编辑/etc/resolv.conf,加上dns服务器地址。
nameserver 8.8.8.8nameserver 8.8.4.4
这两个是Google提供的免费DNS服务器的IP地址。
(因为每次重启电脑后他系统都自动修改DNS配置文件 /etc/resolv.conf,所以每次都要重新设置,特别麻烦; 解决方案:
/etc/resolv.conf中的DNS配置是从/etc/resolvconf/resolv.conf.d/head中加载而来
所以可以直接修改 /etc/resolvconf/resolv.conf.d/head文件,即把
nameserver 8.8.8.8nameserver 8.8.4.4
两行追加到文件中
)
0 0
- Ubuntu网络IP设置
- ubuntu网络设置
- Ubuntu设置网络代理
- Ubuntu网络设置详解
- ubuntu网络简单设置
- qemu网络设置 ubuntu
- ubuntu网络设置详解
- ubuntu网络代理设置
- ubuntu 虚拟机网络设置
- ubuntu网络设置详解
- ubuntu设置网络
- ubuntu 12.04 网络设置
- ubuntu网络设置
- ubuntu网络代理设置
- ubuntu网络设置
- ubuntu手动设置网络
- ubuntu网络设置
- ubuntu 设置网络
- 2015年2月5号工作日志----------------赵鑫
- 工作日志
- MPlayer编解码开发指导
- Android属性动画完全解析(上),初识属性动画的基本用法
- 例题8-4 传说中的车 UVa11134
- ubuntu 网络设置
- 扩展AndroidAnnotations使用MVP模式编程
- 链表学习总结
- (转)OpenCV滤波之copyMakeBorder和borderInterpolate
- iOS开发8:使用Tool Bar切换视图
- HDU 1431 素数回文
- ubuntu 12.04及12.10无法安装 ia32-libs
- 利用广播调用 服务的方法
- Maven Nexus 仓库管理