Compare commits

...

39 commits
main ... dev

Author SHA1 Message Date
Manuel Thalmann 279e6a6991 Implement Network Address Translation 2023-12-18 20:44:03 +01:00
Manuel Thalmann 48c23e61ab Add firewall rules 2023-12-18 20:03:45 +01:00
Manuel Thalmann 28b26dd8ed Set all clients to DHCP 2023-12-18 19:45:49 +01:00
Manuel Thalmann 9bd7a35f4a Fix non-functioning logins on switches 2023-12-18 19:05:10 +01:00
Manuel Thalmann b8b9b01ea4 Enable portfast on SWC 2023-12-18 18:49:33 +01:00
Manuel Thalmann da07b12c29 Enable SSH login on all network devices 2023-12-06 01:41:16 +01:00
Manuel Thalmann ff5094aada Re-enable DHCP 2023-12-06 01:29:03 +01:00
Manuel Thalmann 6d30fb5316 Enable VLAN 1 on SWC 2023-12-06 01:10:01 +01:00
Manuel Thalmann d1a38b893c Add routes to EE 2023-12-06 01:08:57 +01:00
Manuel Thalmann f7fb57a31a Enable DHCP on all clients 2023-12-06 00:52:58 +01:00
Manuel Thalmann fe6fc8aa7a Set default gateway for SWC 2023-12-06 00:36:13 +01:00
Manuel Thalmann 9e36f2a45d Set the hostname of SWC 2023-12-06 00:34:51 +01:00
Manuel Thalmann e14bf7d4ac Assign ip addresses to all switches 2023-12-06 00:25:56 +01:00
Manuel Thalmann d6eea0dadb Fix incorrect switch name 2023-12-06 00:21:50 +01:00
Manuel Thalmann e196c17268 Fix incorrect label on diagram 2023-12-06 00:20:40 +01:00
Manuel Thalmann c9c67d3bdf Merge Lab04 into current lab 2023-12-06 00:19:24 +01:00
Manuel Thalmann 63c2f558d0 Upgrade Lab05 description 2023-12-06 00:08:00 +01:00
Manuel Thalmann 360b6da37e Label switches with VLAN10 IPs 2023-12-05 23:18:29 +01:00
Manuel Thalmann 128c977d36 Align labels in SVG image 2023-12-05 23:10:49 +01:00
Manuel Thalmann 8914a98fbd Add remarks on lab-3 solution 2023-12-05 11:34:48 +01:00
Manuel Thalmann 9b76e7b750 Add the SWC switch 2023-12-05 11:34:05 +01:00
Manuel Thalmann 9efb625ba7 Add Lab 05 details 2023-12-04 20:58:53 +01:00
Manuel Thalmann 7dd2334d5e Add all steps of the tutorial 2023-12-04 20:21:56 +01:00
Manuel Thalmann d463aadbbc Set up DHCP 2023-12-04 20:15:11 +01:00
Manuel Thalmann 3d119480e5 Set up First-Hop redundancy protocol 2023-12-04 19:20:56 +01:00
Manuel Thalmann 38f32833c0 Set up Iner-VLAN routing 2023-12-04 19:14:10 +01:00
Manuel Thalmann 416662ae33 Move from use of branches to use of tags 2023-12-04 18:21:14 +01:00
Manuel Thalmann e1264e5d52 Add remarks on naming of lab files 2023-12-04 18:20:43 +01:00
Manuel Thalmann 18af1c010d Rename lab documents 2023-12-04 18:19:13 +01:00
Manuel Thalmann a3aca6b07d Set tiled background for main project 2023-11-01 18:13:47 +01:00
Manuel Thalmann f7544406f1 Add creative background to Lab04 2023-11-01 18:11:47 +01:00
Manuel Thalmann 1fcb2005e1 Solve Lab 04 2023-11-01 00:22:31 +01:00
Manuel Thalmann e6ed1de844 Merge branch 'feature/lab-2' into dev 2023-11-01 00:22:00 +01:00
Manuel Thalmann 16807e4e87 Add notes on solving Lab 2 2023-10-31 23:55:16 +01:00
Manuel Thalmann 5bf1eead77 Add description for Lab 2 2023-10-31 00:51:32 +01:00
Manuel Thalmann 6ea621c4b0 Add solution for Lab 01 2023-10-31 00:18:38 +01:00
Manuel Thalmann 314853da5d Add Packet Tracer files to Git LFS 2023-10-31 00:14:36 +01:00
Manuel Thalmann f768be50bb Add lecture description 2023-10-30 22:40:57 +01:00
Manuel Thalmann ce41080dd6 Add a script for installing Cisco Packet Tracer 2023-10-30 18:29:09 +01:00
13 changed files with 65959 additions and 1 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
*.pkt filter=lfs diff=lfs merge=lfs -text

BIN
Networks/Main.pkt (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -1,3 +1,20 @@
# ST1Tutorials
Solutions for the tutorial lessons of Applied Network Security 1 at CVUT FIT
Solutions for the tutorial lessons of Applied Network Security 1 at CVUT FIT
## Network Diagram
This diagram shows the network topology as it should turn out after finishing this semester:
### Segmented Version
![Segmented View](./Segmented.svg)
In this version, the different parts of the network are labelled:
- ***CORE*** <!--- ToDo: Add description -->
- ***DISTRIBUTION*** <!--- ToDo: Add description -->
- ***ACCESS*** <!--- ToDo: Add description -->
### Unsegmented Version
![Unsegmented View](./Unsegmented.svg)
### Labs
Labs are stored in the `Tutorials` directory in folders named `M{# of meeting} Lab {# of lab} - {title}`.

12848
Segmented.svg Normal file

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 414 KiB

View file

@ -0,0 +1,6 @@
# Lab 01 - Virtual Networks
> ***Objectives:***
> - Create Switch 1, Switch 2, Switch 3 and Switch 4.
> - Attach 6 PCs to each Switch
Objectives are realized in `../../Networks/Main.pkt` at tag `lab-1`.

View file

@ -0,0 +1,77 @@
# Lab 02 - Switch Configuration
> ***Objectives:***
> - Ensure PCs and switches are connected properly
> - Cable types
> - PC-SW: straight cables
> - SW-SW: ~~gay~~ crossover cables
> - Connections
> - Connect PCs to ports 1-3 and 11-13 of switches
> - Connect switches together with ports 23 and 24
> - Configure switches properly
> - Rename switches to `SW1`-`SW4`
> - Assign ports 1-10 to VLAN 10
> - Assign ports 11-20 to VLAN 20
> - Set spanning-tree `portfast` on ports 1-20
> - Set ports 22-24 as trunks for VLAN 10 and 20
> - Set spanning-tree `portfast trunk` for ports 22-24
> - Set `SW2` to be spanning-tree root primary for VLAN 10 and root secondary for VLAN 20
> - Set `SW3` to be spanning-tree root secondary for VLAN 20
> - Configure static IP addresses for at least 3 computers per switch
The lab is realized in `./Networks/Main.ptk` in tag `lab-2`
## Basic Configuration
Run this configuration on each Switch replacing `{x}` with the switch number:
```sh
enable
configure terminal
hostname SW{x}
interface range fastEthernet 0/1-10
switchport mode access
switchport access vlan 10
interface range fastEthernet 0/11-20
switchport mode access
switchport access vlan 20
interface range fastEthernet 0/1-20
spanning-tree portfast
interface range fastEthernet 0/22-24
switchport mode trunk
switchport trunk allowed vlan 10,20
spanning-tree portfast trunk
exit
exit
disable
exit
```
## Configuration of `SW2`
```sh
enable
configure terminal
spanning-tree vlan 10 root primary
spanning-tree vlan 20 root secondary
exit
exit
disable
exit
```
## Configuration of `SW3`
```sh
enable
configure terminal
spanning-tree vlan 10 root secondary
spanning-tree vlan 20 root primary
exit
exit
disable
exit
```

View file

@ -0,0 +1,93 @@
# Lab 04 - Dynamic Routing
> ***Objectives:***
> - Replicate Internet configuration by setting up a chain of 3 routers
> - `EE`: Enterprise switch (the switch of the company or home)
> - `ISP`: The router of the internet service provider
> - `NET`: The router of the provider of a website
> - `SERVER` the web server providing the website
> - Set IP address of server and routers
> - Enable OSPF protocol on all routers
> - Try to ping the webserver from the `EE` router
The lab is realized in `./Networks/Lab 04.ptk` in tag `lab-4`
## Router Configuration
Router `EE`:
```sh
enable
configure terminal
hostname EE
interface fastEthernet0/1
ip address 1.0.0.1 255.0.0.0
no shutdown
interface fastEthernet0/0
ip address 10.123.0.3 255.255.0.0
no shutdown
router ospf 1337
network 1.0.0.0 0.255.255.255 area 0
exit
exit
disable
exit
```
Router `ISP`:
```sh
enable
configure terminal
hostname ISP
interface fastEthernet0/0
ip address 1.0.0.2 255.0.0.0
no shutdown
interface fastEthernet0/1
ip address 2.0.0.1 255.0.0.0
no shutdown
router ospf 1337
network 1.0.0.0 0.255.255.255 area 0
network 2.0.0.0 0.255.255.255 area 0
exit
exit
disable
exit
```
Router `NET`:
```sh
enable
configure terminal
hostname NET
interface fastEthernet0/0
ip address 2.0.0.2 255.0.0.0
no shutdown
interface fastEthernet0/1
ip address 3.0.0.1 255.0.0.0
no shutdown
router ospf 1337
network 2.0.0.0 0.255.255.255 area 0
network 3.0.0.0 0.255.255.255 area 0
exit
exit
disable
exit
```
## Test Change
On Router `EE`:
```sh
enable
ping 3.3.3.3
disable
exit
```

View file

@ -0,0 +1,76 @@
# Lab 03 - VLAN Routing
> ***Objectives:***
> - Use Lab 02 setup
> - Add the routers `R1` and `R2`
> - Create a subinterface FE0/0.10 for VLAN10
> - Set up VLAN routing
> - Set up load balancing using First-Hop Redundancy Protocol
> - Set up DHCP
The lab is realized in `./Networks/Main.ptk` in tag `lab-3`
## Inter-VLAN Routing Configuration
For each router, configure this replacing `{x}` with the router number:
```sh
enable
configure terminal
hostname R{x}
interface fastEthernet 0/0
no shutdown
interface fastEthernet 0/0.10
ip address 10.10.0.{x} 255.255.0.0
encapsulation dot1q 10
no shutdown
interface fastEthernet 0/0.20
ip address 10.20.0.{x} 255.255.0.0
encapsulation dot1q 20
no shutdown
exit
exit
disable
exit
```
## First-Hop Redundancy Protocol Setup
On each router:
```sh
enable
configure terminal
interface fastEthernet 0/0.10
standby 1 ip 10.10.0.111
interface fastEthernet 0/0.20
standby 2 ip 10.20.0.222
exit
exit
disable
exit
```
## DHCP Configuration
On each router:
```sh
enable
configure terminal
ip dhcp pool Pool10
network 10.10.0.0 255.255.0.0
default-router 10.10.0.111
ip dhcp pool Pool20
network 10.20.0.0 255.255.0.0
default-router 10.20.0.222
exit
exit
disable
exit
```

View file

@ -0,0 +1,137 @@
# Lab 5 - Management VLAN
> ***Objectives:***
> - Use Lab 03 setup
> - Create Switch `SWC`
> - Merge Lab 04
> - Assign IP addresses to `SW1-4`
> - Assign IP address to `SWC`
> - Create user on each networking device
## Adding SWC
Configure `SWC`:
```sh
enable
configure terminal
hostname SWC
interface range fastEthernet 0/1-24
spanning-tree portfast
exit
exit
disable
exit
```
Configure routers replacing `{x}` with the number of the router:
```sh
enable
configure terminal
interface fastEthernet 0/1
ip address 10.123.0.{x} 255.255.0.0
no shutdown
exit
exit
disable
exit
```
## Assign IP Addresses
On SW1-4 replace `{x}` with the corresponding switch number:
```sh
enable
configure terminal
interface vlan 10
ip address 10.10.10.{x} 255.255.0.0
exit
exit
disable
exit
```
On `SWC` configure the following:
```sh
enable
configure terminal
interface vlan 1
ip address 10.123.0.4 255.255.0.0
no shutdown
exit
exit
disable
exit
```
## Gateway for SWC
On SWC:
```sh
enable
configure terminal
ip default-gateway 10.123.0.3
exit
exit
disable
exit
```
On EE:
```sh
enable
configure terminal
ip route 10.10.0.0 255.255.0.0 10.123.0.1
ip route 10.10.0.0 255.255.0.0 10.123.0.2
exit
exit
disable
exit
```
## Enable SSH Root Access
On all devices:
```sh
enable
configure terminal
username moucha privilege 15 secret cisco
ip domain-name moucha.org
line vty 0 15
transport input ssh
login local
exit
exit
disable
exit
```
On Switches:
```sh
enable
configure terminal
crypto key generate rsa general-keys modulus 4096
exit
exit
disable
exit
```
On Routers:
```sh
enable
configure terminal
crypto key generate rsa general-keys modulus 2048
exit
exit
disable
exit
```

View file

@ -0,0 +1,22 @@
# Lab 06 - Firewall using ACL
> ***Objectives:***
> - Implement firewall between VLAN10 and VLAN20
## Configure Routers
On Routers `R1` and `R2`
```sh
enable
configure terminal
ip access-list extended FILTER
permit ip 10.20.0.0 0.0.255.255 host 10.10.10.10
deny ip 10.20.0.0 0.0.255.255 10.10.0.0 0.0.255.255
permit ip any any
exit
interface fastEthernet 0/0.20
ip access-group FILTER in
exit
exit
disable
exit
```

View file

@ -0,0 +1,54 @@
# Lab 07 - NAT Overload and Port Forwarding
## Configure Router
On Router `EE` configure:
```sh
enable
configure terminal
ip access-list extended NAT-ACL
permit ip 10.0.0.0 0.255.255.255 any
exit
ip nat pool NAT-POOL 1.0.0.1 1.0.0.1 netmask 255.0.0.0
interface fastEthernet0/0
ip nat inside
exit
interface fastEthernet0/1
ip nat outside
exit
ip nat inside source list NAT-ACL pool NAT-POOL overload
exit
exit
disable
exit
```
On Router `R1` and `R2`:
```sh
enable
configure terminal
ip route 0.0.0.0 0.0.0.0 10.123.0.3
exit
exit
disable
exit
```
## Implement Port Forwarding
On `EE` configure port forwarding:
```sh
enable
configure terminal
ip nat inside source static tcp 10.10.10.10 80 1.0.0.1 180
ip nat inside source static tcp 10.10.10.10 443 1.0.0.1 443
exit
exit
disable
exit
```

52613
Unsegmented.svg Normal file

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 1.2 MiB

View file

@ -0,0 +1,11 @@
#!/bin/bash
contextRoot="$(mktemp -d)";
pushd "$contextRoot" > /dev/null;
git clone https://aur.archlinux.org/packettracer.git .
wget http://lectures.moucha.org/pt/CiscoPacketTracer_821_Ubuntu_64bit.deb;
makepkg -si;
sudo install --mode 644 *.desktop /usr/share/applications;
ls -al;
popd > /dev/null;
rm -rf "$contextRoot";