Ubuntu: Basic network setup

Hostname

เรียกดู hostname

$ /bin/hostname
your_hostname

ตั้งชื่อ hostname ใหม่

$ /bin/hostname new_hostname

Ethernet

ดูและแก้ไข network interface ได้จากไฟล์ /etc/network/interfaces เช่น

auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255

คำสั่งดู network interface ที่ใช้อยู่
$ dmesg | grep eth

ดู network interface และ MAC address ได้ในไฟล์
/etc/udev/rules.d/70-persistent-net.rules
ดูและแก้ไข DNS servers ได้จากไฟล์ /etc/resolv.conf เช่น

ที่มา: An introduction to Debian networking setup, Network Configuration