mktcpip 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-mktcpip
핵심 정리
- 호스트에서 TCP/IP를 쓰는 데 꼭 필요한 최소 값(호스트 이름, IP 주소, 넷마스크, 기본 게이트웨이, DNS)을 한 번에 정하고 구성 데이터베이스(ODM)에 씁니다. 그래서 재부팅해도 유지됩니다.
- 예:
mktcpip -h host1 -a 10.1.1.10 -m 255.255.255.0 -i en0 -g 10.1.1.1 -n 10.1.1.53 -d example.com -s. /etc/hosts에 호스트 이름과 IP를 넣고,-n·-d를 주면/etc/resolv.conf도 만듭니다.-s는 TCP/IP 데몬을 시작합니다.- IPv4만 지원합니다. 처음 최소 구성에만 쓰고, 그 뒤의 변경은
smitty configtcp나chdev로 합니다. - 보통
smitty mktcpip화면으로 실행합니다(-S는 SMIT가 화면을 채우는 데 씀).
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (두 버전의 내용이 같음) |
| 원문 | IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3 |
| 파일 | /usr/bin/mktcpip, /etc/hosts, /etc/resolv.conf |
| 관련 명령어 | smitty mktcpip, chdev -l en0, chdev -l inet0, hostname, ifconfig, route |
목적
호스트에서 TCP/IP를 시작하는 데 필요한 값을 정합니다.
영어 원문
Sets the required values for starting TCP/IP on a host.
구문
mktcpip { -S Interface | -h HostName -a Address -i Interface [ -s ] [ -m SubnetMask ] [ -r RingSpeed ]
[ -t CableType ] [ -g DefaultGateway ] [ -n NameServerAddress [ -d Domain ] ]
[ [ -c Subchannel ] -D Destination ] }
설명
mktcpip 명령은 호스트에서 TCP/IP를 쓰는 데 필요한 최소 값을 정해 구성 데이터베이스에 씁니다.
참고: mktcpip은 지금 IPv4만 지원합니다. 기본 기능은 다음과 같습니다.
- 구성 데이터베이스와 실행 중인 머신 모두에 호스트 이름을 정합니다.
- 구성 데이터베이스에 인터페이스의 IP 주소를 정합니다.
/etc/hosts에 호스트 이름과 IP 주소 항목을 넣습니다.- 해당하면 도메인 이름과 네임 서버 IP 주소를 정합니다.
- 해당하면 서브넷 마스크를 정합니다.
- 해당하면 구성 데이터베이스와 실행 중인 머신 모두에 정적 경로를 더합니다.
- 지정한 TCP/IP 데몬을 시작합니다.
Web-based System Manager(wsm)의 Network 응용 프로그램이나 SMIT 빠른 경로 smit mktcpip으로도 이 명령을 실행할 수 있습니다.
영어 원문
The mktcpip command sets the required minimal values required for using TCP/IP on a host machine. These values are written to the configuration database.
Note: The mktcpip command currently supports IPv4 only. The basic functions of the mktcpip command include:
Setting the host name in both the configuration database and the running machine.
Setting the IP address of the interface in the configuration database.
Making entries in the /etc/hosts file for the host name and IP address.
Setting the domain name and IP address of the nameserver, if applicable.
Setting the subnetwork mask, if applicable.
Adding a static route to both the configuration database and the running machine, if applicable.
Starting the specified TCP/IP daemons.
You can use the Network application in Web-based System Manager (wsm) to change network characteristics. You could also use the System Management Interface Tool (SMIT) smit mktcpip fast path to run this command.
플래그
| 플래그 | 설명 |
|---|---|
-a Address |
호스트의 인터넷 주소(점 10진수). 호스트의 네트워크 인터페이스마다 주소가 달라야 합니다. 예: 127.10.31.2 |
-c Subchannel |
System/370 채널 어댑터의 하위 채널 주소. |
-D Destination |
정적 경로의 목적지 주소(점 10진수). 예: 192.9.52.1 |
-d Domain |
이름 풀이에 쓸 네임 서버의 도메인 이름. 형식: subdomain.subdomain.rootdomain |
-g DefaultGateway |
라우팅 표에 기본 게이트웨이 주소(점 10진수)를 더합니다. 예: 192.9.52.0 |
-h HostName |
호스트 이름. 도메인 이름 체계를 쓰면 도메인과 하위 도메인까지 줍니다. 형식: hostname 또는 hostname.subdomain.subdomain.rootdomain |
-i Interface |
네트워크 인터페이스. 예: tr0 |
-m SubnetMask |
게이트웨이가 라우팅할 서브넷을 정할 때 쓸 마스크. IP 주소처럼 4바이트이며, 네트워크·서브넷 주소 자리는 1, 호스트 주소 자리는 0입니다. |
-n NameServerAddress |
이름 풀이에 쓸 네임 서버의 인터넷 주소(점 10진수). 예: 127.1.0.1 |
-r RingSpeed |
토큰 링 어댑터의 링 속도. 4 또는 16Mbps. |
-S Interface |
SMIT 화면에 보여 줄 정보를 가져옵니다. |
-s |
TCP/IP 데몬을 시작합니다. |
-t CableType |
표준 이더넷(en)이나 IEEE 802.3 이더넷(et)의 케이블 종류. dix(굵은 케이블), bnc(가는 케이블), N/A(해당 없음). |
영어 원문
-aAddress — Sets the Internet address of the host. Specify the address in dotted decimal notation. Each network interface on the host should have a unique Internet address. The following is the standard format for setting the Internet address:127.10.31.2-cSubchannel — Specifies the subchannel address for a System/370 channel adapter.-DDestination — Sets the destination address for a static route. Specify the address in dotted decimal notation. The following is the standard format for setting the destination address for a static route:192.9.52.1-dDomain — Specifies the domain name of the name server the host should use for name resolution, if any. The domain name should be in the following format:subdomain.subdomain.rootdomain-gDefaultGateway — Adds the default gateway address to the routing table. Specify the address in dotted decimal notation. The following is the standard format for setting the default gateway address:192.9.52.0-hHostName — Sets the name of the host. If using a domain naming system, the domain and any subdomains must be specified. The following is the standard format for setting the host name:hostnameThe following is the standard format for setting the host name in a domain naming system:hostname.subdomain.subdomain.rootdomain-iInterface — Specifies a particular network interface, for example:tr0-mSubnetMask — Specifies the mask the gateway should use in determining the appropriate subnetwork for routing. The subnet mask is a set of 4 bytes, as in the Internet address. The subnet mask consists of high bits (1s) corresponding to the bit positions of the network and subnetwork address, and low bits (0s) corresponding to the bit positions of the host address.-nNameServerAddress — Specifies the Internet address of the name server the host uses for name resolution, if applicable. The address should be entered in dotted decimal notation, as follows:127.1.0.1-rRingSpeed — Specifies the ring speed for a token-ring adapter. Valid values for the RingSpeed variable are either 4- or 16-Mbps.-SInterface — Retrieves information for System Management Interface Tool (SMIT) display.-s— Starts the TCP/IP daemons.-tCableType — Specifies cable size for Standard Ethernet or IEEE 802.3 Ethernet networks. Valid values for the CableType variable are dix for thick cable, bnc for thin cable, or N/A for Not Applicable. The-tCableType flag should be used only for Standard Ethernet (en) and IEEE 802.3 Ethernet (et) interfaces.
예제
TCP/IP를 시작하는 데 필요한 값을 정합니다.
mktcpip -h fred.austin.century.com -a 192.9.200.4 -i en0 \
-n 192.9.200.1 -d austin.century.com -s
참고: mktcpip은 TCP/IP를 처음 최소로 구성할 때만 씁니다. 그 뒤의 구성 변경은 smitty configtcp 빠른 경로를 씁니다.
자주 쓰는 형태:
mktcpip -h aixhost01 -a 10.1.1.10 -m 255.255.255.0 -i en0 -g 10.1.1.1 -s
lsattr -El en0 -a netaddr -a netmask # 들어간 값 확인
lsattr -El inet0 -a hostname -a route # 호스트 이름과 영구 경로
netstat -rn; cat /etc/resolv.conf
영어 원문
To set the required values for starting TCP/IP enter: mktcpip -h fred.austin.century.com -a 192.9.200.4 -i en0 \ -n 192.9.200.1 -d austin.century.com -s
Note: Use the mktcpip command only to minimally configure TCP/IP for the first time. For further configuration changes, use the smitty configtcp fastpath.
파일
| 파일 | 설명 |
|---|---|
/usr/bin/mktcpip |
mktcpip 명령 |
/etc/resolv.conf |
네임 서버와 도메인 설정 |
/etc/hosts |
호스트 이름과 IP 주소 항목 |
영어 원문
- /usr/bin/mktcpip — Contains the mktcpip command.
- /etc/resolv.conf — Contains the default system configuration database.
- /etc/hosts — Contains the host name and IP address entries.
Related information:
- hostname command
- hostent command
- resolv.conf file
- TCP/IP addressing
리눅스(GNU)와 다른 점
리눅스에는 mktcpip 같은 단일 초기 구성 명령이 표준으로 없습니다. RHEL 계열은 nmcli con mod eth0 ipv4.addresses 10.1.1.10/24 ipv4.gateway 10.1.1.1 ipv4.dns 10.1.1.53 ipv4.method manual과 hostnamectl set-hostname을, Ubuntu는 netplan 파일(/etc/netplan/*.yaml)과 netplan apply를 씁니다. 화면으로 하려면 nmtui가 smitty mktcpip에 가깝습니다.