博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu9.04网络设置
阅读量:4172 次
发布时间:2019-05-26

本文共 2035 字,大约阅读时间需要 6 分钟。

Ubuntu9.04网络设置
最近一个兄弟拷贝给我一个9.04的虚拟机。设置网络还遇到些和8.04不同的地方,记录一下:
sudo gedit /etc/network/interfaces
#设置静态IP
auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
#broadcast 192.168.1.255
gateway 192.168.1.1
#设置动态dhcp
auto eth0 inet dhcp
上面两个设置二选一就行了,看哪个适合你。
sudo gedit /etc/resolv.conf
#设置DNS server(可以设置多个)
nameserver 192.168.1.1
#重新设置网络
sudo /etc/init.d/networking restart
由于我的UBUNTU虚拟机是从朋友那里拷贝的,所以
设置后报错如下:
eth0: ERROR while getting interface flags:No such device
SIOCSIFNETMASK:No such device
eth0: ERROR while getting interface flags:No such device
Failed to bring up eth0.
...done.
解决方法:
在 /etc/udev/rules.d 目录里 *_persistent-net.rules 文件
这个文件里有网卡MAC地址和网卡名称的对应关系。
里面肯定会有关于eth0 和eth1的两行信息
删除这个文件,然后重启解决!
新的CN99的源
deb http://ubuntu.cn99.com/ubuntu/ jaunty main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ jaunty-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ jaunty-proposed main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ jaunty-backports main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty-security main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty-proposed main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty-backports main restricted universe multiverse
手动设置ip
/etc/network/interfaces 是网络配置文件,你可以用任何文本编辑程序编辑,z注意保存之后要重启相应的网络连接使它生效,如eth0:
sudo ifdown eth0
sudo ifup eth0
下面是我的文件,你可以参考
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.0.110
netmask 255.255.255.0
gateway 192.168.0.1
auto eth0

转载地址:http://wgbai.baihongyu.com/

你可能感兴趣的文章
NQI国家质量技术基础系统开发,国家质量基础设施平台建设
查看>>
nc命令用法举例
查看>>
Linux vmstat命令详解
查看>>
linux watch命令
查看>>
Linux lsof命令详解
查看>>
Ubuntu安装Anaconda
查看>>
蓝桥杯特别数的和(编程大题)
查看>>
Linux系统卡死,只有鼠标能动,解决办法
查看>>
三通道图像和四通道图像
查看>>
win10系统调出计算机和网络图标
查看>>
C/C++中字符串操作函数strcpy,strcat,strlen等
查看>>
贝壳找房机试题(笔试题)
查看>>
Xerces的下载,编译和在VS 2019中的配置
查看>>
国内快速访问GitHub的方法,亲测有用
查看>>
键盘fn键常亮(一直亮),解决办法
查看>>
Xerces C++实现xml文件解析
查看>>
用户强制一台设备登录,其他设备登出
查看>>
spring实现单例及创建线程安全单例
查看>>
设计模式-- 模板方法模式
查看>>
SQL关键字执行顺序
查看>>