├── .gitignore ├── .vscode └── settings.json ├── docs ├── Makefile ├── make.bat └── source │ ├── .vscode │ └── settings.json │ ├── About │ └── index.rst │ ├── DHCP │ └── CentralDHCPServer.rst │ ├── Fundamentals │ └── Basics.rst │ ├── RoutingAlgorithms │ ├── BGP.rst │ ├── DiamondIPRoute.rst │ ├── EIGRP.rst │ ├── OSPF.rst │ └── SimpleIPRoute.rst │ ├── Security │ └── IPSecOverGRE.rst │ ├── _static │ └── Images │ │ ├── BGP │ │ └── Map.png │ │ ├── DiamondIPRoute │ │ └── Map.png │ │ ├── EIGRP │ │ └── Map.png │ │ ├── IPSEC │ │ └── IPSEC.png │ │ ├── OSPF │ │ └── Map.png │ │ └── SimpleIPRoute │ │ ├── AbstractMap.png │ │ └── DetailedMap.png │ ├── conf.py │ └── index.rst └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | docs/build -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "restructuredtext.confPath": "${workspaceFolder}\\docs\\source" 3 | } -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SOURCEDIR = source 8 | BUILDDIR = build 9 | 10 | # Put it first so that "make" without argument is like "make help". 11 | help: 12 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 13 | 14 | .PHONY: help Makefile 15 | 16 | # Catch-all target: route all unknown targets to Sphinx using the new 17 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 18 | %: Makefile 19 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 20 | 21 | livehtml: 22 | sphinx-autobuild -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/source/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "restructuredtext.confPath": "${workspaceFolder}" 3 | } -------------------------------------------------------------------------------- /docs/source/About/index.rst: -------------------------------------------------------------------------------- 1 | Introduction 2 | ================= 3 | 4 | ================== 5 | Author 6 | ================== 7 | 8 | Hello everyone! 9 | 10 | This is a simple documentation for Network Lab course of `University of Guilan`_ made by 11 | `Aryan Ebrahimpour`_, a Computer Engineering BSc student. 12 | 13 | .. warning:: If GNS3 drove you crazy, please calm down, it's totally normal. GNS3 officialy has 2 purpose: 14 | 1. Network Simulation 15 | 2. Driving people crazy 16 | 17 | .. _University of Guilan: https://guilan.ac.ir 18 | .. _Aryan Ebrahimpour: https://avestura.dev 19 | 20 | 21 | ================== 22 | Contributions 23 | ================== 24 | 25 | Contributions are very welcome. You can simply use that **Edit on GitHub** 26 | link on top of each page to improve these pages. 27 | 28 | You may need `Sphinx`_ docs if you are not familiar with reStucturedText. 29 | 30 | .. _Sphinx: http://www.sphinx-doc.org 31 | -------------------------------------------------------------------------------- /docs/source/DHCP/CentralDHCPServer.rst: -------------------------------------------------------------------------------- 1 | Central DHCP Server 2 | ======================= 3 | 4 | .. warning:: Under construction 5 | 6 | .. toctree:: 7 | :maxdepth: 3 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/source/Fundamentals/Basics.rst: -------------------------------------------------------------------------------- 1 | Basics 2 | ================== 3 | 4 | These are snippets and codes we use a lot in our projects 5 | 6 | ************** 7 | Routers 8 | ************** 9 | Codes frequently used for routers 10 | 11 | ^^^^^^^^^^^^^^ 12 | Config Mode 13 | ^^^^^^^^^^^^^^ 14 | There are multiple modes in routers, including **Normal Mode** and **Config Mode**. 15 | 16 | You can switch to config mode with ``config terminal`` or simply ``conf t`` command and get back to normal mode with ``exit``:: 17 | 18 | R1# 19 | R1# conf t 20 | R1(config)# 21 | R1(config)# exit 22 | R1# 23 | 24 | .. note:: Pay attention to what mode you are in. 25 | 26 | ^^^^^^^^^^^^^^ 27 | Ping 28 | ^^^^^^^^^^^^^^ 29 | You can simply ping a destination with ``ping`` command in **Normal Mode**. 30 | If you are in **Config** mode, use ``do ping`` command. 31 | 32 | =========================== ================================= ================================== 33 | Mode Command Example 34 | =========================== ================================= ================================== 35 | Normal ping x.x.x.x ``ping 192.168.1.23`` 36 | Config do ping x.x.x.x ``do ping 192.168.1.23`` 37 | =========================== ================================= ================================== 38 | 39 | ^^^^^^^^^^^^^^^^^^^^^ 40 | Save or Show configs 41 | ^^^^^^^^^^^^^^^^^^^^^ 42 | If you are in **Normal** mode, simply type ``show running-config`` to show the current config, and 43 | ``copy running-config startup-config`` to save the configs for next start. 44 | 45 | If you are in **Config** mode, put a ``do`` prefix before those commands:: 46 | 47 | R1# ping 192.168.1.1 48 | R1# show running-config 49 | R1# copy running-config startup-config 50 | 51 | R1(config)# do ping 192.168.1.1 52 | R1(config)# do show running-config 53 | R1(config)# do copy running-config startup-config 54 | 55 | ^^^^^^^^^^^^^^^^^ 56 | Config interfaces 57 | ^^^^^^^^^^^^^^^^^ 58 | You can config interfaces of the router in *config mode*. You may have multiple interfaces on your router such as 59 | **FastEthernet** or **GigabitEthernet**, etc. 60 | Simply use ``int `` to config the interface. The *interface_id* parameter should be in any forms of the 61 | interface type, for example all of these are accepted: ``FastEthernet0/0``, ``fa0/0`` or ``f0/0``. :: 62 | 63 | R1#conf t 64 | R1(config)#int fa0/0 65 | R1(config-if)#ip addr 192.198.1.1 255.255.255.0 66 | R1(config-if)#no shut 67 | R1(config-if)#exit 68 | R1(config)# 69 | 70 | Here we first switched to *interface config mode* with ``int fa0/0`` command and then changed 71 | the IP address and subnet mask of the interface. 72 | The ``shutdown`` command disables the interface. Putting a *no* (``no shutdown`` or simply ``no shut``) 73 | before this command (re)enables the interface. 74 | 75 | Notice that the ``exit`` command only changes the mode one level upper and does not directly switch to the *Normal mode*. 76 | 77 | .. warning:: Interfaces of the same router can not be in the same network. 78 | For example you can not have two interfaces in a router with IPs ``192.168.1.1/24`` and ``192.168.1.2/24``. 79 | 80 | 81 | ^^^^^^^^^^^^^^^^^^^^^^^^ 82 | Show interface configs 83 | ^^^^^^^^^^^^^^^^^^^^^^^^ 84 | You can see the IP and status of the interfaces with ``show ip interface brief`` in Normal mode. 85 | The shortened version ``sh ip int br`` also works. :: 86 | 87 | R1#show ip interface brief 88 | 89 | Interface IP-Address OK? Method Status Protocol 90 | FastEthernet0/0 192.168.1.1 YES manual up up 91 | GigabitEthernet1/0 192.168.2.1 YES manual up up 92 | 93 | 94 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 95 | Add item to route table 96 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 97 | A router must know on which interface it should to forward a packet, based on the network address of it. 98 | You can manually add items to the routing table of a router using ``ip route x.x.x.x y.y.y.y `` command 99 | where the *x.x.x.x* is the network address and *y.y.y.y* is the subnet mask. :: 100 | 101 | R1(config)#ip route 192.168.1.0 255.255.255.0 fa0/0 102 | 103 | The example above simply forwards every packet with destination of ``192.168.1.x`` to its ``FastEthernet0/0`` port. 104 | 105 | ************** 106 | VPCs 107 | ************** 108 | Codes frequently used for VPCs 109 | 110 | ^^^^^^^^^^^^^^ 111 | Short Codes 112 | ^^^^^^^^^^^^^^ 113 | =========================== ================================= ================================== 114 | Command Description Example 115 | =========================== ================================= ================================== 116 | ping x.x.x.x Pings an IP address ``ping 192.168.1.23`` 117 | save Saves the configs of the VPC ``save`` 118 | ip x.x.x.x/y z.z.z.z Sets IP, Subnet mask and Gateway ``ip 192.168.1.2/24 192.168.1.1`` 119 | ip dhcp Gets the IP from DHCP server ``ip dhcp`` 120 | =========================== ================================= ================================== 121 | -------------------------------------------------------------------------------- /docs/source/RoutingAlgorithms/BGP.rst: -------------------------------------------------------------------------------- 1 | BGP 2 | ================== 3 | 4 | ^^^^^^^^^^^^^^^^^^^ 5 | Definition 6 | ^^^^^^^^^^^^^^^^^^^ 7 | BGP (Border Gateway Protocol) is protocol that manages how packets are routed across the internet 8 | through the exchange of routing and reachability information between edge routers 9 | 10 | ^^^^^^^^^^^^^^^^^^^ 11 | Project description 12 | ^^^^^^^^^^^^^^^^^^^ 13 | .. image:: /_static/Images/BGP/Map.png 14 | :align: center 15 | 16 | In this project, we want to ping R1 and R2 from each other using BGP. 17 | 18 | ^^^^^^^^^^^^^^^^^^^ 19 | Configuration 20 | ^^^^^^^^^^^^^^^^^^^ 21 | .. note:: Becuase configuration of the interfaces and VPCs IPs are similar to the previous projects, 22 | I simply just write the routing codes. 23 | 24 | ------------------------- 25 | Routers config 26 | ------------------------- 27 | 28 | **Border1** :: 29 | 30 | Border1(config)#router bgp 64520 31 | Border1(config-router)#network 12.12.12.0 mask 255.255.255.0 32 | Border1(config-router)#network 192.168.20.0 33 | Border1(config-router)#neighbor 12.12.12.30 remote-as 64530 34 | Border1(config-router)#neighbor 192.168.20.1 remote-as 64520 35 | Border1(config-router)#neighbor 192.168.20.1 next-hop-self 36 | 37 | **Border2** :: 38 | 39 | Border2(config)#router bgp 64530 40 | Border2(config-router)#network 12.12.12.0 mask 255.255.255.0 41 | Border2(config-router)#network 192.168.30.0 42 | Border2(config-router)#neighbor 12.12.12.20 remote-as 64520 43 | Border2(config-router)#neighbor 192.168.30.2 remote-as 64530 44 | Border2(config-router)#neighbor 192.168.30.2 next-hop-self 45 | 46 | **R1** :: 47 | 48 | R1(config)#router bgp 64520 49 | R1(config-router)#network 192.168.20.0 50 | R1(config-router)#neighbor 192.168.20.21 remote-as 64520 51 | 52 | **R2** :: 53 | 54 | R2(config)#router bgp 64530 55 | R2(config-router)#network 192.168.30.0 56 | R2(config-router)#neighbor 192.168.30.32 remote-as 64530 57 | 58 | ------------------------- 59 | View Connection details 60 | ------------------------- 61 | 62 | Use ``sh ip route`` and ``sh ip protocol`` to see the routes and connection details. -------------------------------------------------------------------------------- /docs/source/RoutingAlgorithms/DiamondIPRoute.rst: -------------------------------------------------------------------------------- 1 | Diamond IP Route 2 | =================== 3 | 4 | ^^^^^^^^^^^^^^^^^^^^ 5 | Project description 6 | ^^^^^^^^^^^^^^^^^^^^ 7 | In this section, we have four PCs and four routers in the middle. The objective is to be able to ping any PC from any other. 8 | 9 | .. image:: /_static/Images/DiamondIPRoute/Map.png 10 | :align: center 11 | 12 | ^^^^^^^^^^^^^^^^^^^ 13 | Configuration 14 | ^^^^^^^^^^^^^^^^^^^ 15 | 16 | .. note:: Becuase configuration of the interfaces and VPCs IPs are similar to the previous project, 17 | I simply just write the routing codes. 18 | 19 | **R1** :: 20 | 21 | R1(config)#ip route 22.22.22.0 255.255.255.0 f1/0 22 | R1(config)#ip route 33.33.33.0 255.255.255.0 f1/0 23 | R1(config)#ip route 44.44.44.0 255.255.255.0 f2/0 24 | 25 | **R2** :: 26 | 27 | R2(config)#ip route 11.11.11.0 255.255.255.0 f1/0 28 | R2(config)#ip route 33.33.33.0 255.255.255.0 f2/0 29 | R2(config)#ip route 44.44.44.0 255.255.255.0 f2/0 30 | 31 | **R3** :: 32 | 33 | R3(config)#ip route 11.11.11.0 255.255.255.0 f1/0 34 | R3(config)#ip route 22.22.22.0 255.255.255.0 f2/0 35 | R3(config)#ip route 44.44.44.0 255.255.255.0 f1/0 36 | 37 | **R4** :: 38 | 39 | R4(config)#ip route 11.11.11.0 255.255.255.0 f2/0 40 | R4(config)#ip route 22.22.22.0 255.255.255.0 f2/0 41 | R4(config)#ip route 33.33.33.0 255.255.255.0 f1/0 42 | -------------------------------------------------------------------------------- /docs/source/RoutingAlgorithms/EIGRP.rst: -------------------------------------------------------------------------------- 1 | EIGRP 2 | ============== 3 | 4 | ^^^^^^^^^^^^^^^^^^^ 5 | Definition 6 | ^^^^^^^^^^^^^^^^^^^ 7 | Enhanced Interior Gateway Routing Protocol (EIGRP) is an advanced distance-vector routing protocol 8 | that is used on a computer network for automating routing decisions and configuration 9 | 10 | ^^^^^^^^^^^^^^^^^^^ 11 | Project description 12 | ^^^^^^^^^^^^^^^^^^^ 13 | .. image:: /_static/Images/EIGRP/Map.png 14 | :height: 500px 15 | :align: center 16 | 17 | In this project, we want to ping PC5 and PC6 from each other using EIGRP *in the same area*. 18 | 19 | ^^^^^^^^^^^^^^^^^^^ 20 | Configuration 21 | ^^^^^^^^^^^^^^^^^^^ 22 | .. note:: Becuase configuration of the interfaces and VPCs IPs are similar to the previous projects, 23 | I simply just write the routing codes. 24 | 25 | ------------------------- 26 | Routers config 27 | ------------------------- 28 | 29 | .. warning:: You should use **same area number** for routers, ping won't work otherwise! 30 | 31 | **R1** :: 32 | 33 | R1(config)#router eigrp 1 34 | R1(config-router)#network 192.168.13.0 255.255.255.0 35 | R1(config-router)#network 192.168.15.0 255.255.255.0 36 | 37 | **R2** :: 38 | 39 | R2(config)#router eigrp 1 40 | R2(config-router)#network 192.168.24.0 255.255.255.0 41 | R2(config-router)#network 192.168.26.0 255.255.255.0 42 | 43 | **R3** :: 44 | 45 | R3(config)#router eigrp 1 46 | R3(config-router)#network 192.168.13.0 255.255.255.0 47 | R3(config-router)#network 192.168.34.0 255.255.255.0 48 | 49 | **R4** :: 50 | 51 | R4(config)#router eigrp 1 52 | R4(config-router)#network 192.168.24.0 255.255.255.0 53 | R4(config-router)#network 192.168.34.0 255.255.255.0 54 | 55 | ------------------------- 56 | View Connection details 57 | ------------------------- 58 | 59 | Use ``sh ip route`` and ``sh ip protocol`` to see the routes and connection details. -------------------------------------------------------------------------------- /docs/source/RoutingAlgorithms/OSPF.rst: -------------------------------------------------------------------------------- 1 | OSPF 2 | =================== 3 | 4 | ^^^^^^^^^^^^^^^^^^^ 5 | Definition 6 | ^^^^^^^^^^^^^^^^^^^ 7 | Open Shortest Path First (OSPF) is a routing protocol in form of a **graph**, operating within a single **autonomous system (AS)** 8 | which here we call it an **Area**. 9 | 10 | ^^^^^^^^^^^^^^^^^^^ 11 | Project description 12 | ^^^^^^^^^^^^^^^^^^^ 13 | .. image:: /_static/Images/OSPF/Map.png 14 | :height: 500px 15 | :align: center 16 | 17 | In this project, we want to ping routers from each other. There are 7 routers in 5 Areas which has different background colors 18 | in the image. 19 | 20 | .. warning:: Because we should set the area of the *edge routers* same as the area of destination router, here 21 | in this examples *area 67* and *area 14* are deleted as the area only consists of an edge router. 22 | 23 | ^^^^^^^^^^^^^^^^^^^ 24 | Configuration 25 | ^^^^^^^^^^^^^^^^^^^ 26 | .. note:: Becuase configuration of the interfaces and VPCs IPs are similar to the previous projects, 27 | I simply just write the routing codes. 28 | 29 | .. warning:: The area number of the backbone area should be lower than others, 30 | it won't work otherwise. In this project it is area 0. 31 | 32 | ------------------------- 33 | Routers config 34 | ------------------------- 35 | 36 | **R1** :: 37 | 38 | R1(config)#router ospf 1 39 | R1(config-router)#network 12.12.12.0 255.255.255.0 area 0 40 | R1(config-router)#network 13.13.13.0 255.255.255.0 area 0 41 | R1(config-router)#network 14.14.14.0 255.255.255.0 area 0 42 | 43 | **R2** :: 44 | 45 | R2(config)#router ospf 2 46 | R2(config-router)#network 12.12.12.0 255.255.255.0 area 0 47 | R2(config-router)#network 25.25.25.0 255.255.255.0 area 0 48 | R2(config-router)#network 26.26.26.0 255.255.255.0 area 0 49 | 50 | **R3** :: 51 | 52 | R3(config)#router ospf 3 53 | R3(config-router)#network 13.13.13.0 255.255.255.0 area 0 54 | R3(config-router)#network 35.35.35.0 255.255.255.0 area 1235 55 | 56 | **R4** :: 57 | 58 | R4(config)#router ospf 4 59 | R4(config-router)#network 14.14.14.0 255.255.255.0 area 0 60 | 61 | **R5** :: 62 | 63 | R5(config)#router ospf 5 64 | R5(config-router)#network 25.25.25.0 255.255.255.0 area 0 65 | R5(config-router)#network 35.35.35.0 255.255.255.0 area 1235 66 | 67 | **R6** :: 68 | 69 | R6(config)#router ospf 6 70 | R6(config-router)#network 26.26.26.0 255.255.255.0 area 0 71 | R6(config-router)#network 67.67.67.0 255.255.255.0 area 26 72 | 73 | **R7** :: 74 | 75 | R7(config)#router ospf 7 76 | R7(config-router)#network 67.67.67.0 255.255.255.0 area 26 77 | 78 | ------------------------- 79 | View Connection details 80 | ------------------------- 81 | 82 | Use ``sh ip route`` and ``sh ip protocol`` to see the routes and connection details. 83 | -------------------------------------------------------------------------------- /docs/source/RoutingAlgorithms/SimpleIPRoute.rst: -------------------------------------------------------------------------------- 1 | Simple IP Route 2 | =================== 3 | 4 | ^^^^^^^^^^^^^^^^^^^^^ 5 | Project description 6 | ^^^^^^^^^^^^^^^^^^^^^ 7 | 8 | In this section, we want to ping *Microsoft* from *Google* using two routers named 9 | *Redmond* and *California*, and vice versa. 10 | 11 | .. image:: /_static/Images/SimpleIPRoute/AbstractMap.png 12 | :height: 300px 13 | :align: center 14 | 15 | We just need to setup the interfaces with proper IP addresses, and then write the ip routes. 16 | Here is a more detailed image of the project with interface identifiers and chosen example IP addresses for each interface. 17 | 18 | .. image:: /_static/Images/SimpleIPRoute/DetailedMap.png 19 | :height: 300px 20 | :align: center 21 | 22 | ^^^^^^^^^^^^^^^ 23 | Configuration 24 | ^^^^^^^^^^^^^^^ 25 | **Microsoft VPC** :: 26 | 27 | Microsoft> ip 22.22.22.2/24 22.22.22.1 28 | 29 | **Google VPC** :: 30 | 31 | Google> ip 11.11.11.2/24 11.11.11.1 32 | 33 | **Redmond Router** :: 34 | 35 | 36 | Redmond#conf t 37 | Redmond(config)#int f0/0 38 | Redmond(config-if)#ip addr 22.22.22.1 255.255.255.0 39 | Redmond(config-if)#no shut 40 | Redmond(config-if)#exit 41 | Redmond(config)#int g1/0 42 | Redmond(config-if)#ip addr 12.12.12.2 255.255.255.0 43 | Redmond(config-if)#no shut 44 | Redmond(config-if)#exit 45 | Redmond(config)#ip route 11.11.11.0 255.255.255.0 g1/0 46 | 47 | 48 | **California Router** :: 49 | 50 | California#conf t 51 | California(config)#int f0/0 52 | California(config-if)#ip addr 11.11.11.1 255.255.255.0 53 | California(config-if)#no shut 54 | California(config-if)#exit 55 | California(config)#int g1/0 56 | California(config-if)#ip addr 12.12.12.1 255.255.255.0 57 | California(config-if)#no shut 58 | California(config-if)#exit 59 | California(config)#ip route 22.22.22.0 255.255.255.0 g1/0 60 | 61 | Now if you ping Google from Microsoft (or Microsoft from Google), this should be the result: :: 62 | 63 | Microsoft> ping 11.11.11.2 64 | 84 bytes from 11.11.11.2 icmp_seq=1 ttl=62 time=69.002 ms 65 | 84 bytes from 11.11.11.2 icmp_seq=2 ttl=62 time=37.000 ms 66 | 84 bytes from 11.11.11.2 icmp_seq=3 ttl=62 time=45.998 ms 67 | 84 bytes from 11.11.11.2 icmp_seq=4 ttl=62 time=39.001 ms 68 | 84 bytes from 11.11.11.2 icmp_seq=5 ttl=62 time=31.000 ms 69 | 70 | .. note:: Some of the first pings may timeout on your machine -------------------------------------------------------------------------------- /docs/source/Security/IPSecOverGRE.rst: -------------------------------------------------------------------------------- 1 | IPSec over GRE 2 | ================= 3 | 4 | ^^^^^^^^^^^^^^^^^^^ 5 | Definition 6 | ^^^^^^^^^^^^^^^^^^^ 7 | Generic Routing Encapsulation (GRE) is a tunneling protocol that can encapsulate a wide variety of network layer protocols 8 | inside virtual point-to-point links or point-to-multipoint links over an Internet Protocol network. 9 | 10 | Internet Protocol Security (IPsec) is a secure network protocol suite that authenticates and encrypts the packets of data sent over an internet protocol network. It is used in virtual private networks (VPNs). 11 | 12 | ^^^^^^^^^^^^^^^^^^^ 13 | Project description 14 | ^^^^^^^^^^^^^^^^^^^ 15 | .. image:: /_static/Images/IPSEC/IPSEC.png 16 | :align: center 17 | 18 | Here in the image, the green tunnel is the GRE tunnel which is secured by IPSEC protocol. 19 | We want to secure the packets that 'Aryan' and 'Hasti' PCs are sending to eachother. 20 | 21 | ^^^^^^^^^^^^^^^^^^^ 22 | Configuration 23 | ^^^^^^^^^^^^^^^^^^^ 24 | .. note:: You can use any routing algorithm you learnt in previous sections for the four router in the middle (called Internet). 25 | In this section, I ignore the four routers and assume that they are preconfigured. 26 | 27 | ------------------------- 28 | Routers config 29 | ------------------------- 30 | 31 | .. note:: You can change the the key part(``hastiaryan``) and the profile name part(``OurProfile``) to your custom names. 32 | 33 | **Astaneh** :: 34 | 35 | Astaneh(config)#crypto isakmp policy 10 36 | Astaneh(config-isakmp)#authentication pre-share 37 | Astaneh(config-isakmp)#exit 38 | Astaneh(config)#crypto isakmp key hastiaryan address 4.4.4.101 39 | Astaneh(config)#crypto ipsec transform-set 3des-sha esp-3des esp-sha-hmac 40 | 41 | Astaneh(config)#crypto ipsec profile OurProfile 42 | Astaneh(ipsec-profile)#set transform-set 3des-sha 43 | Astaneh(ipsec-profile)#exit 44 | 45 | Astaneh(config)#interface Tunnel0 46 | Astaneh(config-if)#ip address 172.16.1.1 255.255.255.0 47 | Astaneh(config-if)#tunnel source FastEthernet0/0 48 | Astaneh(config-if)#tunnel destination 4.4.4.101 49 | Astaneh(config-if)#tunnel protection ipsec profile OurProfile 50 | Astaneh(config-if)#exit 51 | 52 | Astaneh(config)#ip route 192.168.4.0 255.255.255.0 Tunnel0 53 | 54 | **Tehran** :: 55 | 56 | Tehran(config)#crypto isakmp policy 10 57 | Tehran(config-isakmp)#authentication pre-share 58 | Tehran(config-isakmp)#exit 59 | Tehran(config)#crypto isakmp key hastiaryan address 1.1.1.101 60 | Tehran(config)#crypto ipsec transform-set 3des-sha esp-3des esp-sha-hmac 61 | 62 | Tehran(config)#crypto ipsec profile OurProfile 63 | Tehran(ipsec-profile)#set transform-set 3des-sha 64 | Tehran(ipsec-profile)#exit 65 | 66 | Tehran(config)#interface Tunnel0 67 | Tehran(config-if)#ip address 172.16.1.4 255.255.255.0 68 | Tehran(config-if)#tunnel source FastEthernet0/0 69 | Tehran(config-if)#tunnel destination 1.1.1.101 70 | Tehran(config-if)#tunnel protection ipsec profile OurProfile 71 | Tehran(config-if)#exit 72 | 73 | Tehran(config)#ip route 192.168.1.0 255.255.255.0 Tunnel0 74 | -------------------------------------------------------------------------------- /docs/source/_static/Images/BGP/Map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avestura/NetworkLab/be020e19b91aff7ad385f5b9f6049ec5ec88a7a1/docs/source/_static/Images/BGP/Map.png -------------------------------------------------------------------------------- /docs/source/_static/Images/DiamondIPRoute/Map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avestura/NetworkLab/be020e19b91aff7ad385f5b9f6049ec5ec88a7a1/docs/source/_static/Images/DiamondIPRoute/Map.png -------------------------------------------------------------------------------- /docs/source/_static/Images/EIGRP/Map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avestura/NetworkLab/be020e19b91aff7ad385f5b9f6049ec5ec88a7a1/docs/source/_static/Images/EIGRP/Map.png -------------------------------------------------------------------------------- /docs/source/_static/Images/IPSEC/IPSEC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avestura/NetworkLab/be020e19b91aff7ad385f5b9f6049ec5ec88a7a1/docs/source/_static/Images/IPSEC/IPSEC.png -------------------------------------------------------------------------------- /docs/source/_static/Images/OSPF/Map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avestura/NetworkLab/be020e19b91aff7ad385f5b9f6049ec5ec88a7a1/docs/source/_static/Images/OSPF/Map.png -------------------------------------------------------------------------------- /docs/source/_static/Images/SimpleIPRoute/AbstractMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avestura/NetworkLab/be020e19b91aff7ad385f5b9f6049ec5ec88a7a1/docs/source/_static/Images/SimpleIPRoute/AbstractMap.png -------------------------------------------------------------------------------- /docs/source/_static/Images/SimpleIPRoute/DetailedMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avestura/NetworkLab/be020e19b91aff7ad385f5b9f6049ec5ec88a7a1/docs/source/_static/Images/SimpleIPRoute/DetailedMap.png -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Configuration file for the Sphinx documentation builder. 4 | # 5 | # This file does only contain a selection of the most common options. For a 6 | # full list see the documentation: 7 | # http://www.sphinx-doc.org/en/master/config 8 | 9 | # -- Path setup -------------------------------------------------------------- 10 | 11 | # If extensions (or modules to document with autodoc) are in another directory, 12 | # add these directories to sys.path here. If the directory is relative to the 13 | # documentation root, use os.path.abspath to make it absolute, like shown here. 14 | # 15 | # import os 16 | # import sys 17 | # sys.path.insert(0, os.path.abspath('.')) 18 | import sphinx_rtd_theme 19 | 20 | # -- Project information ----------------------------------------------------- 21 | 22 | project = u'Network Lab' 23 | copyright = u'2018, avestura' 24 | author = u'avestura' 25 | 26 | # The short X.Y version 27 | version = u'' 28 | # The full version, including alpha/beta/rc tags 29 | release = u'' 30 | 31 | 32 | # -- General configuration --------------------------------------------------- 33 | 34 | # If your documentation needs a minimal Sphinx version, state it here. 35 | # 36 | # needs_sphinx = '1.0' 37 | 38 | # Add any Sphinx extension module names here, as strings. They can be 39 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 40 | # ones. 41 | extensions = [ 42 | 'sphinx.ext.autodoc', 43 | ] 44 | 45 | # Add any paths that contain templates here, relative to this directory. 46 | templates_path = ['_templates'] 47 | 48 | # The suffix(es) of source filenames. 49 | # You can specify multiple suffix as a list of string: 50 | # 51 | # source_suffix = ['.rst', '.md'] 52 | source_suffix = '.rst' 53 | 54 | # The master toctree document. 55 | master_doc = 'index' 56 | 57 | # The language for content autogenerated by Sphinx. Refer to documentation 58 | # for a list of supported languages. 59 | # 60 | # This is also used if you do content translation via gettext catalogs. 61 | # Usually you set "language" from the command line for these cases. 62 | language = None 63 | 64 | # List of patterns, relative to source directory, that match files and 65 | # directories to ignore when looking for source files. 66 | # This pattern also affects html_static_path and html_extra_path. 67 | exclude_patterns = [] 68 | 69 | # The name of the Pygments (syntax highlighting) style to use. 70 | pygments_style = 'sphinx' 71 | 72 | 73 | # -- Options for HTML output ------------------------------------------------- 74 | 75 | # The theme to use for HTML and HTML Help pages. See the documentation for 76 | # a list of builtin themes. 77 | # 78 | html_theme = 'alabaster' 79 | 80 | # Theme options are theme-specific and customize the look and feel of a theme 81 | # further. For a list of options available for each theme, see the 82 | # documentation. 83 | # 84 | # html_theme_options = {} 85 | 86 | # Add any paths that contain custom static files (such as style sheets) here, 87 | # relative to this directory. They are copied after the builtin static files, 88 | # so a file named "default.css" will overwrite the builtin "default.css". 89 | html_static_path = ['_static'] 90 | 91 | # Custom sidebar templates, must be a dictionary that maps document names 92 | # to template names. 93 | # 94 | # The default sidebars (for documents that don't match any pattern) are 95 | # defined by theme itself. Builtin themes are using these templates by 96 | # default: ``['localtoc.html', 'relations.html', 'sourcelink.html', 97 | # 'searchbox.html']``. 98 | # 99 | # html_sidebars = {} 100 | 101 | 102 | # -- Options for HTMLHelp output --------------------------------------------- 103 | 104 | # Output file base name for HTML help builder. 105 | htmlhelp_basename = 'NetworkLabdoc' 106 | 107 | 108 | # -- Options for LaTeX output ------------------------------------------------ 109 | 110 | latex_elements = { 111 | # The paper size ('letterpaper' or 'a4paper'). 112 | # 113 | # 'papersize': 'letterpaper', 114 | 115 | # The font size ('10pt', '11pt' or '12pt'). 116 | # 117 | # 'pointsize': '10pt', 118 | 119 | # Additional stuff for the LaTeX preamble. 120 | # 121 | # 'preamble': '', 122 | 123 | # Latex figure (float) alignment 124 | # 125 | # 'figure_align': 'htbp', 126 | } 127 | 128 | # Grouping the document tree into LaTeX files. List of tuples 129 | # (source start file, target name, title, 130 | # author, documentclass [howto, manual, or own class]). 131 | latex_documents = [ 132 | (master_doc, 'NetworkLab.tex', u'Network Lab Documentation', 133 | u'avestura', 'manual'), 134 | ] 135 | 136 | 137 | # -- Options for manual page output ------------------------------------------ 138 | 139 | # One entry per manual page. List of tuples 140 | # (source start file, name, description, authors, manual section). 141 | man_pages = [ 142 | (master_doc, 'networklab', u'Network Lab Documentation', 143 | [author], 1) 144 | ] 145 | 146 | 147 | # -- Options for Texinfo output ---------------------------------------------- 148 | 149 | # Grouping the document tree into Texinfo files. List of tuples 150 | # (source start file, target name, title, author, 151 | # dir menu entry, description, category) 152 | texinfo_documents = [ 153 | (master_doc, 'NetworkLab', u'Network Lab Documentation', 154 | author, 'NetworkLab', 'One line description of project.', 155 | 'Miscellaneous'), 156 | ] 157 | 158 | 159 | # -- Options for Epub output ------------------------------------------------- 160 | 161 | # Bibliographic Dublin Core info. 162 | epub_title = project 163 | 164 | # The unique identifier of the text. This can be a ISBN number 165 | # or the project homepage. 166 | # 167 | # epub_identifier = '' 168 | 169 | # A unique identification for the text. 170 | # 171 | # epub_uid = '' 172 | 173 | # A list of files that should not be packed into the epub file. 174 | epub_exclude_files = ['search.html'] 175 | 176 | 177 | # -- Extension configuration ------------------------------------------------- 178 | 179 | html_theme = 'sphinx_rtd_theme' 180 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] 181 | 182 | html_context = { 183 | "display_github": True, # Integrate GitHub 184 | "github_user": "avestura", # Username 185 | "github_repo": "NetworkLab", # Repo name 186 | "github_version": "master", # Version 187 | "conf_py_path": "/source/", # Path in the checkout to the docs root 188 | } -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to Network Lab's documentation! 2 | ======================================= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Contents: 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | :caption: Network Lab 11 | 12 | About/index 13 | 14 | .. toctree:: 15 | :maxdepth: 2 16 | :caption: Fundamentals 17 | 18 | Fundamentals/Basics 19 | 20 | .. toctree:: 21 | :maxdepth: 2 22 | :caption: Routing Algorithms 23 | 24 | RoutingAlgorithms/SimpleIPRoute.rst 25 | RoutingAlgorithms/DiamondIPRoute.rst 26 | RoutingAlgorithms/OSPF.rst 27 | RoutingAlgorithms/EIGRP.rst 28 | RoutingAlgorithms/BGP.rst 29 | 30 | .. toctree:: 31 | :maxdepth: 2 32 | :caption: Security 33 | 34 | Security/IPSecOverGRE.rst 35 | 36 | .. toctree:: 37 | :maxdepth: 2 38 | :caption: DHCP 39 | 40 | DHCP/CentralDHCPServer.rst 41 | 42 | 43 | 44 | Indices and tables 45 | ================== 46 | 47 | * :ref:`genindex` 48 | * :ref:`modindex` 49 | * :ref:`search` -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Network Lab Projects 2 | 3 | Simple network projects documentions and implementations in GNS3 4 | 5 | Read the docs here: [NetworkLab](https://networklab.readthedocs.io) --------------------------------------------------------------------------------