网络安装ubuntu(教育网内)
作者:佚名 来源:不详 发布时间:2008-5-13 8:06:00
教育网内
一般的学校网络都是把ip和mac固定的
以致于我刚买回来电脑为了可以上网就硬性把自己的mac改的和宿舍另外两台的电脑一样
三个人用的一个端口
额
后来
这个mac就一直跟着我
包括来了这边
这次安装ubuntu我才知道原来这个东西这么难搞
sudo ifconfig eth0 down 使得网卡处于非工作状态
sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE (你的MAC地址)
sudo ifconfig eth0 up 激活网卡
就改完mac了,但是每次重启都需要设置
比较麻烦
然后呢
把这段写进启动项,代码如下
sudo gedit /etc/init.d/rc.local
将
sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE
sudo ifconfig eth0 up
写进去,即可~
修改ip时
和上面一样,让网卡失效先
sudo /etc/init.d/networking stop
然后
sudo gedit /etc/network/interfaces
在打开的文件内
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.0.9 (自己IP)
netmask 255.255.255.0 ()
gateway 192.168.0.1 (网关)
nameserver 210.82.5.21
nameserver 202.106.16.151 这是dns服务器地址
保存关闭之后
再执行sudo /etc/init.d/networking restart
enjoy吧。
一般的学校网络都是把ip和mac固定的
以致于我刚买回来电脑为了可以上网就硬性把自己的mac改的和宿舍另外两台的电脑一样
三个人用的一个端口
额
后来
这个mac就一直跟着我
包括来了这边
这次安装ubuntu我才知道原来这个东西这么难搞
sudo ifconfig eth0 down 使得网卡处于非工作状态
sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE (你的MAC地址)
sudo ifconfig eth0 up 激活网卡
就改完mac了,但是每次重启都需要设置
比较麻烦
然后呢
把这段写进启动项,代码如下
sudo gedit /etc/init.d/rc.local
将
sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE
sudo ifconfig eth0 up
写进去,即可~
修改ip时
和上面一样,让网卡失效先
sudo /etc/init.d/networking stop
然后
sudo gedit /etc/network/interfaces
在打开的文件内
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.0.9 (自己IP)
netmask 255.255.255.0 ()
gateway 192.168.0.1 (网关)
nameserver 210.82.5.21
nameserver 202.106.16.151 这是dns服务器地址
保存关闭之后
再执行sudo /etc/init.d/networking restart
enjoy吧。

添加到雅虎收藏