grimoire

personal wiki
git clone git://git.pyratebeard.net/grimoire.git
Log | Files | Refs

subnet_cheatsheet.md (10578B)


      1 # subnet cheatsheet
      2 
      3 https://oav.net/mirrors/cidr.html
      4 
      5 ```
      6 Netmask              Netmask (binary)                 CIDR     Notes    
      7 _____________________________________________________________________________
      8 255.255.255.255  11111111.11111111.11111111.11111111  /32  Host (single addr)
      9 255.255.255.254  11111111.11111111.11111111.11111110  /31  Unuseable
     10 255.255.255.252  11111111.11111111.11111111.11111100  /30    2  useable
     11 255.255.255.248  11111111.11111111.11111111.11111000  /29    6  useable
     12 255.255.255.240  11111111.11111111.11111111.11110000  /28   14  useable
     13 255.255.255.224  11111111.11111111.11111111.11100000  /27   30  useable
     14 255.255.255.192  11111111.11111111.11111111.11000000  /26   62  useable
     15 255.255.255.128  11111111.11111111.11111111.10000000  /25  126  useable
     16 255.255.255.0    11111111.11111111.11111111.00000000  /24 "Class C" 254 useable
     17 
     18 255.255.254.0    11111111.11111111.11111110.00000000  /23    2  Class C's
     19 255.255.252.0    11111111.11111111.11111100.00000000  /22    4  Class C's
     20 255.255.248.0    11111111.11111111.11111000.00000000  /21    8  Class C's
     21 255.255.240.0    11111111.11111111.11110000.00000000  /20   16  Class C's
     22 255.255.224.0    11111111.11111111.11100000.00000000  /19   32  Class C's
     23 255.255.192.0    11111111.11111111.11000000.00000000  /18   64  Class C's
     24 255.255.128.0    11111111.11111111.10000000.00000000  /17  128  Class C's
     25 255.255.0.0      11111111.11111111.00000000.00000000  /16  "Class B"
     26      
     27 255.254.0.0      11111111.11111110.00000000.00000000  /15    2  Class B's
     28 255.252.0.0      11111111.11111100.00000000.00000000  /14    4  Class B's
     29 255.248.0.0      11111111.11111000.00000000.00000000  /13    8  Class B's
     30 255.240.0.0      11111111.11110000.00000000.00000000  /12   16  Class B's
     31 255.224.0.0      11111111.11100000.00000000.00000000  /11   32  Class B's
     32 255.192.0.0      11111111.11000000.00000000.00000000  /10   64  Class B's
     33 255.128.0.0      11111111.10000000.00000000.00000000  /9   128  Class B's
     34 255.0.0.0        11111111.00000000.00000000.00000000  /8   "Class A"
     35   
     36 254.0.0.0        11111110.00000000.00000000.00000000  /7
     37 252.0.0.0        11111100.00000000.00000000.00000000  /6
     38 248.0.0.0        11111000.00000000.00000000.00000000  /5
     39 240.0.0.0        11110000.00000000.00000000.00000000  /4
     40 224.0.0.0        11100000.00000000.00000000.00000000  /3
     41 192.0.0.0        11000000.00000000.00000000.00000000  /2
     42 128.0.0.0        10000000.00000000.00000000.00000000  /1
     43 0.0.0.0          00000000.00000000.00000000.00000000  /0   IP space
     44 ```
     45 
     46 ```
     47                                    Net     Host    Total
     48 Net      Addr                      Addr    Addr    Number
     49 Class   Range      NetMask         Bits    Bits   of hosts
     50 ----------------------------------------------------------
     51 A        0-127    255.0.0.0         8      24     16777216   (i.e. 114.0.0.0)
     52 B      128-191    255.255.0.0      16      16        65536   (i.e. 150.0.0.0)
     53 C      192-254    255.255.255.0    24       8          256   (i.e. 199.0.0.0)
     54 D      224-239    (multicast)
     55 E      240-255    (reserved)
     56 F      208-215    255.255.255.240  28       4           16
     57 G      216/8      ARIN - North America
     58 G      217/8      RIPE NCC - Europe
     59 G      218-219/8  APNIC
     60 H      220-221    255.255.255.248  29       3            8   (reserved)
     61 K      222-223    255.255.255.254  31       1            2   (reserved)
     62 (ref: RFC1375 & http://www.iana.org/assignments/ipv4-address-space )
     63 (               http://www.iana.org/numbers.htm                    )
     64 ----------------------------------------------------------
     65 ```
     66 
     67 The current list of special use prefixes:
     68 ```
     69   0.0.0.0/8 
     70   127.0.0.0/8
     71   192.0.2.0/24
     72   10.0.0.0/8
     73   172.16.0.0/12
     74   192.168.0.0/16
     75   169.254.0.0/16
     76   all D/E space
     77 ```
     78 - (ref: RFC1918 http://www.rfc-editor.org/rfc/rfc1918.txt   )
     79 - (       or     ftp://ftp.isi.edu/in-notes/rfc1918.txt     )
     80 - (rfc search:   http://www.rfc-editor.org/rfcsearch.html   )
     81 - (              http://www.ietf.org/ietf/1id-abstracts.txt )
     82 - (              http://www.ietf.org/shadow.html            )
     83 
     84 
     85 Martians: (updates at: www.iana.org/assignments/ipv4-address-space )
     86 ```
     87  no ip source-route
     88  access-list 100 deny   ip host 0.0.0.0 any
     89   deny ip 0.0.0.0         0.255.255.255  any log  ! antispoof
     90   deny ip 0.0.0.0 0.255.255.255  0.0.0.0 255.255.255.255 ! antispoof
     91   deny ip any             255.255.255.128 0.0.0.127 ! antispoof
     92   deny ip host            0.0.0.0        any log  ! antispoof
     93   deny ip host            [router intf]  [router intf] ! antispoof
     94   deny ip xxx.xxx.xxx.0   0.0.0.255      any log  ! lan area
     95   deny ip 0/8             0.255.255.255  any log  ! IANA - Reserved
     96   deny ip 1/8             0.255.255.255  any log  ! IANA - Reserved
     97   deny ip 2/8             0.255.255.255  any log  ! IANA - Reserved
     98   deny ip 5/8             0.255.255.255  any log  ! IANA - Reserved
     99   deny ip 7/8             0.255.255.255  any log  ! IANA - Reserved
    100   deny ip 10.0.0.0        0.255.255.255  any log  ! IANA - Private Use
    101   deny ip 23/8            0.255.255.255  any log  ! IANA - Reserved
    102   deny ip 27/8            0.255.255.255  any log  ! IANA - Reserved
    103   deny ip 31/8            0.255.255.255  any log  ! IANA - Reserved
    104   deny ip 36-37/8         0.255.255.255  any log  ! IANA - Reserved
    105   deny ip 39/8            0.255.255.255  any log  ! IANA - Reserved
    106   deny ip 41-42/8         0.255.255.255  any log  ! IANA - Reserved
    107   deny ip 50/8            0.255.255.255  any log  ! IANA - Reserved
    108   deny ip 58-60/8         0.255.255.255  any log  ! IANA - Reserved
    109   deny ip 69-79/8         0.255.255.255  any log  ! IANA - Reserved
    110   deny ip 82-95/8         0.255.255.255  any log  ! IANA - Reserved
    111   deny ip 96-126/8        0.255.255.255  any log  ! IANA - Reserved
    112   deny ip 127/8           0.255.255.255  any log  ! IANA - Reserved
    113   deny ip 169.254.0.0     0.0.255.255    any log  ! link-local network
    114   deny ip 172.16.0.0      0.15.255.255   any log  ! reserved
    115   deny ip 192.168.0.0     0.0.255.255    any log  ! reserved
    116   deny ip 192.0.2.0       0.0.0.255      any log  ! test network
    117   deny ip 197/8           0.255.255.255  any log  ! IANA - Reserved
    118   deny ip 220/8           0.255.255.255  any log  ! IANA - Reserved
    119   deny ip 222-223/8       0.255.255.255  any log  ! IANA - Reserved
    120   deny ip 224.0.0.0       31.255.255.255 any log  ! multicast
    121   deny ip 224.0.0.0       15.255.255.255 any log  ! unless MBGP-learned routes
    122   deny ip 224-239/8       0.255.255.255  any log  ! IANA - Multicast
    123   deny ip 240-255/8       0.255.255.255  any log  ! IANA - Reserved
    124 ```
    125 
    126 ```
    127 filtered source addresses
    128   0/8                 ! broadcast
    129   10/8                ! RFC 1918 private
    130   127/8               ! loopback
    131   169.254.0/16        ! link local
    132   172.16.0.0/12       ! RFC 1918 private
    133   192.0.2.0/24        ! TEST-NET
    134   192.168.0/16        ! RFC 1918 private
    135   224.0.0.0/4         ! class D multicast
    136   240.0.0.0/5         ! class E reserved
    137   248.0.0.0/5         ! reserved
    138   255.255.255.255/32  ! broadcast
    139 ```
    140 
    141 ARIN administrated blocks: (http://www.arin.net/regserv/IPStats.html)
    142 ```
    143    24.0.0.0/8 (portions of)
    144    63.0.0.0/8
    145    64.0.0.0/8
    146    65.0.0.0/8
    147    66.0.0.0/8
    148   196.0.0.0/8
    149   198.0.0.0/8
    150   199.0.0.0/8
    151   200.0.0.0/8
    152   204.0.0.0/8
    153   205.0.0.0/8
    154   206.0.0.0/8
    155   207.0.0.0/8
    156   208.0.0.0/8
    157   209.0.0.0/8
    158   216.0.0.0/8
    159 ```
    160 ----------------------------------------------------------
    161 
    162 well known ports: (rfc1700.txt)
    163  - www.iana.org/assignments/port-numbers
    164 
    165 protocol numbers:
    166  - www.iana.org/assignments/protocol-numbers
    167  - www.iana.org/numbers.htm
    168 
    169 ICMP(Types/Codes)
    170 ```
    171  Testing Destination Reachability & Status
    172   (0/0)  Echo-Reply
    173   (8/0)  Echo
    174  Unreachable Destinations
    175   (3/0)  Network Unreachable
    176   (3/1)  Host Unreachable
    177   (3/2)  Protocol Unreachable
    178   (3/3)  Port Unreachable
    179   (3/4)  Fragmentaion Needed and DF set (Pkt too big)
    180   (3/5)  Source Route Failed
    181   (3/6)  Network Unknown
    182   (3/7)  Host Unknown
    183   (3/9)  DOD Net Prohibited
    184   (3/10) DOD Host Prohibited
    185   (3/11) Net TOS Unreachable
    186   (3/12) Host TOS Unreachable
    187   (3/13) Administratively Prohibited
    188   (3/14) Host Precedence Unreachable
    189   (3/15) Precedence Unreachable
    190  Flow Control
    191   (4/0)  Source-Quench [RFC 1016]
    192  Route Change Requests from Gateways
    193   (5/0)  Redirect Datagrams for the Net
    194   (5/1)  Redirect Datagrams for the Host
    195   (5/2)  Redirect Datagrams for the TOS and Net
    196   (5/3)  Redirect Datagrams for the TOS and Host
    197  Router
    198   (6/-)  Alternate-Address
    199   (9/0)  Router-Advertisement
    200   (10/0) Router-Solicitation
    201  Detecting Circular or Excessively Long Routes
    202   (11/0) Time to Live Count Exceeded
    203   (11/1) Fragment Reassembly Time Exceeded
    204  Reporting Incorrect Datagram Headers
    205   (12/0) Parameter-Problem
    206   (12/1) Option Missing
    207   (12/2) No Room for Option
    208  Clock Synchronization and Transit Time Estimation
    209   (13/0) Timestamp-Request
    210   (14/0) Timestamp-Reply
    211  Obtaining a Network Address (RARP Alternative)
    212   (15/0) Information-Request
    213   (16/0) Information-Reply
    214  Obtaining a Subnet Mask [RFC 950]
    215   (17/0) Address Mask-Request
    216   (18/0) Address Mask-Reply
    217  Other
    218   (30/0) Traceroute
    219   (31/0) Conversion-Error
    220   (32/0) Mobile-Redirect
    221 ```
    222 
    223 Ref: [RFC 792] [RFC 896] [RFC 950] [RFC 1016]
    224   www.cisco.com/univercd/cc/td/doc/product/lan/cat6000/sw_5_3/cofigide/qos.htm#19774
    225 
    226 
    227 
    228 ```
    229 Decimal system Prefix's
    230               Factor               Exponent  Prefix
    231 ---------------------------------------------------
    232  1 000 000 000 000 000 000 000 000...10^24....yotta
    233      1 000 000 000 000 000 000 000...10^21....zetta
    234          1 000 000 000 000 000 000...10^18....exa
    235              1 000 000 000 000 000...10^15....peta
    236                  1 000 000 000 000...10^12....tera
    237                      1 000 000 000...10^9.....giga
    238                          1 000 000...10^6.....mega
    239                              1 000...10^3.....kilo
    240                                100...10^2.....hecto
    241                                 10...10^1.....deka
    242                                0.1...10^-1....deci
    243                               0.01...10^-2....centi
    244                              0.001...10^-3....milli
    245                          0.000 001...10^-6....micro
    246                      0.000 000 001...10^-9....nano
    247                  0.000 000 000 001...10^-12...pico
    248              0.000 000 000 000 001...10^-15...femto
    249          0.000 000 000 000 000 001...10^-18...atto
    250      0.000 000 000 000 000 000 001...10^-21...zepto
    251  0.000 000 000 000 000 000 000 001...10^-24...yocto
    252 ---------------------------------------------------
    253 
    254 ```
    255 - Convert Fahrenheit <> Celsius:
    256  - Celsius = (Fahrenheit - 32) / 1.8
    257  - Fahrenheit = (Celsius * 1.8) + 32
    258 
    259 
    260 last updated: 4jul02
    261 
    262 
    263