arp 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-arp
핵심 정리
- IP 주소와 어댑터(MAC) 주소의 대응 표(ARP 표)를 보고 바꿉니다.
arp -a(모든 항목),arp -an(이름 풀이 없이),arp 호스트(하나)로 봅니다.arp -s ether 호스트 0:11:22:33:44:55 [temp] [pub]로 항목을 더하고(root만),arp -d 호스트로 지웁니다.temp가 없으면 영구 항목입니다(재부팅 전까지).-f 파일로 여러 항목을 한 번에 넣을 수 있습니다.- 이더넷에서는
-t가 필요 없고, ATM(-t atm)과 InfiniBand(-t ib)에서만 씁니다. 같은 IP를 다른 장비가 쓰면errpt에AIXIF_ARP_DUP_ADDR가 남습니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 하드웨어 유형 hf, InfiniBand(-t ib), -s는 root만 쓸 수 있다는 안내가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 1, 6.1 Volume 1 |
| 파일 | /usr/sbin/arp |
| 관련 명령어 | ifconfig, netstat, no(arpt_killc, arptab_nb) |
목적
ATM 인터페이스를 포함해 주소 변환(ARP) 정보를 보여 주고 바꿉니다.
영어 원문
Displays and modifies address resolution, including ATM (Asynchronous Transfer Mode) interfaces.
구문
ARP 항목 보기:
arp { [ -t ifType ] HostName | -a [ n ] [ /dev/kmem ] }
ARP ATM 항목 보기:
arp { -t atm HostName | -a [ n ] [ /dev/kmem ] [ pvc | svc ] }
ARP 항목 지우기:
arp [ -t ifType ] -d HostName
PVC ARP ATM 항목 지우기:
arp -t atm -d pvc vpi:vci if ifName
ARP 항목 만들기:
arp [ -t ifType ] -s Type HostName AdapterAddress [ Route ] [ temp ] [ pub ]
SVC ARP ATM 항목 만들기:
arp -t atm -s Type HostName AdapterAddress [ temp ]
PVC ARP ATM 항목 만들기:
arp -t atm -s Type pvc vpi:vci { HostName | if ifName } [ no-llc ] [ no-arp ] [ temp ]
다른 파일에서 ARP 항목 가져오기:
arp [ -t ifType ] -f FileName [ Type ]
설명
arp 명령은 주소 변환 프로토콜(ARP)이 쓰는 인터넷 주소-어댑터 주소 변환 표를 보여 주고 바꿉니다. HostName 변수로 지정한 호스트의 현재 ARP 항목을 보여 주며, 호스트는 이름이나 점 10진수 인터넷 주소로 지정합니다.
영어 원문
The arp command displays and modifies the Internet-to-adapter address translation tables used by the Address in Networks and communication management. The arp command displays the current ARP entry for the host specified by the HostName variable. The host can be specified by name or number, using Internet dotted decimal notation.
플래그
| 플래그 | 설명 |
|---|---|
-a |
현재 ARP 항목을 모두 보여 줍니다. -a /dev/kmem은 커널 메모리의 ARP 정보를 보여 주고, n을 붙이면 호스트 이름을 찾지 않습니다. ATM(-t atm)에서 pvc를 주면 PVC(영구 가상 회선)만, svc를 주면 SVC(교환 가상 회선)만 보여 주고, 둘 다 없으면 모든 ATM 가상 회선을 보여 줍니다. |
-d |
HostName의 항목을 지웁니다(root 권한 필요). ATM에서 -t atm -d pvc vpi:vci if ifName으로 쓰면 호스트 이름 대신 vpi:vci(지울 가상 회선)와 ifName(그 가상 회선이 있는 ATM 인터페이스)로 PVC 항목을 지웁니다. |
-f FileName [Type] |
파일을 읽어 ARP 표에 여러 항목을 넣습니다. 파일의 항목 형식은 [Type] HostName AdapterAddress [Route] [temp] [pub]입니다(아래 표). ATM에서는 쓸 수 없습니다. |
-s |
항목을 만듭니다(root만). 일반 형식은 -s Type HostName AdapterAddress [Route] [temp] [pub]이며 각 값의 뜻은 -f와 같습니다. 어댑터 주소는 콜론으로 나눈 16진수 6바이트입니다. ATM SVC는 -t atm -s Type HostName AdapterAddress [temp]로, 콜론으로 나눈 16진수 20바이트 ATM 주소를 주며 이 항목이 있으면 ARP 서버로 주소를 풀지 않습니다. ATM PVC는 -t atm -s Type pvc vpi:vci { HostName | if ifName } [no-llc] [no-arp] [temp]로, 목적지 호스트나 로컬 인터페이스 중 하나를 줍니다. no-llc(LLC/SNAP 캡슐화를 쓰지 않음)나 no-arp(ARP를 쓰지 않음)를 주면 목적지 호스트를 꼭 줘야 합니다. |
-t ifType |
네트워크 인터페이스 유형. 6.1 문서에서는 at(ATM)과 ib(InfiniBand)에만 필요하다고 합니다. 5.3 문서는 at에 필요하고 et, tr, xt, sl, lo, op 등에는 선택이라고 적습니다. |
-f·-s의 항목 값:
| 값 | 뜻 |
|---|---|
| Type | 하드웨어 주소 유형. 명령줄에 주었으면 파일 항목에는 쓰지 않고, 아니면 항목마다 씁니다. ether(이더넷), 802.3, fddi, 802.5(토큰 링), hf(Host-Fabric, 6.1). |
| HostName | 원격 호스트. |
| AdapterAddress | 그 호스트의 어댑터 하드웨어 주소(콜론으로 나눈 16진수 6바이트). 로컬 하드웨어 주소는 netstat -v로 봅니다. |
| Route | 토큰 링이나 FDDI 헤더에 정의된 경로. |
| temp | 임시 항목. 없으면 영구 항목입니다. |
| pub | 항목을 공개합니다. 자기 주소가 아니어도 이 시스템이 HostName에 대한 요청에 ARP 서버로 응답합니다(프록시 ARP). |
영어 원문
-a— Used as { [-tifType ] HostName|-a[ n ] [ /dev/kmem ] } Displays all of the current ARP entries. Specify the-a /dev/kmemflag to display ARP information for kernel memory. The 'n' modifier causes hostname lookups to be suppressed. Used as {-t atmHostName|-a[ n ] [ /dev/kmem ] [ pvc|svc ] } The pvc specification will display only ATM PVC (Permanent Virtual Circuits) types of virtual circuits, svc specification will display only ATM SVC (Switched Virtual Circuits) types of virtual circuits. If the pvc|svc parameter is omitted, all ATM virtual circuits will be displayed.-d— Used as [-tifType ]-dHostName Deletes an entry for the host specified by the HostName variable if the user has root user authority. Used as-t atm -d pvcvpi:vci if ifName Deletes a PVC ARP entry by specifying vpi:vci rather than hostname. The vpi:vci variables specify the virtual circuit that is to be deleted. The ifname variable specifies the name of the ATM interface on which the virtual circuit is to be deleted.-fFileName[Type]— Causes the file specified by the FileName variable to be read and multiple entries to be set in the ARP tables. Entries in the file should be in the form:[Type] HostName AdapterAddress [Route] [temp] [pub]whereTypeSpecifies the type of hardware address. If the address type is specified when invoking arp from the command line, it should not be specified in the file entries. Otherwise, it should be specified in each file entry. Valid hardware address types are: •etherfor an Ethernet interface •802.3for an 802.3 interface •fddifor a Fiber Distributed Data interface •802.5for a Token-Ring interface •hffor a Host-Fabric interfaceHostNameSpecifies the remote host.AdapterAddressSpecifies the hardware address of the adapter for this host as 6 hexadecimal bytes separated by colons. Use the netstat -v command to display the local hardware address.RouteSpecifies the route for a Token-Ring interface or Fiber Distributed Data Interface (FDDI) as defined in the Token-Ring or FDDI header.tempSpecifies that this ARP table entry is temporary. The table entry is permanent if this argument is omitted.pubSpecifies that this table entry is to be published, and that this system will act as an ARP server responding to requests forHostName, even though the host address is not its own. Note: The-fflag is not supported for ATM.-s— Used as [-tifType ]-sType HostName AdapterAddress [ Route ] [ temp ] [ pub ] Creates an ARP entry of the type specified by the Type variable for the host specified by the HostName variable with the adapter address specified by the AdapterAddress variable. Only users with root authority can use the-sflag. The adapter address is given as 6 hexadecimal bytes separated by colons. The line must be in the following format:Type HostName AdapterAddress [Route] [temp] [pub]where the Type, HostName, AdapterAddress, Route, temp, and pub parameters have the same purpose and definitions as the parameters for the-fflag. Used as-t atm -sType HostName AdapterAddress [ temp ] Creates a SVC type of ARP entry for the remote host, specified by the HostName variable, with the ATM address specified by the ATMAddress variable. The ATM address is given as 20 hexadecimal bytes separated by colons. Creation of this entry causes this IP station to not use ARP server mechanism to resolve IP addresses. Used as-t atm -sType pvc vpi:vci { HostName|if ifName } [ no-llc ] [ no-arp ] [ temp ] Creates a PVC type of ARP entry for the remote host, specified by the HostName variable, with the PVC specified by the vpi:vci. Either destination Hostname or the local ifname needs to be specified. The no-llc flag is used to indicate that LLC/SNAP encapsulation will not be used on this virtual circuit, in this case, the destination Hostname needs to be specified. The no-arp flag is used to indicate that ARP protocol will not be used on this virtual circuit, in this case, the destination Hostname needs to be specified. The temp parameter specifies that this ARP table entry is temporary, the table entry is permanent if this argument is omitted.-tifType — The-tiftype flag is used to indicate the type of Network interface. This flag is only required for the following interfaces: • at for ATM • ib for InfiniBand
보안
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.
예제
| 명령 | 하는 일 |
|---|---|
arp -s 802.3 host2 0:dd:0:a:85:0 temp |
다음 재시작 때까지 유지되는 항목 하나를 더함 |
arp -d host1 |
host1의 항목을 지움 |
arp -t atm -a host1 |
ATM 호스트 host1의 항목 |
arp -t atm -s atm pvc 0:20 host2 |
ATM 호스트 host2의 PVC 항목을 더함 |
arp -t atm -s atm pvc 0:20 if at0 |
인터페이스 at0의 PVC 항목을 더함 |
자주 쓰는 형태:
arp -an # 모든 항목, 이름 풀이 없이
arp 10.1.1.1 # 게이트웨이의 MAC 확인
arp -d 10.1.1.20 # 바뀐 장비의 오래된 항목 지우기
arp -s ether 10.1.1.20 0:11:22:33:44:55 # 고정 항목 더하기
영어 원문
- To add a single entry to the arp mapping tables until the next time the system is restarted, type:
arp -s 802.3 host2 0:dd:0:a:85:0 temp
- To delete a map table entry for the specified host with the arp command, type:
arp -d host1 flag
- To display arp entries for atm host
host1, type:
arp -t atm -a host1
- To add a PVC arp entry for atm host
host2, type:
arp -t atm -s atm pvc 0:20 host2
- To add a PVC arp entry for an interface
at0, type:
arp -t atm -s atm pvc 0:20 if at0
Related information:
- ifconfig command
- netstat command
- inetd command
TCP/IP protocols
리눅스(GNU)와 다른 점
리눅스에서는 ip neigh(iproute2)를 주로 씁니다. arp -an은 ip neigh show, 지우기는 ip neigh del 10.1.1.20 dev eth0, 고정 항목은 ip neigh add 10.1.1.20 lladdr 00:11:22:33:44:55 dev eth0 nud permanent입니다. arp(net-tools)도 있으며 -a, -n, -d, -s의 뜻은 비슷합니다. ARP 캐시 유지 시간은 sysctl net.ipv4.neigh.*로 조정합니다(AIX는 no -o arpt_killc).