• 구름많음동두천 3.7℃
  • 흐림강릉 0.0℃
  • 구름많음서울 4.5℃
  • 구름많음대전 4.7℃
  • 흐림대구 3.4℃
  • 흐림울산 3.4℃
  • 흐림광주 5.1℃
  • 흐림부산 4.6℃
  • 흐림고창 4.7℃
  • 제주 7.5℃
  • 구름조금강화 3.7℃
  • 흐림보은 3.3℃
  • 흐림금산 3.9℃
  • 흐림강진군 5.4℃
  • 흐림경주시 2.6℃
  • 구름많음거제 5.0℃
기상청 제공

리눅스 명령어 : arp


## arp

arp 명령어는 Address Resolution Protocol의 약자로써, arp cache에 있는 IP 어드레스에 대한 HW 어드레스(대게 MAC 어드레스란 표현을 많이 사용한다)를 돌려주는 명령어이다. 이 HW 어드레스는  6 바이트로 구성되어지는데, 처음 3 바이트는 제조 벤더에 대한 교유 번호이고, 나머지 3개는 제품 일련 번호라고 한다. 결국 이 6개의 바이트는 전세계에서 유일무이한 번호가 되는데, 논리적인 IP어드레를 물리적이고 고유한 컴퓨터에 맵핑시키기 위해서는 아주 중요한 존재이다.


명령어 형식 : arp [OPTION]

옵션

-e : arp 캐쉬에 있는 HW어드레스를 리눅스 스타일로 표히
-s host HW어드레스 : arp 캐쉬에 새로운 HW어드레스를 저장
-d : arp 캐쉬에 HW어드레스를 삭제

 
실행 예

[root@linux root]# arp -e
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.10.1             ether   00:0E:E8:04:45:77      C                         eth0
192.168.10.21           ether   00:E0:91:04:12:D3      C                          eth0


Usage:
  arp [-vn]  [<HW>] [-i <if>] [-a] [<hostname>]             <-Display ARP cache
  arp [-v]          [-i <if>] -d  <hostname> [pub][nopub]    <-Delete ARP entry
  arp [-vnD] [<HW>] [-i <if>] -f  [<filename>]              <-Add entry from file
  arp [-v]   [<HW>] [-i <if>] -s  <hostname> <hwaddr> [temp][nopub] <-Add entry
  arp [-v]   [<HW>] [-i <if>] -s  <hostname> <hwaddr> [netmask <nm>] pub  <-''-
  arp [-v]   [<HW>] [-i <if>] -Ds <hostname> <if> [netmask <nm>] pub      <-''-

        -a                       display (all) hosts in alternative (BSD) style
        -e                       display (all) hosts in default (Linux) style
        -s, --set                set a new ARP entry
        -d, --delete             delete a specified entry
        -v, --verbose            be verbose
        -n, --numeric            don't resolve names
        -i, --device             specify network interface (e.g. eth0)
        -D, --use-device         read <hwaddr> from given device
        -A, -p, --protocol       specify protocol family
        -f, --file               read new entries from file or from /etc/ethers

  <HW>=Use '-H <hw>' to specify hardware address type. Default: ether
  List of possible hardware types (which support ARP):
    strip (Metricom Starmode IP) ash (Ash) ether (Ethernet)
    tr (16/4 Mbps Token Ring) tr (16/4 Mbps Token Ring (New)) ax25 (AMPR AX.25)
    netrom (AMPR NET/ROM) rose (AMPR ROSE) arcnet (ARCnet)
    dlci (Frame Relay DLCI) fddi (Fiber Distributed Data Interface) hippi (HIPPI)
    irda (IrLAP) x25 (generic X.25)