Pages

DDNS and QNAP NAS

I was looking recently to allow remote access into my home QNAP NAS from remote locations.
My IP address at home is dynamic so I needed a DDNS provider and some port forwarding on the home router.
My setup at home is simple. My internet connection is over a DSL line. I have a DSL router from the ISP serving as an Wifi access point for my devices at home. It also has 4 ethernet ports and to one of them I have my QNAP NAS connected.

After looking throgh a few reviews on the internet, I choosed DuckDNS. What i liked about it the most is their variety support in operating systems and the way the dynamic update is done - through an HTTPS GET request (can use also HTTP GET, but HTTPS is recommended). Secure and implemented in any decent OS. Full specs here.
You log in with one account from various social networks (reddit, G+, facebook, twitter) and you get a token assigned with your account. Further, at this time you can use 5 subdomains.

The QNAP itself can act as a DDNS client for a few providers. The whole list is below. Duckdns is not one of them.


To make use of duckdns on the QNAP NAS I've added in the /etc/config/crontab file an entry to update my IP every 2 hours:
 0 */2 * * * /share/Valentin/duckdns/duck.sh >/dev/null 2>&1

IS-IS notes

General:
- routing protocol for ISO CLNP (Connectionless Network Protocol)
- NET (Network Entity Title) required by configuration (L3 address) Has different formats. One practical is below:
   Area (1-13 bytes)| System ID (6 bytes) | Selector (1 byte) (eg. 47.000|1921.6810.0001|00)
   Selector is 00 in a NET. The NET must begin with one octet (eg 47) and end with one octed (00)
   Selector is non 00, the address is NSAP (Network Service Access Point)
   NSAP describes a service attachment at the network layer (similar to IP protocol at the IP layer)
- operates over Ethernet 802.2 LLC  (not over the common Ethernet II)
- dual ISIS (RFC1195) supports CLNS and IP
- hierarchical with 2 level hierarchy (L2 - core)
- ignores TLVs it does not understand


Adjacencies:
- L1 area ID must be the same

BGP notes

Neighbor states:

Idle: all connections are refused
Connect: wait for TCP to establish
Active: initiates the TCP connections
OpenSent: Local waits for Open message from peer. After receiving open, if no errors BGP sends keepalive
OpenConfirm: BGP waits for keepalive or notification
Established: Can exchange update, notification and keepalive

Message types:

Open: sent when TCP 3way is complete. Initiates the BGP session and contains details about BGP neighbor and supported and negotiated potions
Update: Transports routing information between BGP peers
Keepalive: On BGP level. Contains the BGP header and has no data.
Notification: sent when something is wrong (eg. unsupported options in the open message, hold time expires)
Refresh: BGP does not readvertise sent routes by default. Route refresh supports soft clearing of BGP sessions by allowing routes already sent to be re-advertised

BGP attributes:

- contained in the Update message, describes the prefixes in the message
- used to influence route selection and select best path

Local preference:
- exchanged by IBGP peers only
- used to set the exit path from the local AS

OSPF notes

Packet types:
Hello (type1): used to discover neighbors, build and maintain adjacencies
DBD(type2): database description packets. These are a summary of the topological database. Detects MTU mismatches (fragmentation is not allowed). Have bits I (start of DBD), M (more ackets DB), MS(master/slave used to decides who starts sending DBD first)
LSR(type3): link state request. Request specific link state advertisement (LSA) from a neighbor, typically after receiving DBD packets and noticing the local link state database is out of date
LSU(type4): link state updates. Advertises LSAs into the network . Can contain multiple LSAs
LSAck(type5): link state acknowledgements. Acknowledges LSUs

Packet formats:

OSPF packet:

Version | Type | Length | Router ID | Area ID | Cksum | Auth type | Auth data | Data

LSU packet (type 4):
Number of LSAs | LSA header | LSA data | LSA header | LSA data | ...

LSA header:
Age | Options | Link-state Type | Link-state ID | Advertising router | Seq number | Cksum | Length

LSA types:


Router LSA (type 1):
- has area scope
- describes local router
- standards LSA header  plus some extras (only a few showed below):
   - 5 bits set to 0 followed by bits 6,7,8  set for virtual links (V), ASBR (E), ABR (B)
   - number of links (2 bytes)
   - link ID (4 bytes)
   - link data (4 bytes)
   - link type (1 bytes)
   - metric (2 bytes)

 Link-type: Type 1 (P2P). Link ID: Neighbor Router ID. Link data: Local interface IP
 Link-type: Type 2 (Transit). Link ID: DR's interface IP. Link data: Local interface IP [broadcast segment]
 Link-type: Type 3 (Stub). Link ID: Network number. Link data: Subnet mask [passive interfaces, loopback interfaces]
 Link-type: Type 4 (Virtual link). Link ID: Neighbor Router ID. Link data: Local interface IP