View Single Post
Tuổi 28-07-2010, 09:12 AM   #1
emailhoc
Administrator
 
Gia nhập: Jul 2009
Trả Lời: 245
Đặt IP cho Ubuntu từ giao diện dòng lệnh
Để đặt IP cho card mạng eth0, ta tiến hành các bước như bên dưới
Bước 1: Mở file cấu hình bằng cách gõ lệnh

Mã:
sudo vi /etc/network/interfaces
Bước 2: Tùy chình các thông số theo yêu cầu. Ở đây mình thiết lập IP 192.168.0.100 cho card mạng eth0. Bên dưới là nội dung file interfaces trong trường hợp của mình các bạn tham khảo nhé.

Mã:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
        script grep
        map eth0

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.0.100
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1
Bước 3: Khởi động lại dịch vụ

Mã:
sudo /etc/init.d/networking restart
emailhoc vắng mặt   Trả lời ngay kèm theo trích dẫn này