《华清远见学习手记》之 Ubuntu8.10下 配置网络参数

Ubuntu8.10 下 配置网络参数

 

1.     DHCP 方式获取IP

方法一、在/etc/network/interfaces 文件加入:

    auto eth0

    iface eth0 inet dhcp

    然后

    sudo /etc/init.d/networking restart 生效

   

    方法二、直接用sudo  dhclient eth0

 

2 .配置静态IP

    方法一、在/etc/network/interfaces 文件加入:

    auto eth0

    iface eth0 inet static

    address 192.168.2.223

    getway 192.168.2.1

    netmask 255.255.255.0

然后

    sudo /etc/init.d/networking restart 生效

   

    方法二、直接用 ifconfig eth0 192.168.2.223 gateway 192.168.2.1 netmask 255.255.255.0 up

 

3.     更改主机名称

sudo  /bin/hostname  newname

 

4.     DNS 配置

Sudo vim /etc/resolv.conf

加入

Nameserver 202.96.128.68

Nameserver 61.144.56,101

然后

    sudo /etc/init.d/networking restart 生效

 

 

 

发布了30 篇原创文章 · 获赞 5 · 访问量 6万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章