Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
章 21. 安裝階段 1:配置網路裝置
當 kernel 啟動後,您將需要使用 linuxrc 程式來配置一個網路裝置。您需要此網路裝置,以完成安裝。若您要互動式地進行安裝(透過預設參數檔案
generic.prm
),您將會被詢問有關於您網路的相關問題。建議您將資料以資料工作表或類似格式準備好在您面前。若您希望自動化此步驟,請為您參數檔案或 CMS 配置檔案中的各個選項提供資訊。
讓我們來看看如何在 z/VM 下配置 OSA 網路卡的範例。當 linuxrc 啟動時,您將會看見下列訊息:
Starting the zSeries initrd to configure networking. Version is 1.2
Starting udev...
網路裝置會被偵測並列出。此裝置清單取決於所使用的
cio_ignore
kernel 參數。若是基於 cio_ignore
,沒有裝置被偵測到,您可如下範例清除忽略裝置的清單。請注意,這可能會花上一段時間,並且清單可能會因為裝置數量較多而變得過度冗長(例如在 LPAR 上)。
Scanning for available network devices...
Autodetection found 0 devices.
Note: There is a device blacklist active! (Clearing might take long)
c) clear blacklist, m) manual config, r) rescan, s) shell:
c
Clearing device blacklist...
Scanning for available network devices...
Autodetection found 14 devices.
NUM CARD CU CHPID TYPE DRIVER IF DEVICES
1 OSA (QDIO) 1731/01 00 OSD qeth eth 0.0.f500,0.0.f501,0.0.f502
2 OSA (QDIO) 1731/01 01 OSD qeth eth 0.0.f503,0.0.f504,0.0.f505
3 OSA (QDIO) 1731/01 02 OSD qeth eth 0.0.1010,0.0.1011,0.0.1012
4 HiperSockets 1731/05 03 IQD qeth hsi 0.0.1013,0.0.1014,0.0.1015
5 OSA (QDIO) 1731/01 04 OSD qeth eth 0.0.1017,0.0.1018,0.0.1019
6 CTC adapter 3088/08 12 ? ctcm ctc 0.0.1000,0.0.1001
7 escon channel 3088/1f 12 ? ctcm ctc 0.0.1002,0.0.1003
8 ficon channel 3088/1e 12 ? ctcm ctc 0.0.1004,0.0.1005
9 OSA (QDIO) 1731/01 76 OSD qeth eth 0.0.f5f0,0.0.f5f1,0.0.f5f2
10 LCS OSA 3088/60 8a OSE lcs eth 0.0.1240,0.0.1241
11 HiperSockets 1731/05 fb IQD qeth hsi 0.0.8024,0.0.8025,0.0.8026
12 HiperSockets 1731/05 fc IQD qeth hsi 0.0.8124,0.0.8125,0.0.8126
13 HiperSockets 1731/05 fd IQD qeth hsi 0.0.8224,0.0.8225,0.0.8226
14 HiperSockets 1731/05 fe IQD qeth hsi 0.0.8324,0.0.8325,0.0.8326
<num>) use config, m) manual config, r) rescan, s) shell:
請輸入您希望使用的配置號碼,比方說 9。請由提供給安裝程式有關於網路裝置類型資訊,以及其子頻道裝置位址的表格選擇。此外,您亦可輸入 m 以輸入網路類型(qeth)、讀取、寫入、資料頻道,以及 OSA 連接埠。您可透過按下 Enter 來接受預設值;在 z/VM 下,您可能需要按下 Enter 鍵兩次。
m
* NOTE: To enter default or empty values press enter twice. *
Network type (qeth, lcs, ctc, ? for help). Default is qeth:
qeth
Read,write,data channel (e.g. 0.0.0300,0.0.0301,0.0.0302 or ? for help).
0.0.f5f0,0.0.f5f1,0.0.f5f2
Portname (1..8 characters, or ? for help). Default is no portname:
Relative port number for OSA (0, 1, or ? for help). Default is 0:
Activating network device...
Detected: OSA card in OSD mode, Gigabit Ethernet
有關於您 Linux 事例的問題:
Hostname of your new Linux guest (FQDN e.g. s390.redhat.com or ? for help):
host.subdomain.domain
IPv4 address / IPv6 addr. (e.g. 10.0.0.2 / 2001:0DB8:: or ? for help)
10.0.0.42
IPv4 netmask or CIDR prefix (e.g. 255.255.255.0 or 1..32 or ? for help). Default is 255.0.0.0:
24
IPv4 address of your default gateway or ? for help:
10.0.0.1
Trying to reach gateway 10.0.0.1...
IPv4 addresses of DNS servers (separated by colons ':' or ? for help):
10.1.2.3:10.3.2.1
Trying to reach DNS servers...
DNS search domains (separated by colons ':' or ? for help):
subdomain.domain:domain
DASD range (e.g. 200-203,205 or ? for help). Default is autoprobing:
eb1c
Activated DASDs:
0.0.eb1c(ECKD) dasda : active, blocksize: 4096, 1803060 blocks, 7043 MB
重要
安裝程式需要定義至少一個 DASD。在唯 SCSI 安裝的情況下,請輸入
none
。這能達到已定義的 DASD 參數的需求,並能在唯 SCSI 的環境下進行。
若您進行了錯誤的動作,對話方塊將會注意到錯誤並要求您重新輸入參數,或是您亦可在之後返回並重新開啟該對話方塊:
Incorrect ... (<OPTION-NAME>):
0) redo this parameter, 1) continue, 2) restart dialog, 3) halt, 4) shell
當您重新開啟了對話方塊後,它會記得您先前所輸入的資料:
Network type
0) default is previous "qeth", 1) new value, ?) help
在完成了配置之後,您將會看到
初始配置已完成
這則訊息:
Initial configuration completed.
c) continue, p) parm file/configuration, n) network state, r) restart, s) shell
您現在可透過鍵入 n 來檢查您的網路配置:
n
eth0 Link encap:Ethernet HWaddr 02:00:00:AB:C9:81
inet addr:10.0.0.42 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1492 Metric:1
RX packets:64 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3334 (3.2 KiB) TX bytes:336 (336.0 b)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
127.0.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 lo
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
c) continue, p) parm file/configuration, n) network state, r) restart, s) shell
若您希望進行變更,請輸入 r 以重新開啟對話方塊。若要顯示參數檔案或配置檔案中所指定的參數,您可互動式地輸入 p。接著,您便可將輸出由您的終端機中複製出,並貼至文字編輯器中,以將其儲存在您本機工作站上的磁碟中。您可將此副本用來作為參數檔案或是配置檔案的範本,以供日後進行安裝使用:
p
NETTYPE=qeth
IPADDR=10.0.0.42
NETMASK=255.255.255.0
GATEWAY=10.0.0.1
HOSTNAME=host.subdomain.domain
SUBCHANNELS=0.0.f5f0,0.0.f5f1,0.0.f5f2
LAYER2=1
MACADDR=02:00:00:AB:C9:81
PORTNAME=OSAPORT
DNS=10.1.2.3:10.3.2.1
SEARCHDNS=subdomain.domain:domain
DASD=eb1c
c) continue, p) parm file/configuration, n) network state, r) restart, s) shell
再次重申,若要進行變更,請以 r 來重新開啟對話方塊。最後,若一切皆正常,請輸入 c 以繼續進行:
c
Starting sshd to allow login over the network.
Connect now to 10.0.0.42 and log in as user 'install' to start the
installation.
E.g. using: ssh -x install@10.0.0.42
For VNC or text mode, disable X11 forwarding (recommended) with 'ssh -x'.
For X11, enable X11 forwarding with 'ssh -X'.
You may log in as the root user to start an interactive shell.
初步網路設定現在已完成,並且安裝程式將會啟動一項 SSH daemon。您現在可透過 SSH 登入您的 Linux 系統中。若您在 kickstart 或是 cmdline 模式下使用
RUNKS=1
的話,linuxrc 將會自動啟動載入程式。
21.1. 終端機上的注意事項
當進行安裝時,安裝程式會在 line-mode 的終端機上顯示一則訊息。若您在 LPAR 下進行安裝的話,這將是 HMC Operating System Messages applet,若是您在 z/VM 下進行安裝的話,則會是 3270 終端機。
Linuxrc 在 line-mode 終端機上提供了救援 shell。請按下 Enter 鍵(z/VM 下請按兩次),以啟動 shell。您無法在 line-mode 終端機上使用全螢幕的應用程式,例如 vi 編輯器。請切換至基於 line-mode 的編輯器,例如 ed、ex 或 sed,以視需求編輯文字檔案。
請注意,執行時間較長的指令可能無法透過 Ctrl+C 跳脫循序來取消執行。請以選項來調用指令,以使它們能主動在時間內回傳。3270 終端機上的 shell 在進行安裝程序的整個階段中皆能使用,直到系統需重新啟動時。
當 shell 被提供時,您可在錯誤等級為零的情況下退出,以使用新的 shell 事例,或是您可在錯誤等級非零的情況下退出,以強制關閉安裝系統。
使用
root
使用者來連至已安裝的系統,以在不自動啟動安裝程式的情況下,使用 root shell。若要進行疑難排解,您可連至多個 ssh session。