《華清遠見學習手記》之 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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章