iT邦幫忙

DAY 9
4

Ubuntu的學習之旅系列 第 9

Ubuntu Linux學習之旅(九)設定Ubuntu Linux網路

上次介紹Ubuntu Linux Server服務的安裝
但是前提是要當Linux Server最好IP必須設定為固定
這樣使用者或是Client端才方便連繫
因此今天要介紹TCP/IP網路設定
首先我們先看一下/etc/network/interfaces

cat /etc/network/interfaces

若顯示為下列內容,表示目前是設定為DHCP自動取得IP

# 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 eth0
iface eth0 inet dhcp

可以依據您真實的狀況進行修改
列如我的主機IP要設定為192.168.0.1然後子網遮罩為255.255.255.0且IP分享器是192.168.0.254
就可以修改如下:

# 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
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.254

接下來需要設定DNS名稱解析
請修改/etc/resolv.conf
以下列為例表是以中華電信的DNS為DNS Server解析

search mydomain.example
nameserver 168.95.1.1
nameserver 168.95.192.1

最後為了要完成所有設定
請執行下列指令:

sudo /etc/init.d/networking restart

上一篇
Ubuntu Linux學習之旅(八)使用webmin來管理Ubuntu Linux Server
下一篇
Ubuntu Linux學習之旅(十)安裝OPENSSH安全遠端連線
系列文
Ubuntu的學習之旅43
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言