What is the command to add another IP address to an interface that already has (at least) one IP address?
A.
ifconfig eth0:1 192.168.1.2
B.
ifconfig eth0 192.168.1.2
C.
ipconfig eth0:1 192.168.1.2
D.
ipconfig eth0 192.168.1.2
E.
ifconfig eth0:sub1 192.168.1.2
題解
「ifconfig」指令可以設定網路介面。「ipconfig」是 Windows 作業系統的指令。
選項 A,正確答案。在網路介面後面接上冒號和別名,就是由該網路介面產生出來的虛擬網路介面。
選項 B,錯誤答案。根據題目要求,應在同一個網路介面上產生多個虛擬網路介面來設定不同的 IP 位址。
選項 C,沒有「ipconfig」指令。
選項 D,沒有「ipconfig」指令。
選項 E,正確答案。理由同選項 A,別名不一定要使用數字。雖然題目沒有註明要選擇兩個答案,但選項 A 和選項 E 的指令都可以替網路介面增加 IP 位址。
