From c5b6058d36e7cd080cbfff4706e37338c8f1be96 Mon Sep 17 00:00:00 2001 From: qavitalii Date: Mon, 7 Oct 2024 16:54:43 +0200 Subject: [PATCH 1/3] NAT small documentations --- network/vitalii/README-NAT.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 network/vitalii/README-NAT.md diff --git a/network/vitalii/README-NAT.md b/network/vitalii/README-NAT.md new file mode 100644 index 0000000..2a205f9 --- /dev/null +++ b/network/vitalii/README-NAT.md @@ -0,0 +1,35 @@ +Task: Know, understand what NAT is, why it is needed, what is the principle of operation, where it is used +___ + +# NAT (Network Address Translation) +NAT - is a mechanism in TCP/IP networks that allows the IP address to be changed in the header of a packet passing through a traffic r +outing device. + +## Problems solved by NAT + +1. Allows you to save IP addresses (only when using NAT in PAT mode) by translating multiple internal IP addresses to one external public IP address (or multiple, but still fewer than internal). +2. Allows you to prevent or limit traffic from the outside to internal hosts, while allowing traffic from the inside to the outside. When a connection is initiated from within the network, a broadcast is created. Corresponding packets coming in from the outside match the created broadcast and are therefore passed through. If there is no corresponding broadcast for packets coming from the outside (and it can be created at connection initiation or static), they are not passed. +3. Allows you to hide individual internal services of internal hosts/servers. Basically, the same, above, translation to the specified port is performed, but you can replace the internal port of the officially registered service (for example, the 80th TCP port (HTTP server) with the external 54055). Thus, externally, on the external IP address, after broadcasting the address on the site (or forum), for familiar visitors, it will be possible to get to the address http://example.org:54055, but on the internal server, which is through NAT, it will work on the usual 80th port. Increasing security and preservation of "non-public" resources. + +## NAT types +There are 3 basic concepts of address translation: static (**Static Network Address Translation**), dynamic (**Dynamic Address Translation**), overloaded (**NAPT, NAT Overload, PAT**). + +**Static NAT** - Mapping an unregistered IP address to a registered IP address on a one-to-one basis. Especially useful when the device needs to be accessible outside the network. + +**Dynamic NAT** - Maps an unregistered IP address to a registered address from a pool of registered IP addresses. Dynamic NAT also establishes a direct mapping between unregistered and registered addresses, but the mapping may change depending on which registered address is available in the address stack during communication. + +**Overloaded NAT** (**NAPT, NAT Overload, PAT, masquerading**) is a form of dynamic NAT that converts multiple unregistered addresses into a single registered IP address using a variety of ports. Also known as PAT (**Port Address Translation**). During congestion, every computer on the private network broadcasts to the same address, but with a different port number. +___ + +### Useful links: ### +1. https://www.checkpoint.com/cyber-hub/network-security/what-is-network-address-translation-nat/ +2. https://www.youtube.com/watch?v=L1JtmAiSaFQ&ab_channel=AndreySozykin +3. https://www.youtube.com/watch?v=B3LViQ_184Q&ab_channel=NajQazi +4. https://www.youtube.com/watch?v=hFGXq66mcqM&ab_channel=CloudLearners + + + + + + + From 16686369736e0c4f86b7bd56af99d1167c3cb892 Mon Sep 17 00:00:00 2001 From: qavitalii <64067815+qavitalii@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:51:45 +0200 Subject: [PATCH 2/3] cron_branch (#1) * CRON documentations * CRON documentations #2 --- linux/vitalii/README-cron.md | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 linux/vitalii/README-cron.md diff --git a/linux/vitalii/README-cron.md b/linux/vitalii/README-cron.md new file mode 100644 index 0000000..994ec58 --- /dev/null +++ b/linux/vitalii/README-cron.md @@ -0,0 +1,48 @@ +# Cron ## +The cron command-line utility is a job scheduler on Unix-like operating systems. Users who set up and maintain software environments use cron to schedule jobs + +The actions of cron are driven by a crontab (cron table) file, a configuration file that specifies shell commands to run periodically on a given schedule. The crontab files are stored where the lists of jobs and other instructions to the cron daemon are kept. Users can have their own individual crontab files and often there is a system-wide crontab file (usually in /etc or a subdirectory of /etc e.g. /etc/cron.d) that only system administrators can edit. +___ + +## Exemple ## + +``` + * * * * * + | | | | | + | | | | day of the week (0–6) (Sunday to Saturday; + | | | month (1–12) 7 is also Sunday on some systems) + | | day of the month (1–31) + | hour (0–23) + minute (0–59) +``` +This example runs a shell program called export_dump.sh at 23:45 (11:45 PM) every Saturday. +``` +45 23 * * 6 /home/oracle/scripts/export_dump.sh +``` +**Note**: On some systems it is also possible to specify ```*/n``` to run for every n-th interval of time. +Also, specifying multiple specific time intervals can be done with commas (e.g., 1,2,3). The line below would output "hello world" to the command line every 5th minute of every first, second and third hour (i.e., 01:00, 01:05, 01:10, up until 03:55). +```commandline +*/5 1,2,3 * * * echo hello world +``` +The configuration file for a user can be edited by calling ``crontab -e`` regardless of where the actual implementation stores this file +___ + +## Time zone handling ## + +Most cron implementations simply interpret crontab entries in the system time zone setting that the cron daemon runs under. +This can be a source of dispute if a large multi-user machine has users in several time zones, especially if the system default time zone includes the potentially confusing DST. +Thus, a cron implementation may as a special case recognize lines of the form **"CRON_TZ=\