Template:IPaddr
Introduction
Template {{IPaddr}} is used to make an IP address stand out in the text, to improve readability.
An IP address is displayed in italic type, using lower case letters for IPv6 addresses.[1]
Arguments
The first parameter is the IP address to be displayed.
The second parameter is optional and indicates the number of bits in the network address in CIDR notation.
If given, it is appended to the first with a slash (/) as a separator.
When the option netmask=dotted is set, the second argument (if present) is translated to a dotted decimal netmask.
Examples
{{IPaddr|198.51.100.227}} yields: 198.51.100.227.
{{IPaddr|203.0.113.109/29}} adds the network mask as is: 203.0.113.109/29, but
{{IPaddr|203.0.113.109|29}} yields: 203.0.113.109/29 which adds some non-breaking space around the slash ('/') separator, to improve readability.
{{IPaddr||29}}[a] yields just the netmask: /29.
{{IPaddr|203.0.113.109|29|netmask=dotted}} yields: 203.0.113.109/255.255.255.248, which might sometimes be useful.
{{IPaddr||18|netmask=dotted}}[a] yields just the netmask in dotted decimal notation: 255.255.192.0 (without the slash).
{{IPaddr|2001:db8:27DF:34::|64}} yields: 2001:db8:27df:34::/64 (all lower case, as these are preferred in IPv6 addresses).
Template data
Template {{IPaddr}} is used to make an IP address stand out in the text, to improve readability.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| IP address | 1 | The IP address to display, either IPv4 or IPv6. An IP address is displayed in italics, using lower case letters for IPv6 addresses.
| String | suggested |
| Netmask bits | 2 | Number of bits in the netmask, displayed with a leading slash in CIDR notation.
| Number | optional |
| netmask style | netmask | When set to 'dotted' the netmask is displayed in dotted-decimal, rather than CIDR notation. If there is no IP address specified, the slash is not displayed.
| String | optional |
See also
- Template:MACaddr, for displaying MAC addresses
References
- ^ S. Kawamura; M. Kawashima (August 2010). A Recommendation for IPv6 Address Text Representation. Internet Engineering Task Force. doi:10.17487/RFC5952. ISSN 2070-1721. RFC 5952. Proposed Standard. Updates RFC 4291.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.