• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:IPaddr/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:IPaddr

This is the template sandbox page for Template:IPaddr (diff).
Template documentation[view] [edit] [history] [purge]
Not to be confused with the template for addressing anonymous Wikipedia editors: Template:IP address.

Contents

  • 1 Introduction
  • 2 Arguments
  • 3 Examples
  • 4 Template data
  • 5 See also
  • 6 References

Introduction

edit

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

edit

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

edit

{{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).

  1. ^ a b Notice the double pipe symbol, which means an empty first field.

Template data

edit

Template {{IPaddr}} is used to make an IP address stand out in the text, to improve readability.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
IP address1

The IP address to display, either IPv4 or IPv6. An IP address is displayed in italics, using lower case letters for IPv6 addresses.

Example
198.51.100.52 or 2001:db8:3fb6:3::12f
Stringsuggested
Netmask bits2

Number of bits in the netmask, displayed with a leading slash in CIDR notation.

Example
24
Numberoptional
netmask stylenetmask

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.

Example
dotted
Stringoptional

See also

edit
  • Template:MACaddr, for displaying MAC addresses

References

edit
  1. ^ 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.
The above documentation is transcluded from Template:IPaddr/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:IPaddr/sandbox&oldid=840046313"
Last edited on 7 May 2018, at 11:08

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 7 May 2018, at 11:08 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop