歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> Unix基礎知識 >> 如何在AIX上設置TCP/IP

如何在AIX上設置TCP/IP

日期:2017/3/3 15:20:38   编辑:Unix基礎知識

在大多數 UNIX系統上用命令設置 TCP/IP,例如 ifconfig 和 route,然後通過編輯初始化文件使配置永久生效。AIX 中也可以這樣做,但是使用 SMIT 做所有的配置是最好的,這樣做能保證更新/etc/rc.net 和 ODM 裡的信息。

1、配置 IP 地址和主機名

如同其它操作系統對 TCP/IP 的支持,AIX 首先也要配置 IP 地址和主機名,以便主機間的通訊和資源共享。使用 SMIT 是方便且可靠的方法,具體操作如下:使用 SMIT 快捷命令:

# smit mktcpip

首先在Available Network Interfaces屏幕,選擇適當的網絡接口。這些網絡接口是在系統bootup時由cfgmgr認出,並且設置到 ODM數據庫的。

然 後 出 現 Minimum Configuration & Startup菜 單 ,至 少 要 填 寫HOSTNAME 和Internet ADDRESS域,也可在START Now域指定是否想要現在或在 bootup時啟動 TCP/IP。

在這個屏幕還能設置其它參數如網絡掩碼、名字服務、網關和電纜線類型。如果讓 Network MASK 域空白, AIX將根據系統的 IP 地址類提供缺省值。 CABLEType 域可選參數的含義:bnc 細纜、dix 粗纜、tp 雙絞線。

例子:

----------------------------------------------------------------------

Minimum Configuration & Startup

To Delete existing configuration data, please use Further Configuration menus

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

* HOSTNAME [a2410bjv]

* Internet ADDRESS (dotted decimal) [15.24.48.58]

Network MASK (dotted decimal) [255.255.248.0]

* Network INTERFACE en0

NAMESERVER

Internet ADDRESS (dotted decimal) [15.41.144.101]

DOMAIN Name [nsr.hp.com]

Default GATEWAY Address [15.24.55.253]

(dotted decimal or symbolic name)

Your CABLE Type N/A +

START Now no +

----------------------------------------------------------------------

也可用專用命令設定或修改主機名,操作如下

# smit hostname

在 Hostname 屏幕選擇 Set the Hostname 菜單條款。

在 HOSTNAME 域填入新的主機名。

2、路由管理

對於今天的局域網來說,與外界的聯系必不可少,所以路由及路由管理也是必須的。

(1)增加路由。

為主機增加路由,操作如下:

# smit mkroute

填寫 DESTINATION Address 目標地址和 Default GATEWAY Address 默認網關地址,Destination Type 目標類型可以選擇 net 或 host,METRIC 域缺省值 1。

----------------------------------------------------------------------

Add Static Route

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

Destination TYPE net +

* DESTINATION Address []

(dotted decimal or symbolic name)

* Default GATEWAY Address []

(dotted decimal or symbolic name)

* METRIC (number of hops to destination gateway) [1] #

----------------------------------------------------------------------

(2)刪除路由

用 SMIT 刪除一條路由的操作與增加一條路由很相象。輸入如下命令並且在各域填入適當的值即可:

# smit rmroute

(3)刷新路由表

啟動 SMIT :

# smit fshrttbl

出現如下:

----------------------------------------------------------------------

Flush Routing Table

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

Flush Routing Table in the Current Running System yes +

Flush Routing Table in the Configuration Data Base no +

(effective in the next system restart)

----------------------------------------------------------------------

如果只想暫時刷新路由表,而保持 ODM 數據庫中的路由信息,就接受缺省值。如

果還想要清除 ODM 的路由信息,Flush Routing Table in the Configuration Data Base域選 YES。

3、網卡配置

增加新網卡後第一次系統啟機時(或作cfgmgr)會自動認出網卡並給予默認配置,故有時必須對網卡配置進行修改甚至刪除。

(1)改變網卡的配置

用 SMIT 命令:

# smit chinet

在 Available Network Interfaces 菜單選擇適當的網絡接口。按需要做適當的改變。

如果讓 BROADCAST ADDRESS 域空白, AIX將基於子網掩模提供一個缺省值。

例子:

----------------------------------------------------------------------

Change / Show a Standard Ethernet Interface

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

Network Interface Name en0

INTERNET ADDRESS (dotted decimal) [15.24.48.58]

Network MASK (hexadecimal or dotted decimal) [255.255.248.0]

Current STATE up +

Use Address Resolution Protocol ( ARP ) ? yes

+

BROADCAST ADDRESS (dotted decimal) []

----------------------------------------------------------------------

查看本欄目更多精彩內容:http://www.bianceng.cn/OS/unix/

(2)刪除網卡配置

用 SMIT 命令:

# smit inet

選 Remove a Network Interface 選項。選擇適當的網絡接口。

注意:SMIT 刪除網絡接口沒有確認提示!

4、編輯一些重要文件

(1)編輯/etc/hosts。

可以用 SMIT 操作編輯/etc/hosts 文件或直接使用一個文本編輯器編輯/etc/hosts 文件。用 SMIT 操作如下:

# smit hostent

----------------------------------------------------------------------

Hosts Table (/etc/hosts)

Move cursor to desired item and press Enter.

List All Hosts

Add a Host

Change / Show Characteristics of a Host

Remove a Host

----------------------------------------------------------------------

(2)編輯/etc/inetd.conf

使用 SMIT 編輯/etc/inetd.conf 並確認更新 ODM 數據庫:

# smit inetdconf

生成:

----------------------------------------------------------------------

inetd Subservers

Move cursor to desired item and press Enter.

List All inetd Subservers

Add an inetd Subserver

Change / Show Characteristics of an inetd Subserver

Remove an inetd Subserver

----------------------------------------------------------------------

用菜單來選擇增加或刪除/etc/inetd.conf入口並更新ODM。如果用文本編輯器編輯 /etc/inetd.conf 必須用 refresh -s inetd 命令來刷新信息。

(3)編輯/etc/services

使用 SMIT 編輯/etc/services。

# smit inetserv

生成:

----------------------------------------------------------------------

Services (/etc/services)

Move cursor to desired item and press Enter.

List All Services

Add a Service

Change / Show Characteristics of a Service

Remove a Service

----------------------------------------------------------------------

根據需要按菜單做修改,也可使用一個文本編輯器直接修改/etc/services 文件。

(4)編輯/etc/hosts.equiv

使用 SMIT 修改/etc/hosts.equiv

# smit hostsequiv

生成:

----------------------------------------------------------------------

Host Access (/etc/host.equiv)

Move cursor to desired item and press Enter.

List All Remote Hosts

Add a Remote Host

Remove a Remote Host

----------------------------------------------------------------------

根據需要按菜單做修改。也可使用一個文本編輯器直接修改/etc/hosts.equiv 文件。

(5)編輯/etc/ftpusers

編輯/etc/ftpusers,對 ftp 用戶做配置。同樣有 SMIT 方式或直接修改。

例:

# smit ftpusers

生成:

----------------------------------------------------------------------

Restrict File Transfer Program Users (/etc/ftpusers)

Move cursor to desired item and press Enter.

Show All Restricted Users

Add a Restricted User

Remove a Restricted User

----------------------------------------------------------------------

作者信息:51cto博客 Oracle小混子

Copyright © Linux教程網 All Rights Reserved