2011年2月15日 星期二

Debian / Ubuntu Linux 網路設定範例

Debian / Ubuntu Linux 網路設定範例: "

Debian / Ubuntu Linux 的網路設定, 若不使用 NetworkManager 的話, 就是要手動設定 /etc/network/interfaces.

網路設定範例

/etc/network/interfaces 有哪些參數可以設定? 下面把常用的都列出來.

  • DHCP (自動取得 IP)
    auto eth0

    iface eth0 inet dhcp
  • Static IP (固定/靜態 IP)
    iface eth0 inet static

    address 192.168.0.7

    netmask 255.255.255.0

    gateway 192.168.0.254
  • PPPoE
    auto dsl-provider

    iface dsl-provider inet ppp

    pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf

    provider dsl-provider

    auto eth0

    iface eth0 inet manual
  • 更多設定
    auto eth0

    iface eth0 inet static

    address 192.168.1.2

    netmask 255.255.255.0

    gateway 192.168.1.254

    network 192.168.1.0

    broadcast 192.168.1.255

    gateway 192.168.1.254

    # dns-* options are implemented by the resolvconf package, if installed

    dns-nameservers 168.95.1.1 168.95.192.1 8.8.8.8 8.8.4.4

    dns-search longwin.com.tw

    auto eth0

    iface eth0:0 inet static

    address 192.168.1.41

    netmask 255.255.255.0

    broadcast 192.168.1.255

除此之外, 還想要做些進階設定, 例如下述:

相關網頁

"