mktcpip command

Purpose

Sets the required values for starting TCP/IP on a host.

Syntax

To add a static IPv4 address:

mktcpip -hostname HostName -inetaddr Address -interface Interface [-start] [-netmask SubnetMask] [-cabletype CableType] [-gateway Gateway] [-nsrvaddr NameServerAddress -nsrvdomain Domain]

To run IPv6 stateless autoconfiguration:

mktcpip -auto [-interface Interface] [-hostname Hostname]

To add a static IPv6 address:

mktcpip -hostname HostName -inetaddr Address -interface Interface [-start] [-plen PrefixLength] [-cabletype CableType] [-gateway Gateway] [-nsrvaddr NameServerAddress -nsrvdomain Domain]

Note: For IPv6 networks, stateless autoconfiguration is suggested.

Description

The mktcpip command sets the minimal values required for using TCP/IP on a host machine. The basic functions of the mktcpip command include:
  • Setting the host name
  • Setting the IP address of the interface
  • Setting the domain name and IP address of the name server, if applicable
  • Setting the subnetwork mask, if applicable
  • Starting the specified TCP/IP daemons
Note: For both static IPv6 configuration and IPv6 stateless autoconfiguration, a link-local address is configured internally.

Flags

Flag name Description
-auto Enables IPv6 automatic stateless configuration.
-cabletype CableType Specifies the 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 -cabletype CableType flag should be used only for Standard Ethernet (en) and IEEE 802.3 Ethernet (et) interfaces. The default is N/A.
-gateway Gateway Sets the gateway address for a static route.
-hostname Hostname 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:
hostname
The standard format for setting the host name in a domain naming system is as follows: :
hostname.subdomain.subdomain.rootdomain
-inetaddr Address Sets the IP address of the host. Each network interface on the host should have a unique IP address. The standard format for setting the IP address as follows: :
127.10.31.2
-interface Interface Specifies a particular network interface, for example:
en1
-netmask SubnetMask Specifies the mask that the gateway should use in determining the appropriate subnetwork for routing. The subnet mask is a set of 4 bytes, as in the IP address. The subnet mask consists of high bits (1 s) corresponding to the bit positions of the network and subnetwork address, and low bits (0s) corresponding to the bit positions of the host address.
-nsrvaddr NameserverAddress Specifies the IP address of the name server that the host uses for name resolution, if applicable as follows:
127.1.0.1
-nsrvdomain Domain Specifies the domain name of the name server that the host should use for name resolution, if any. The domain name should be in the format as follows: :
subdomain.subdomain.rootdomain
-plen prefixLen Specifies the prefix length of the IPv6 interface.
-start Starts the TCP/IP daemons.
Note: The -hostname option along with the -auto option (stateless IP configuration) is used to set only the system host name. The IP host name mapping in the /etc/hosts file is not done for the stateless IP configuration.

Examples

  1. To configure a static IPv4 address on an interface, type the command as follows:
    mktcpip -hostname fred.austin.century.com -inetaddr 192.9.200.4 -interface en0 \
    -nsrvaddr 192.9.200.1 -nsrvdomain austin.century.com -start
  2. To set an IPv6 stateless autoconfiguration on an interface, type the command as follows:
    mktcpip -interface en0 -auto
  3. On a system where the system host name is not set, to run stateless autoconfiguration along with setting the system host name, type the command as follows:
    mktcpip -auto -interface en0 -hostname host.in.ibm.com
  4. To configure a static IPv6 address on an interface, type the command as follows:
    mktcpip -interface en0 -hostname host -inetaddr ipv6_address -plen 64 
    -nsrvaddr 192.9.200.1 -nsrvdomain austin.century.com -start
  5. To configure a IPv4 address on an interface, type the command as follows:
    mktcpip -hostname ide1.in.ibm.com -inetaddr 9.126.88.153 -gateway 9.126.88.1 
    -netmask 255.255.255.0 -interface en0 -start -nsrvaddr 9.184.192.240 
    -nsrvdomain in.ibm.com
  6. To configure a static IPv6 address on an interface, type the command as follows:
    mktcpip -hostname moon1.in.ibm.com -inetaddr 2001:1:1:1::9 -gateway 2001:1:1:1::1 
    -plen 64 -interface en1 -start



Last updated: Wed, November 18, 2020