ifconfig 명령어 (AIX 5.3·6.1)

핵심 정리

  • 네트워크 인터페이스(en0, lo0 등)의 주소와 매개변수를 보거나 바꿉니다. 보기는 누구나, 바꾸기는 root만 할 수 있습니다.
  • ifconfig -a(모든 인터페이스), ifconfig en0(하나), ifconfig -l(이름만), ifconfig en0 inet 10.1.1.10 netmask 255.255.255.0 up(주소 지정).
  • 별칭 주소는 alias·delete, 인터페이스 켜기·끄기는 up·down, 인터페이스 떼기는 detach입니다.
  • ifconfig로 바꾼 것은 재부팅하면 사라집니다. 영구로 하려면 chdev -l en0 -a netaddr=... -a netmask=...나 smitty chinet·mktcpip으로 ODM을 고칩니다.
  • rfc1323, tcp_sendspace, tcp_recvspace, tcp_mssdflt, tcp_nodelay는 인터페이스별 네트워크 옵션(ISNO)으로, no의 전역 값보다 우선합니다(no의 use_isno가 켜져 있을 때).
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 TAP 인터페이스(create·destroy), GIF 터널, InfiniBand(ib), anycast, transfer, scope, 프로토콜 패밀리별 보기가 더해짐)
원문 IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3
파일 /usr/sbin/ifconfig, /etc/hosts, /etc/networks
관련 명령어 netstat -in, chdev, lsattr, mktcpip, route, no, entstat

목적

TCP/IP 네트워크의 네트워크 인터페이스 매개변수를 구성하거나 보여 줍니다.

영어 원문

Configures or displays network interface parameters for a network by using TCP/IP.

구문

text
ifconfig interface [ addressfamily [ address [ destinationaddress ] ] [ parameters... ] ]
ifconfig interface [ protocolfamily ]
ifconfig -a [ -l ] [ -d ] [ -u ] [ protocolfamily ]
ifconfig interface [ tcp_low_rto rto | -tcp_low_rto ]

5.3 문서는 변수를 Interface, AddressFamily처럼 대문자로 시작해 적습니다.

설명

ifconfig 명령으로 네트워크 인터페이스에 주소를 정하고, 현재 인터페이스 구성 정보를 구성하거나 봅니다. 시스템을 시작할 때 각 인터페이스의 네트워크 주소를 정의하는 데 꼭 쓰며, 시작한 뒤에는 인터페이스의 주소와 다른 동작 매개변수를 다시 정할 때도 씁니다. 인터페이스 구성은 실행 중인 시스템에만 있어 다시 시작할 때마다 새로 정해야 합니다. ifconfig는 IFF_MULTICAST 플래그를 해석해, 설정되어 있으면 그 값을 출력합니다.

인터페이스는 여러 프로토콜로 전송을 받을 수 있고, 프로토콜마다 이름 체계가 다를 수 있습니다. 그래서 addressfamily 매개변수를 지정해야 하며, 이 값에 따라 나머지 매개변수의 해석이 바뀔 수 있습니다. 지금 지원하는 주소 패밀리는 inet과 inet6입니다.

DARPA 인터넷 패밀리 inet에서 주소는 호스트 이름 데이터베이스(/etc/hosts)에 있는 호스트 이름이거나 점으로 구분한 10진수 인터넷 주소입니다.

  • 인터페이스 상태는 누구나 볼 수 있지만 구성은 관리 권한이 있는 사용자(슈퍼유저)만 바꿀 수 있습니다.
  • 선택 매개변수가 없으면 그 인터페이스의 현재 구성을 보여 줍니다.
  • 프로토콜 패밀리를 지정하면 그 프로토콜 패밀리에 관한 정보만 보여 줍니다(6.1).

이더넷, 토큰 링, FDDI 인터페이스는 무상(gratuitous) ARP를 지원합니다. IP 주소를 정하면 호스트가 자기 주소(새 주소)에 대한 ARP 요청을 보내 다른 시스템이 ARP 항목을 바로 갱신하게 하고, 중복 IP 주소도 찾아냅니다. ARP 요청에 응답이 오면 /var/adm/ras/errlog에 오류 ID AIXIF_ARP_DUP_ADDR로 기록되며 errpt(또는 SMIT)로 볼 수 있습니다.

(6.1) ifconfig는 InfiniBand 인터페이스에 대해 ifconfig.ib 명령을 부릅니다. 이때 다음처럼 경로 MTU(pmtu), 큐 키(qkey), 큐 쌍 번호(qpn), 로컬 ID(lid), 호스트 채널 어댑터(hca), 포트 번호(port)를 함께 보여 주며, 디버깅이나 진단에 쓸모 있습니다.

text
ib0: flags=e3a0063<UP,BROADCAST,NOTRAILERS,RUNNING,ALLCAST,MULTICAST,GROUPRT>
        pmtu 2048 qkey 0x1e qpn 0x48 lid 0x5c hca iba0 port 1
        inet 1.2.3.120 netmask 0xffffff00 broadcast 1.2.3.255
        inet6 fe80::2:c903:1:1e8d/64
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1

참고: ifconfig로 바꾼 인터페이스 속성은 시스템을 재부팅하면 사라집니다.

(6.1) ifconfig에 detach를 주면 다른 옵션은 모두 무시합니다. 그래서 ifconfig en3 garbage detach처럼 잘못된 옵션이 섞여 있어도 오류 없이 실행됩니다.

영어 원문

You can use the ifconfig command to assign an address to a network interface and to configure or display the current network interface configuration information. The ifconfig command must be used at system startup to define the network address of each interface present on a system. After system startup, it can also be used to redefine an interfaces address and its other operating parameters. The network interface configuration is held on the running system and must be reset at each system restart. The ifconfig command interprets the IFF_MULTICAST flag and prints its value if it is set.

An interface can receive transmissions in differing protocols, each of which might require separate naming schemes. It is necessary to specify the addressfamily parameter, which might change the interpretation of the remaining parameters. The address families that are currently supported are inet and inet6.

For the DARPA-Internet family, inet, the address is either a host name present in the host name database, that is, the /etc/hosts file, or a DARPA-Internet address that is expressed in the Internet standard dotted decimal notation.

While any user can query the status of a network interface, only a user who has administrative authority can modify the configuration of those interfaces.

The ifconfig function displays the current configuration for a network interface when no optional parameters are supplied.

If a protocol family is specified, ifconfig reports only the details specific to that protocol family.

Only a super user can modify the configuration of a network interface.

Gratuitous ARP is supported for Ethernet, token-ring, and FDDI interfaces. This support means when an IP address is assigned, the host sends an ARP request for its own address (the new address) to inform other systems of its address so that they can update their ARP entry immediately. It also lets hosts detect duplicate IP address. If you get a response to the ARP request, an error is logged in /var/adm/ras/errlog, which can be viewed by using errpt command (or by using SMIT interface) for the error ID AIXIF_ARP_DUP_ADDR.

The ifconfig command calls the ifconfig.ib command. The ifconfig.ib command displays the interface information as shown: ib0:flags=e3a0063<UP,BROADCAST,NOTRAILERS,RUNNING,ALLCAST,MULTICAST,GROUPRT> pmtu 2048 qkey 0x1e qpn 0x48 lid 0x5c hca iba0 port 1 inet 1.2.3.120 netmask 0xffffff00 broadcast 1.2.3.255 inet6 fe80::2:c903:1:1e8d/64 tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1

The interface now displays the path mtu (pmtu), Queue Key (qkey), Queue Pair Number (qpn), Local ID (lid), Host Channel Adapter (hca), and the port number (port). This information is useful during debugging or performing diagnostics.

Note: Any changes that are made to the attributes of an interface by using the ifconfig command are lost when the system is rebooted.

When the detach command is specified with the ifconfig command, all other options are ignored. Specifying the detach command prevents the garbage character in the ipconfig command from causing any error. For example, the ifconfig en3 garbage detach command runs properly even when with the bad option.

플래그

플래그 설명
-a 인터페이스 이름 대신 써서 시스템의 모든 인터페이스 정보를 보여 줍니다.
-d 내려간(down) 인터페이스를 보여 줍니다. -a나 -l과 함께만 씁니다.
-l 시스템에 있는 모든 인터페이스의 이름만 나열합니다. -d, -u 말고는 다른 플래그·명령과 함께 쓸 수 없습니다.
-u 올라온(up) 인터페이스를 보여 줍니다. -a나 -l과 함께만 씁니다.
protocolfamily tcp, udp, tcp6, udp6, icmp, icmp6 같은 프로토콜을 지정합니다.
영어 원문
  • -a — Optionally, the -a flag can be used instead of an interface name. This flag instructs ifconfig to display information about all interfaces in the system.
  • -d — The -d flag displays interfaces that are down. You can use the flag only with the -a or -l flag.
  • -l — This flag can be used to list all available interfaces on the system, with no other additional information. Use of this flag is mutually exclusive with all other flags and commands, except for -d and -u.
  • -u — The -u flag displays interfaces that are up. You can use the flag only with the -a or -l flag.
  • protocolfamily — This flag specifies protocols such as tcp, udp, tcp6, udp6, icmp, and icmp6.

매개변수

매개변수 설명
address 인터페이스의 네트워크 주소. inet 패밀리면 호스트 이름이나 점 10진수 IP 주소입니다.
addressfamily 바꿀 네트워크 주소 패밀리. 지금은 inet과 inet6을 지원하며 기본은 inet입니다.
destinationaddress 점대점 링크 반대쪽 끝의 주소.
interface 보거나 바꿀 인터페이스. 꼭 지정해야 합니다. 약어 뒤에 숫자를 붙여 특정 인터페이스를 가리킵니다(예: tr0). 아직 올라오지 않은 인터페이스는 ifconfig 인터페이스로 올라오고 netstat -in에 나타납니다. 상태를 물을 때도 필요하면 인터페이스를 올립니다.
rto 재전송 타임아웃(밀리초, 0~3000). ifconfig로 정하기 전에 no의 timer_wheel_tick을 정해야 하며, 값은 timer_wheel_tick의 10배이거나 그 배수여야 합니다.

인터페이스 약어:

약어 인터페이스 약어 인터페이스
at ATM en 표준 이더넷(inet)
et IEEE 802.3 이더넷(inet) gre GRE 터널 의사 인터페이스(inet)
gif IPv4-over-IPv6 터널 의사 인터페이스(inet, 6.1) tr 토큰 링(inet)
xt X.25(inet) sl 직렬 회선 IP(inet)
lo 루프백(inet) op 직렬(inet)
vi 가상 IP 주소(VIPA, inet) ib IP over InfiniBand(inet, 6.1)
tap TAP 의사 이더넷(6.1)

parameters에 쓸 수 있는 값:

값 설명
alias 인터페이스에 네트워크 주소를 하나 더 정합니다. 네트워크 번호를 바꿀 때 예전 주소로 오는 패킷을 받는 데 쓸모 있습니다.
allcast, -allcast 토큰 링 인터페이스가 네트워크의 모든 링에 브로드캐스트하게 하거나, 로컬 링으로만 제한합니다.
anycast, -anycast (inet6만, 6.1) 애니캐스트 주소를 더하거나 지웁니다.
arp, -arp 네트워크 수준 주소와 링크 수준 주소의 대응에 ARP를 씁니다(기본). -arp는 쓰지 않습니다.
authority, bridge, -bridge, security, snap, -snap 앞으로 쓰려고 예약해 둔 값입니다.
broadcast Address (inet만) 네트워크에 브로드캐스트할 주소. 기본은 호스트 부분이 모두 1인 주소입니다.
checksum_offload, -checksum_offload 송신 TCP 체크섬 계산을 어댑터에 맡기는 플래그를 켜고, TCP가 오프로드를 동적으로 켜고 끌지 정하는 인터페이스별 카운터를 되돌립니다. -는 끕니다.
create (TAP만, 6.1) 네트워크 인터페이스를 만듭니다. tap0처럼 지정하거나 ifconfig tap create로 다음 빈 TAP 인터페이스를 만듭니다.
-dad (inet6만) 중복 IPv6 주소 검출을 하지 않습니다.
-debug 드라이버별 디버그 코드를 끕니다.
delete 지정한 네트워크 주소를 지웁니다. 별칭을 잘못 지정했거나 더는 필요 없을 때 씁니다. ns 주소를 잘못 정하면 네트워크 주소의 호스트 부분이 정해지는 부작용이 있는데, ns 주소를 모두 지우면 다시 정할 수 있습니다.
destroy (TAP만, 6.1) 인터페이스를 없앱니다. 인터페이스 목록과 ODM에서 그 인터페이스와 연결된 TAP 장치를 지웁니다.
device dev_name (ATM만) 이 인터페이스와 연결된 장치 이름. ATM은 장치 하나에 인터페이스가 여럿일 수 있습니다.
detach 인터페이스 목록에서 인터페이스를 뗍니다. 마지막 인터페이스를 떼면 드라이버 코드가 내려갑니다. 붙어 있는 인터페이스의 인터페이스 경로를 바꾸려면 떼었다가 ifconfig로 다시 더해야 합니다.
down 인터페이스를 비활성(down)으로 표시해 그 인터페이스로 보내지 않게 합니다. 되면 수신도 막습니다. 그 인터페이스를 쓰는 경로는 자동으로 막히지 않습니다.
eui64 (inet6만) 지정한 주소의 마지막 64비트를 인터페이스 식별자로 바꿔 실제 IPv6 주소를 계산합니다.
first IPv6 주소를 인터페이스의 첫 자리에 두어 바인드하지 않은 소켓의 출발지로 쓰게 합니다. 형식: ifconfig interface inet6 first address
firstalias alias와 같지만 주소를 인터페이스 주소 목록 맨 앞에 두어 바인드하지 않은 소켓의 출발지로 쓰게 합니다.
group ID, -group ID 인터페이스의 그룹 ID 목록에 ID를 더하거나 지웁니다. 이 인터페이스로 들어온 패킷을 전달할 경로를 정할 때 씁니다.
hwloop, -hwloop 하드웨어 루프백을 켜거나 끕니다. 켜면 로컬 주소로 가는 패킷도 어댑터로 내보냅니다.
ipdst 원격 네트워크로 가는 ns 패킷을 캡슐화한 IP 패킷을 받을 인터넷 호스트. 겉보기 점대점 링크를 만듭니다.
ipv6dst 터널로 IPv6·IPv4 패킷을 캡슐화한 IPv6 패킷을 받을 IPv6 노드. 터널 끝에서 풀린 패킷은 최종 목적지로 전달될 수 있습니다.
largesend, -largesend 가상 이더넷에서 LPAR가 다른 LPAR로 큰 데이터를 한 패킷으로 보내게 합니다(TCP 분할 없음). VIOS의 SEA가 largesend를 지원하면 실제 어댑터가 분할합니다. SEA에서는 chdev로 켭니다. -largesend가 기본입니다.
link [0-2], -link [0-2] 인터페이스 링크 수준의 특수 처리를 켜거나 끕니다. 인터페이스마다 뜻이 다르며, SLIP 압축이나 일부 이더넷 카드의 커넥터 종류를 고르는 데 씁니다.
metric Number 인터페이스의 라우팅 메트릭(기본 0). routed가 쓰며, 클수록 덜 선호하는 경로가 됩니다. 목적지까지의 추가 홉으로 셉니다.
monitor, -monitor 어댑터가 링크 상태 변화를 인터페이스 계층에 알리게 합니다. 어댑터가 링크 상태 콜백을 지원해야 하며, 다중 경로 라우팅이면 링크가 내려갈 때 다른 경로를 고릅니다.
mtu Value 최대 IP 패킷 크기. 60~65535이지만 매체에 따라 다릅니다.
netmask Mask 서브넷을 나누는 데 쓸 주소 부분. inet에서만 씁니다. 0x로 시작하는 16진수, 점 10진수, /etc/networks의 이름으로 지정합니다. 네트워크·서브넷 부분은 1, 호스트 부분은 0이며 서브넷 부분은 네트워크 부분과 이어져야 합니다. IP 주소 없이 쓰면 그 인터페이스의 첫 IP 주소의 넷마스크를 바꿉니다.
pvc (ATM만) 영구 가상 회선(PVC)만 지원합니다.
pktchain, -pktchain 출력 경로에서 여러 패킷을 사슬로 묶어 처리할 수 있다는 플래그를 켜거나 끕니다.
svc_c server_addr (ATM만) SVC와 PVC를 모두 지원하는 ARP 클라이언트. server_addr는 쉼표로 나눈 20바이트 ATM ARP 서버 주소 목록이며 첫 항목이 주 서버입니다.
svc_s (ATM만) SVC와 PVC를 모두 지원하는, 이 논리 IP 서브넷(LIS)의 ARP 서버.
site6 IPv6 사이트 번호(기본 0). 다중 사이트 노드의 사이트 로컬 주소에만 씁니다.
tcp_low_rto 기가비트·10기가비트 이더넷처럼 지연이 적은 네트워크에서 낮은 재전송 타임아웃을 씁니다. 패킷이 버려지면 rto 값(0~3000ms)을 씁니다. if_isno 플래그 필드에 정해야 하며 use_isno도 켜져 있어야 합니다.
tcp_nocksum, -tcp_nocksum 인터페이스에 붙은 서브넷의 로컬 트래픽에서 TCP 데이터 체크섬 검증을 끕니다(헤더 검증과 원격 트래픽 검증은 계속). -는 다시 켭니다(기본).
thread, -thread (inet만) 인터페이스 전용 커널 스레드를 구성합니다. CPU가 여럿인 SMP 시스템에서만 씁니다. 받은 패킷을 드라이버 처리 뒤 커널 스레드 큐에 넣어 다른 CPU에서 IP·TCP·UDP 처리를 하므로, 고속 어댑터가 인터럽트 처리에서 한 CPU에 몰릴 때 처리량이 좋아질 수 있습니다. 작업에 따라 스케줄링 부담으로 CPU 사용률이 늘고 처리량이 줄 수도 있습니다.
tunnel 신뢰하는 두 노드 사이에 가상 링크(터널)를 만듭니다. GRE 터널은 터널 끝의 출발지·목적지 IPv4 주소를, GIF 터널(IPv4 over IPv6, 6.1)은 출발지 IPv6 주소 다음에 쉼표로 나눈 목적지 IPv4·IPv6 주소를 받습니다. 일대다 터널은 대상마다 공백으로 나눕니다.
transfer tointerface (6.1) 주소와 그 정적 경로를 다른 인터페이스로 옮깁니다. 형식: ifconfig interface addressfamily address transfer tointerface. IPv6은 ifconfig로 더한 주소만 됩니다. 대상 인터페이스가 그 주소의 VLAN에 속하지 않으면 대상 어댑터에 VLAN을 더해야 합니다.
up 인터페이스를 활성(up)으로 표시합니다. 첫 주소를 정하면 자동으로 쓰이며, ifconfig down 뒤 다시 켤 때 씁니다.
vipa_iflist, -vipa_iflist 나가는 패킷의 출발지 주소로 이 VIPA를 쓸 인터페이스 목록에 더하거나 뺍니다.
scope addrscope zone zoneid (inet6만, 6.1) 인터페이스를 addrscope 범위의 zoneid 영역으로 옮깁니다. IPv6 영역은 RFC 4007에 정의되어 있습니다.

인터페이스별 네트워크 옵션(ISNO):

옵션 설명
rfc1323 [0 | 1] 이 인터페이스를 쓰는 TCP 연결이 RFC 1323 확장을 협상할지(1) 말지(0). 소켓 응용 프로그램은 setsockopt로 연결마다 바꿀 수 있습니다.
-rfc1323 이 네트워크의 rfc1323 ISNO를 없애 전역 값을 씁니다.
tcp_mssdflt Number 원격 네트워크와 통신할 때 이 인터페이스의 소켓이 쓸 기본 최대 세그먼트 크기.
-tcp_mssdflt ISNO를 없애 no의 전역 값을 씁니다.
tcp_recvspace Size 이 인터페이스에서 받는 소켓의 기본 버퍼 크기. TCP 창 크기에 영향을 줍니다.
-tcp_recvspace ISNO를 없애 전역 값을 씁니다.
tcp_sendspace Size 이 인터페이스에서 보내는 소켓의 기본 버퍼 크기.
-tcp_sendspace ISNO를 없애 전역 값을 씁니다.
tcp_nodelay [0 | 1] 이 인터페이스로 TCP를 쓰는 소켓이 보낼 때 Nagle 알고리즘을 따를지. 기본은 따릅니다.
-tcp_nodelay ISNO를 없앱니다.

팁: ifconfig로 정한 매개변수는 다음에 시스템을 다시 시작하면 사라집니다. 영구로 하려면 chdev로 인터페이스의 ODM을 바꿉니다. 속성은 lsattr -E -l 인터페이스로 보고 chdev -l 인터페이스 -a 속성=값으로 바꿉니다.

bash
lsattr -E -l en0
chdev -l en0 -a tcp_sendspace=65536
영어 원문
  • address — Specifies the network address for the network interface. For the inet family, the address parameter is either a host name or an IP address in the standard dotted decimal notation.
  • addressfamily — Specifies which network address family to change. The inet and inet6 address families are currently supported. This parameter defaults to the inet address family.
  • destinationaddress — Specifies the address of the correspondent on the remote end of a point-to-point link.
  • interface — Specifies the network interface configuration values to show or change. You must specify an interface with the interface parameter when you use the ifconfig command. Abbreviations for the interfaces include: • at for asynchronous transfer mode (ATM) • en for Standard Ethernet (inet) • et for IEEE 802.3 Ethernet (inet) • gre for generic routing encapsulation tunnel pseudointerface (inet) • gif for IPv4-over-IPv6 tunnel pseudointerface (inet) • tr for token-ring (inet) • xt for X.25 (inet) • sl for serial line IP (inet) • lo for loopback (inet) • op for serial (inet) • vi for virtual IP address (inet) • ib for IP over InfiniBand (inet) • tap for TAP pseudo-Ethernet Include a numeral after the abbreviation to identify the specific interface (for example, tr0). If interface is not yet loaded, ifconfig interface loads that interface and netstat -in lists it. In processing a status query for interface, that interface is loaded (if not already loaded) to complete the query processing.
  • parameter — Allows the following parameter values: alias Establishes an additional network address for the interface. When changing network numbers, this parameter is useful for accepting packets that are addressed to the old interface. allcast Sets the token-ring interface to broadcast to all rings on the network. -allcast Confines the token-ring interface to broadcast only to the local ring. anycast (inet6 only) Adds the specified anycast address. -anycast (inet6 only) Deletes the specified anycast address. arp Enables the ifconfig command to use the Address Resolution Protocol in mapping between network-level addresses and link-level addresses. The arp value is the default. -arp Disables the use of the address resolution protocol. authority Reserved for future use. bridge Reserved for future use. -bridge Reserved for future use. broadcast Address (inet only) Specifies the address to use to broadcast to the network. The default broadcast address has a host part of all 1's. checksum_offload Enables the flag to indicate that the transmit TCP checksum will be offloaded to the adapter. The command also resets the per-interface counter that determines whether TCP must dynamically enable or disable offloading of checksum computation. -checksum_offload Disables transmit TCP checksum offloading. create (TAP only) Creates a network interface. You can either create a specific interface, such as tap0 or specify the tap option to create the next available TAP interface, such as ifconfig tap create. -dad (inet6 only) Does not perform duplicate IPv6 address detection. -debug Disables driver-dependent debug code. delete Removes the specified network address. This command is used when an alias is incorrectly specified or when it is no longer needed. Incorrectly setting an ns address has the side effect of specifying the host portion of the network address. Removing all ns addresses lets you specify the host portion again. destroy (TAP only) Destroys a network interface. The ifconfig command removes the specified network interface from the list of interfaces. It also removes the interface and any associated TAP network device from the Object Data Manager (ODM). device dev_name (ATM network interface only). Specifies the device name that this interface is associated with. Unlike token ring or Ethernet, in case of ATM, there is not a one-to-one correspondence between an interface and a device. In the case of ATM, there can be more than one interface for every device. detach Removes an interface from the network interface list. If the last interface is detached, the network interface driver code is unloaded. For the interface route of an attached interface to be changed, that interface must be detached and added again with ifconfig. down Marks an interface as inactive (down), which keeps the system from trying to transmit messages through that interface. If possible, the ifconfig command also resets the interface to disable the reception of messages. Routes that use the interface, however, are not automatically disabled. eui64 (inet6 only) Computes real IPv6 address by replacing the last 64 bytes of the specified address with the Interface Identifier. first Puts an IPv6 address at the first place on an interface to select it as the source for unbound sockets. The syntax for using this parameter is as follows: ifconfig interface inet6 first address firstalias Same as alias, but sets the address in front of the interface address list to select it as the source for unbound sockets. group ID Adds a group ID to the group ID list for the interface. This list is used in determining the route to use when forwarding packets that arrived on the interface. -group ID Removes a group ID from the group ID list for the interface. This list is used in determining the route to use when forwarding packets that arrived on the interface. hwloop Enables hardware loopback. The hardware loopback specifies that locally addressed packets that are handled by an interface are sent out by using the associated adapter. -hwloop Disables hardware loop-back. The hardware loop-back specifies that locally addressed packets that are handled by an interface must be sent out using the associated adapter. ipdst Specifies an Internet host that can receive IP packets encapsulating ns packets that are bound for a remote network. An apparent point-to-point link is constructed, and the specified address is taken as the ns address and network of the destination. ipv6dst Used to specify an IPv6 node that can receive IPv6 packets encapsulating IPv6 or IPv4 packets through a tunnel. The apparent destination of the point-to-point tunnel interface might not be the real destination of the packets. At the tunnel endpoint, the decapsulated packets might then be forwarded to their final destination. largesend Enables one LPAR to send large data in a single packet to another LPAR. It works similarly to largesend over real adapters except in this case no TCP segmentation is done. If the SEA on VIOS supports largesend, the LPAR can transmit large data, which gets segmented by the real adapter on SEA. Use the chdev command to enable the largesend attribute on SEA. -largesend Disables largesend over virtual Ethernet. This value is the default. link [0-2] Enables special processing of the link level of the interface. These 3 options are interface-specific. In actual effect, however, they are used to select special modes of operation. An example of the usage is to enable Serial Line Internet Protocol (SLIP) compression, or to select the connector type for some Ethernet cards. For more information, see the manual page of the specific driver. -link [0-2] Disables special processing at the link level with the specified interface. metric Number Sets the routing metric of the interface to the value specified by the Number variable. The default is 0. The routing metric is used by the routing protocol (the routed daemon). Higher metrics have the effect of making a route less favorable. Metrics are counted as additional hops to the destination network or host. monitor Enables the underlying adapter to notify the interface layer of link status changes. The adapter must support link status callback notification. If multipath routing is used, alternative routes are selected when a link goes down. -monitor Disables monitoring of the adapter link status. mtu Value Sets the maximum IP packet size for this system. The Value variable can be a number in the range 60 - 65535, but is media-dependent. See Automatic configuration of network interfaces in Networks and communication management for the maximum transmission unit (MTU) values by interface. netmask Mask Specifies how much of the address to reserve for subdividing networks into subnetworks. This parameter can be used only with the inet address family. The Mask variable includes both the network part and the subnet part of the local address, which is taken from the host field of the address. The mask can be specified as a single hexadecimal number beginning with 0x, in standard Internet dotted decimal notation, or beginning with a name or alias that is listed in the /etc/networks file. In the 32-bit address, the Mask variable contains 1s for the bit positions that are reserved for the network and subnet parts and Mask variable contains 0s for the bit positions that specify the host. The Mask variable contains at least the standard network portion. The subnet segment is contiguous with the network segment. If the netmask parameter is used without specifying the IP address, then the netmask value of the first IP address of the specified interface is updated. pvc (ATM network interface only). Specifies that this interface supports Permanent Virtual Circuit (PVC) types of virtual connections only. pktchain Enables the flag to indicate that this interface can handle multiple packets chained together on the output path. -pktchain Disables the flag that indicates that this interface can handle multiple packets chained together on the output path. svc_c server_addr (ATM Network interface only). Specifies that this interface supports both switched virtual circuit (SVC) and PVC types of virtual connections. It further specifies that this interface is an ARP client. The server_addr is the list of 20-byte ATM addresses of the ARP servers that this client uses. The addresses are specified in the form of xx.xx....xx. The first entry is considered the primary ARP server and the rest are considered secondary ARP servers. The list of 20-byte ARP server addresses must be separated by a comma. site6 Sets the IPv6 site number (default is 0). This command must be used only with site-local addresses on a multiple-site node. svc_s (ATM network interface only). Specifies that this interface supports both SVC and PVC types of virtual connections. It further specifies that this interface is the ARP server for this logical IP subnetwork (LIS). security Reserved for future use. snap Reserved for future use. -snap Reserved for future use. tcp_low_rto Enables the use of lower retransmission timeouts (RTO) for TCP connections on a low latency, fast network, such as gigabit ethernet and 10-gigabit ethernet). If the networks experience packet drops, the respective TCP connections use the rto value for RTO. The rto values are in the range of 0 - 3000 ms. This runtime option must be set in the if_isno flags field. The use_isno option must also be set for this flag to be effective. tcp_nocksum Disables verification of the checksum of TCP data for local traffic to the subnet attached to the interface. Checksum verification of TCP, UDP, and IP headers continues. Checksum verification of TCP data that is read or written from this interface, from or to remote networks also continues. -tcp_nocksum Enables verification of the checksum of TCP data for local traffic to the subnet attached to the interface. This value is the default. thread (inet only) Configures dedicated kernel threads for an interface. This parameter can be used only SMP systems that have multiple CPU. This parameter causes input packets to be queued to a kernel thread after processing by the device driver and input demuxer. The input packet is processed in IP and TCP, or UDP by the thread instead of directly on the interrupt level. Setting this parameter can improve throughput when high-speed adapters bottleneck on a single CPU during interrupt processing by allowing the input packets to be processed on other CPUs running the kernel threads (improved pipelining). For some workloads, this parameter increases the per packet load, due to the thread scheduling load, resulting in higher CPU utilization, and possibly lower throughput. -thread (inet only) Disables kernel thread support that has been configured with the thread parameter. tunnel Configures a dedicated tunnel for the trusted communication. A tunnel establishes a virtual link between two trusted nodes for transmitting data packets as payloads of other packet headers. A tunnel can be one of the following types: Generic routing encapsulation (GRE) tunnel Expects the source and destination IPv4 addresses of the tunnel endpoint as arguments that are followed by the tunnel parameter value. A tunnel is created between the 2 endpoints. IPv4 over IPv6 tunnel (GIF tunnel) Expects the source IPv6 address of the tunnel. The address is followed by a destination IPv4 address and a destination IPv6 address that are separated by a comma. For one-to-many tunnels, each target is separated by a comma. transfer tointerface Transfers an address and its related static routes from interface to tointerface. For IPv6, this command works only for addresses added by using the ifconfig command. ifconfig interface addressfamily address transfer tointerface Note: If you want to transfer an IP address from one interface to another, and if the destination interface is not part of the virtual LAN (VLAN) to which the IP address belongs, you must add the VLAN to the adapter on which the destination interface is configured. up Marks an interface as active (up). This parameter is used automatically when you set the first address for an interface. It can also be used to enable an interface after you issue an ifconfig down command. vipa_iflist Adds the interfaces to the list of interfaces that must use this vipa parameter as the source address in the outgoing packets. -vipa_iflist Removes the interfaces from the list of interfaces that are configured to use this vipa as the source address in the outgoing packets. scope addrscope zone zoneid Moves the interface into the topological zone that is specified by zoneid at the address scope that is specified by the addrscope. IPv6 zones are defined in RFC 4007. The parameter is applicable to only inet6.
  • rto — Specifies the retransmission timeout in milliseconds. The range for this value is 0 - 3000. Requirement: You must set the timer_wheel_tick value of the no command before you set the rto value by using the ifconfig command. The rto value that you specify must be equal to or a multiple of 10 times the timer_wheel_tick value that is set.

The following network options, commonly known as Interface Specific Network Options (ISNO), can be configured on a per interface basis:

rfc1323 [0 | 1] Enables or disables TCP enhancements as specified by RFC 1323, TCP Extensions for High Performance. A value of 1 specifies that all TCP connections by using this interface will attempt to negotiate the RFC enhancements. A value of 0 disables rfc1323 for all connections by using this interface. The SOCKETS application can override this ISNO and global behavior on individual TCP connections with the setsockopt subroutine.

-rfc1323 Removes the use of ISNO for rfc1323 for this network. A SOCKETS application can override the global behavior on individual TCP connections by using the setsockopt subroutine.

tcp_mssdflt Number Sets the default maximum segment size that is used in communicating with remote networks. If you communicate over this interface, a socket uses Number as the value of the default maximum segment size.

-tcp_mssdflt Removes the use of ISNO for the tcp_mssdflt option. The global value, which is manipulated through /usr/sbin/no, is used instead.

tcp_recvspace Size Specifies the default socket buffer size for interface sockets that are receiving data. The buffer size affects the window size that is used by TCP. (For more information, see the no command.)

-tcp_recvspace Removes the use of ISNO for the tcp_recvspace option. The global value is used instead.

tcp_sendspace Size Specifies the default socket buffer size for interface sockets that are sending data. The buffer size affects the window size that is used by TCP. (For more information, see the no command.)

-tcp_sendspace Removes the use of ISNO for the tcp_sendspace option. The global value is used instead.

tcp_nodelay [0 | 1] Specifies that sockets by using TCP over this interface follow the Nagle algorithm when you send data. By default, TCP follows the Nagle algorithm.

-tcp_nodelay Removes the use of ISNO for the tcp_nodelay option.

Tip: Parameters that you set by using the ifconfig command are lost the next time that you restart your system. Use the chdev command to change the Object Data Manager (ODM) database for each interface to make parameter changes permanent. Use the lsattr -E -l [interface] command to view the interface attributes and use the chdev -l [interface] -a [attribute=value] command to change the attribute. For example:

lsattr -E -l en0
chdev -l en0 -a tcp_sendspace=65536

보안

RBAC 사용자와 Trusted AIX 사용자는 주의하세요. 이 명령은 특권 작업을 할 수 있으며, 특권 작업은 특권 사용자만 할 수 있습니다. 특권과 권한 목록은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다(6.1 문서에만 있음).

영어 원문

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

예제

  1. 직렬 회선 IP 인터페이스 sl1의 상태를 봅니다.
bash
ifconfig sl1

결과는 다음과 비슷합니다.

text
sl1: flags=51<UP,POINTOPOINT,RUNNING>
          inet 192.9.201.3 --> 192.9.354.7 netmask ffffff00
  1. 로컬 루프백 인터페이스를 구성합니다.
bash
ifconfig lo0 inet 127.0.0.1 up
  1. 로컬 토큰 링 인터페이스 tr0을 down으로 표시합니다. 인터페이스 구성은 root 권한이 있어야 바꿀 수 있습니다.
bash
ifconfig tr0 inet down
  1. 전역 값이 1일 때 en0의 모든 연결에서 rfc1323을 끕니다.
bash
ifconfig en0 rfc1323 0
  1. VIPA를 쓸 인터페이스 목록을 정하고(첫 줄), 일부를 빼고(둘째 줄), VIPA vi0을 쓰는 인터페이스를 확인합니다(셋째 줄).
bash
ifconfig vi0 vipa_iflist en0,en1,tr0
ifconfig vi0 -vipa_iflist en1,tr0
ifconfig vi0
  1. 링크 상태 감시를 켭니다. 어댑터 ent0의 링크가 down이 되면 어댑터가 인터페이스 계층에 알려 인터페이스도 down으로 표시됩니다.
bash
ifconfig en0 monitor
  1. 두 노드의 인터페이스 사이에 GRE 터널을 만들고(로컬 9.3.149.70, 원격 9.3.149.121, 로컬 끝은 gre0), 새 인터페이스에 IP 주소를 정합니다.
bash
ifconfig gre0 tunnel 9.3.149.70 9.3.149.121
ifconfig gre0 10.10.10.1
  1. GRE 터널에 NAT를 구성합니다. GRE 패킷의 원래 목적지 포트 80을 8080으로, 목적지 주소를 127.0.0.1로 바꿉니다.
bash
ifconfig gre0 nat toaddr 127.0.0.1 fromport 80 toport 8080
  1. (6.1) 일대다 GIF 터널을 만듭니다. 출발지 2000::4612:6995:6c4a:fa6e와 세 대상(...:fa6a, ...:fa6b, ...:f777) 사이에 터널을 만들고 GIF 인터페이스에 10.10.10.1을 정합니다.
bash
ifconfig gif0 10.10.10.1 netmask 255.255.255.0 tunnel 2000::4612:6995:6c4a:fa6e \
  10.10.10.10,2000::4612:6995:6c4a:fa6a 10.10.10.11,2000::4612:6995:6c4a:fa6b \
  15.15.15.1,2000::4612:6995:6c4a:f777
  1. (6.1) 두 끝 사이에 일대일 GIF 터널을 만들고 GIF 인터페이스에 10.10.10.1을 정합니다.
bash
ifconfig gif0 10.10.10.1 netmask 255.255.255.0 tunnel 2000::4612:6995:6c4a:fa6e \
  10.10.10.10,2000::4612:6995:6c4a:fa66

자주 쓰는 형태:

bash
ifconfig -a                                   # 모든 인터페이스
ifconfig en0 alias 10.1.1.20 netmask 255.255.255.0   # 별칭 주소 더하기
ifconfig en0 delete 10.1.1.20                 # 별칭 주소 지우기
chdev -l en0 -a alias4=10.1.1.20,255.255.255.0       # 별칭을 영구로(ODM)
ifconfig en0 down detach                      # 인터페이스를 내리고 떼기
영어 원문
  1. To query the status of a serial line IP interface, enter the following command:
ifconfig sl1

In this example, the interface to be queried is sl1. The result of the command looks similar to the following result:

sl1: flags=51<UP,POINTOPOINT,RUNNING>
          inet 192.9.201.3 --> 192.9.354.7 netmask ffffff00
  1. To configure the local loop-back interface, enter the following command:
ifconfig lo0 inet 127.0.0.1 up
  1. To mark the local token-ring interface as down, enter the following command:
ifconfig tr0 inet down

In this example, the interface to be marked is token0.

Note: Only a user with root user authority can modify the configuration of a network interface.

  1. To turn rfc1323 off for all connections over en5 (assuming that the global value is 1), enter the following command:
ifconfig en0 rfc1323 0
  1. To configure a list of interfaces to use a vipa, enter the following command:
ifconfig vi0 vipa_iflist en0,en1,tr0
  1. To remove interfaces that are configured to use vipa, enter the following command:
ifconfig vi0 -vipa_iflist en1,tr0
  1. To find out which interfaces are configured to use a vipa, say vi0, enter the following command:
ifconfig vi0
  1. To enable link status monitoring, enter the following command:
ifconfig en0 monitor

If the link status on adapter ent0 changes to down, the adapter notifies the interface layer, which causes the interface to also be marked as down.

  1. To configure a Generic Routing Encapsulation (GRE) tunnel between the interfaces of two nodes, enter the following command:
ifconfig gre0 tunnel 9.3.149.70 9.3.149.121

This creates a GRE tunnel between the local interface 9.3.149.70 and the remote interface 9.3.149.121. The local end of the tunnel is identified by gre0.

  1. To associate an IP address with the newly created interface, enter the following command:
ifconfig gre0 10.10.10.1
  1. To configure NAT on a GRE tunnel, enter the following command:
ifconfig gre0 nat toaddr 127.0.0.1 fromport 80 toport 8080

In this example, the original destination port of the GRE packet is 80 and the command changes the destination port to 8080 and the destination address to 127.0.0.1.

  1. To configure a GIF tunnel between one-to-many endpoints (one-to-many tunnel), enter the following command:
ifconfig gif0 10.10.10.1 netmask 255.255.255.0 tunnel 2000::4612:6995:6c4a:fa6e
10.10.10.10,2000::4612:6995:6c4a:fa6a 10.10.10.11,2000::4612:6995:6c4a:
fa6b 15.15.15.1,2000::4612:6995:6c4a:f777

The command creates a one-to-many tunnel between the source (2000::4612:6995:6c4a:fa6e) and the following 3 targets:

  • 2000::4612:6995:6c4a:fa6a

  • 2000::4612:6995:6c4a:fa6b

  • 2000::4612:6995:6c4a:f777

The command also configures the 10.10.10.1 IP address to the GIF interface.

  1. To configure a one-to-one GIF tunnel between two endpoints, enter the following command:
ifconfig gif0 10.10.10.1 netmask 255.255.255.0 tunnel 2000::4612:6995:6c4a:fa6e
10.10.10.10,2000::4612:6995:6c4a:fa66

The command creates a GIF tunnel between the source (2000::4612:6995:6c4a:fa6e) and the target (2000::4612:6995:6c4a:fa66).

  1. The command also configures the 10.10.10.1 IP address to a GIF interface.

파일

파일 설명
/etc/hosts 호스트 이름 데이터베이스
/etc/networks 네트워크 이름
영어 원문
  • /etc/host — Contains the host name database.
  • /etc/networks — Contains network names.

Related information:

  • hosts command
  • networks file format for TCP/IP
  • TCP/IP routing
  • Changing the VLAN IDs of a virtual Ethernet adapter
  • Adding virtual adapters dynamically

리눅스(GNU)와 다른 점

리눅스에서도 ifconfig(net-tools)가 있지만 지금은 ip 명령(iproute2)을 주로 씁니다. ifconfig -a는 ip addr, 주소 지정은 ip addr add 10.1.1.10/24 dev eth0, 켜기·끄기는 ip link set eth0 up|down, MTU는 ip link set eth0 mtu 9000입니다. 영구 설정은 NetworkManager(nmcli)나 배포판의 네트워크 설정 파일에 두며, AIX의 ODM·chdev에 해당합니다. ISNO 같은 인터페이스별 소켓 버퍼 설정은 없습니다.