티스토리 뷰

개발/Linux

IPv6 address percent sign(%)

Jaeyeon Baek 2015. 8. 26. 21:28


IPv6를 이용한 ssh 접속 실패 로그에 아래와 같은 부분이 발견되었습니다.

2001::......:1%12121212

통상 알고 있는 형태와는 다르게 퍼센트(%) 기호가 들어가고 뒤에는 알수 없는 숫자(하지만 항상 같은 숫자인것으로 보아 더미는 아닌)가 출력되어 있습니다.


도대체 뭘까 하는 마음에 이리저리 검색을 해보았는데 관련된 정보가 생각보다 많았습니다. 검색 키워드는 zone id


그중에 나름 꽤 잘 설명이 되어 있는 링크를 아래 첨부합니다. https://en.wikipedia.org/wiki/IPv6_address


아직 IPv6가 익숙하지 않아서 많은 사람들이 알지 못하는 정보인듯 하여 공유하도록 합니다. (링크 중 관련된 부분 첨부)

Link-local addresses and zone indices[edit]

Because all link-local addresses in a host have a common prefix, normal routing procedures cannot be used to choose the outgoing interface when sending packets to a link-local destination. A special identifier, known as a zone index,[8] is needed to provide the additional routing information; in the case of link-local addresses, zone indices correspond to interface identifiers.

When an address is written textually, the zone index is appended to the address, separated by a percent sign (%). The actual syntax of zone indices depends on the operating system:

  • the Microsoft Windows IPv6 stack uses numeric zone indices, e.g., fe80::3%1. The index is determined by the interface number;
  • most Unix-like systems (e.g., BSDLinuxOS X) use the interface name as a zone index: fe80::3%eth0.
  • alternatively, on BSD based operating systems (including OS X), a numeric zone index can be used in the second 16-bit word, e.g.: fe80:1::3

Zone index notations cause syntax conflicts when used in uniform resource identifiers (URI), so the '%' character must be escaped via percent-encoding:[38] http://[fe80::3%25eth0]



[추가]

보통 이 메시지는 getnameinfo() 함수를 사용할때 찾아볼 수 있습니다. (ex OpenSSH)


'개발 > Linux' 카테고리의 다른 글

backtrace와 addr2line을 이용한 디버깅 방법  (6) 2015.11.20
ipc 확인/추가/삭제  (0) 2015.11.20
mariadb mips cross-compile 문제  (0) 2015.08.22
PAM 연동을 위한 tacacs+ 서버 설치 및 설정  (0) 2015.07.22
smtp 컴파일  (13) 2015.03.20
댓글
최근에 올라온 글
최근에 달린 댓글
글 보관함
Total
Today
Yesterday