วิธีการกำหนด IP Address ให้ network adapter Linux Ubuntu


วิธีการกำหนด IP Addressให้ network adapter (ใช้กับ Ubuntu)
Linux มีไฟล์หนึ่งที่ชื่อว่า /etc/network/interfaces ซึ่งใช้เก็บ configuration ของ network interfaces แต่ละอันในเครื่อง

วิธีการกำหนด IP Address โดยทั่วไปก็มีอยู่ 2 วิธี 
ได้แก่ : Static IP Configuration & DHCP Configuration

Static IP Configuration
$ sudo vim /etc/network/interfaces

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static
    address 192.168.0.xx
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.xx
dns-nameservers 192.168.x.x

wq!

$ sudo /etc/init.d/networking restart

DHCP network configuration 
$ sudo vim /etc/network/interfaces
iface eth0 inet dhcp
wq!
$ sudo /etc/init.d/networking restart
Share on Google Plus
    Blogger Comment
    Facebook Comment

0 ความคิดเห็น:

แสดงความคิดเห็น