====== Computer Network ======
Useful stuff?
===== IPV4 Addresses =====
In the original IPV4 scheme, there are 5 classes for IP addresses. NA= Network address, HA = host address. NA = 0 implies local network, HA = 0 implies broadcast, HA = 1 usually for gateways (router @ interface address).
- **CLASS A** Format: 1-bit ID [0] | 7-bit NA | 3-byte HA ; Range: 1.x.x.x - 126.x.x.x (0.x.x.x & 127.x.x.x reserved) ; Net-Mask: 255.0.0.0
- **CLASS B** Format: 2-bit ID [10] | 14-bit NA | 2-byte HA ; Range: 128.x.x.x - 191.x.x.x ; Net-Mask: 255.255.0.0
- **CLASS C** Format: 3-bit ID [110] | 21-bit NA | 1-byte HA ; Range: 192.x.x.x - 223.x.x.x ; Net-Mask: 255.255.255.0
- **CLASS D** Format: 4-bit ID [1110] | 28-bit multicast address
- **CLASS E** Format: 5-bit ID [11110] | 27-bit reserved
- **Private Net Addresses (RFC1918)** Range1: 10.0.0.0 - 10.255.255.255 ; Range2: 172.16.0.0 - 172.31.255.255 ; Range3: 192.168.0.0 - 192.168.255.255
**Subnet Mask** is a method used to obtain more network groups from existing classes. HA is masked with a //subnet mask// and used as NA.
In the newer IPv4 implementation, masks are no longer fixed - classes are no longer used to define a network. IPV4 notation takes the form of x.x.x.x/y where x is an 8-bit number and y gives the number of bits used to mask out the network address.
===== IPV6 Addresses =====
Dumped...
ipv6:
- fe80 is private net
- 2xxx or 3xxx is global unicast address (GUA)! (e.g. 2001)
https://test-ipv6.com/
====== Cisco Stuff ======
My experience configuring cisco device(s). I'm just dumping my text notes for now... will try to make this prettier some other time 8-)
Status: At the moment, my DHCP server on 1841 is running and correctly providing machines on my switch with proper IPs. NAT works.
===== Cisco 1841 Router =====
I want to setup a LAN in my lab so that I can have a central login server for all Windows machines. One interface on the 1841 will be for LAN, while the other will be connected to Uni's network.
------------
general info
------------
- note that default hostname for device is 'Router'
- basic prompt is {hostname}>
- privileged prompt is {hostname}#
- to reset configuration, reboot and send break within 60 seconds?
= on minicom, hit ctrl+a-f
= should get rommon console (i.e. rommon {1-based index}>)
- configure router to bypass configuration
= type 'confreg 0x2142'
= type 'reset'
- configure router to use configuration
= type 'confreg 0x2102'
= type 'reset'
-----------------------------
configuring cisco 1841 router
-----------------------------
- pc serial port connect to rj45 console port on 1841
= need usb2serial for most pc nowadays
= need an rj45-rs232 cable!
- i use minicom on slackware
= use 9600 8n1 with no flow control
- start router, skip all wizards/auto-config
= should get 'Router>' prompt
= type ? for specific help
= typing help will tell you this :p
- type 'enable' to get to global config privileged mode
= should get 'Router#' prompt
* configure basics
- type 'conf t' to start configuring
= shortcut for 'configure terminal'
- configurations:
= no ip domain lookup
- this disables domain lookup (do not use dns)
= no logging console
- this disables log messages display on console
= hostname my1841
- changes router hostname (prompt should reflect)
= enable secret 0 my1pass
- default level is 5? but the command above still sets 5
- tested 20161208: show running-config | include enable
- maybe add keyword level before 0?
= service password-encryption
- enables password enryption (on clear text? not needed for secret?)
- type 'exit' in config-mode then write
* configure wan & lan ports
- type 'conf t' to start
- configurations:
= interface fas0/0
- prompt appended with (config-if)
- configuring fast ethernet port 0
= description WAN_LINK
- just a label
= ip address dhcp client-id FastEthernet0/0
- set to be dhcp client
= no shut
= exit
- get back to global config
= interface fas0/1
- configuring fast ethernet port 1
= description LAN_LINK
= ip address 192.168.100.1 255.255.255.0
- set private local ip
= no shut
= exit
- get back to global config
- type 'exit' in config-mode then write
* configure dhcp for lan
- type 'conf t' to start
- configurations:
= ip dhcp pool my1dhcp
- prompt appended with (dhcp-config)
= network 192.168.100.0 255.255.255.0
= default-router 192.168.100.1
= dns-server 8.8.8.8
= exit
- get back to global config
= ip dhcp excluded-address 192.168.100.1 192.168.100.9
- 'reserve' these for network management
- type 'exit' in config-mode then write
* configure gui http server
- type 'conf t' to start
- configurations:
= username admin privilege 15 password check
= ip http server
= ip http secure-server
= ip http authentication local
- type 'exit' in config-mode then write
* link wan & lan using nat (NOT TESTED!)
- type 'conf t' to start
- configurations:
= interface fas0/0
= ip nat outside
= exit
= interface fas0/1
= ip nat inside
= exit
= access-list 100 permit ip any any
- simple access-list - just allow everything
= ip nat inside source list 100 interface fas0/0
- anything sourced from ACL 100 is permitted
- outside interface (FastEthernet 0/0) is the port for PAT
- type 'exit' in config-mode then write
===== Cisco 3560 Switch =====
This switch actually have a [[https://en.wikipedia.org/wiki/Network_layer|layer 3]] implementation (well, provided you get the correct software image) that enables routing.
I just need a simple switch configuration for now.
------------
general info
------------
- note that default hostname for device is 'Switch'
- basic prompt is {hostname}>
- privileged prompt is {hostname}#
* to reset
- delete flash:vlan.dat
- erase startup-config
- reload
= do not save anything if prompted
* to check flash content
- dir flash:
* show 'show' options
- show ?
* to check boot settings
- show boot
(configure boot system)
- boot system flash: (???)
-----------------------------
configuring cisco 3560 switch
-----------------------------
* configure basics
- to start configuring
# configure terminal
- change hostname to 'my3560'
# hostname my3560
- set password 'my1pass' to enable
# enable secret my1pass
- exit config-mode
# exit
- write/save config
# write
//**Note**: The default 'factory' image should be ''c3560-ipbase-mz.122-53.SE/c3560-ipbase-mz.122-53.SE.bin'', but the one I got has ''c3560-advipservicesk9-mz.122-37.SE.bin''. I guess this is the image that provides layer 3 stuffs.//