Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 24

system reset-configuration

109.45.45.1

109.45.45.2
109.45.45.13

109.45.45.5
109.45.45.9

109.45.45.10
109.45.45.6
R1
/system identity set name=R1

/interface bridge add name=loopback0

/ip address add address=10.255.255.1/32


interface=loopback0

/ip address add address=109.45.45.1/30


interface=ether2

/ip address add address=109.45.45.5/30


interface=ether3

ip/route/print
ip/address/print

R2

/system identity set name=R2

/interface bridge add name=loopback0

/ip address add address=10.255.255.2/32


interface=loopback0

/ip address add address=109.45.45.2/30


interface=ether1

/ip address add address=109.45.45.9/30


interface=ether2

/ip address add address=109.45.45.13/30


interface=ether3

ip/route/print

ip/address/print

R3

/system identity set name=R3


/interface bridge add name=loopback0

/ip address add address=10.255.255.3/32


interface=loopback0

/ip address add address=109.45.45.6/30


interface=ether1

/ip address add address=109.45.45.10/30


interface=ether2

ip/route/print

ip/address/print

Ping από R1 στα αντικρυστά interfaces


ping 109.45.45.2

ping 109.45.45.6

Ping από R2 στα αντικρυστά interfaces


ping 109.45.45.1

ping 109.45.45.10

Ping από R3 στα αντικρυστά interfaces


ping 109.45.45.9

ping 109.45.45.5

OSPF R1

/routing/ospf/instance/add name=default router-id=10.255.255.1 originate-default=if-installed redistribute=ospf,bgp,static

/routing/ospf/area/ add name=backbone area-id=0.0.0.0 instance=default

/routing/ospf/interface-template add network=109.45.45.0/30 area=backbone

/routing/ospf/interface-template add network=109.45.45.4/30 area=backbone


ip firewall nat add chain=srcnat action=masquerade out-interface=ether1
OSPF R2

/routing/ospf/instance/add name=default router-id=10.255.255.2 originate-default=if-installed redistribute=ospf,bgp,static

/routing/ospf/area/ add name=backbone area-id=0.0.0.0 instance=default

/routing/ospf/interface-template add network=109.45.45.8/30 area=backbone

/routing/ospf/interface-template add network=109.45.45.0/30 area=backbone

OSPF R3

/routing/ospf/instance/add name=default router-id=10.255.255.3 originate-default=if-installed redistribute=ospf,bgp,static

/routing/ospf/area/ add name=backbone area-id=0.0.0.0 instance=default

/routing/ospf/interface-template add network=109.45.45.4/30 area=backbone

/routing/ospf/interface-template add network=109.45.45.8/30 area=backbone

R1
ip/route/print

R2
ip/route/print

R3
ip/route/print

ping R1
ping 109.45.45.5

ping 109.45.45.6

ping 109.45.45.9

ping 109.45.45.10
ping 109.45.45.2

ping R2
ping 109.45.45.1

ping 109.45.45.5

ping 109.45.45.6

ping 109.45.45.9

ping 109.45.45.10

ping R3
ping 109.45.45.1

ping 109.45.45.2

ping 109.45.45.9

ping 109.45.45.10

ping 109.45.45.5

ping 109.45.45.6

R1

ip route pr

R2

ip route pr

R3

ip route pr
R2

ip dhcp-server setup

Select interface to run DHCP server on

dhcp server interface: ether3

Select network for DHCP addresses

dhcp address space: 109.45.45.12/30

Select gateway for given network

gateway for dhcp network: 109.45.45.13

Select pool of ip addresses given out by DHCP


server

addresses to give out: 109.45.45.14

Select DNS servers

dns servers: 8.8.8.8

Select lease time

lease time: 1800

ip firewall nat add chain=srcnat action=masquerade out-interface=ether2

ip firewall nat add chain=srcnat action=masquerade out-interface=ether1

Debian

sudo nano /etc/network/interfaces

sudo nano /etc/resolv.conf

nameserver 10.10.10.1

sudo reboot

ip a
traceroute 109.45.45.1

traceroute 109.45.45.2
109.45.45.1

109.45.45.2
109.45.45.5

109.45.45.13 109.45.45.6

110.45.45.1
109.45.45.9 109.45.45.10

110.45.45.2 110.45.45.5

110.45.45.13
110.45.45.6

110.45.45.9 110.45.45.10
R4
/system identity set name=R4

/interface bridge add name=loopback0

/ip address add address=10.255.255.4/32


interface=loopback0

/ip address add address=110.45.45.1/30


interface=ether2

/ip address add address=110.45.45.5/30


interface=ether3

ip/route/print

ip/address/print

R5
/system identity set name=R5

/interface bridge add name=loopback0

/ip address add address=10.255.255.5/32


interface=loopback0

/ip address add address=110.45.45.2/30


interface=ether1

/ip address add address=110.45.45.9/30


interface=ether2

/ip address add address=110.45.45.13/30


interface=ether3

ip/route/print

R6

/system identity set name=R6

/interface bridge add name=loopback0


/ip address add address=10.255.255.6/32
interface=loopback0

/ip address add address=110.45.45.6/30


interface=ether1

/ip address add address=110.45.45.10/30


interface=ether2

ip/route/print

ip/address/print

Ping από R4 στα αντικρυστά interfaces


ping 110.45.45.2

ping 110.45.45.6

Ping από R5 στα αντικρυστά interfaces


ping 110.45.45.1

ping 110.45.45.10

Ping από R6 στα αντικρυστά interfaces


ping 110.45.45.9

ping 110.45.45.5

OSPF R4

/routing/ospf/instance/add name=default router-id=10.255.255.4 originate-default=if-installed redistribute=ospf,bgp,static

/routing/ospf/area/ add name=backbone2 area-id=2.2.2.2 instance=default

/routing/ospf/interface-template add network=110.45.45.0/30 area=backbone2

/routing/ospf/interface-template add network=110.45.45.4/30 area=backbone2

ip firewall nat add chain=srcnat action=masquerade out-interface=ether1


OSPF R5

/routing/ospf/instance/add name=default router-id=10.255.255.5 originate-default=if-installed redistribute=ospf,bgp,static

/routing/ospf/area/ add name=backbone2 area-id=2.2.2.2 instance=default

/routing/ospf/interface-template add network=110.45.45.8/30 area=backbone2

/routing/ospf/interface-template add network=110.45.45.0/30 area=backbone2

ip firewall nat add chain=srcnat action=masquerade out-interface=ether2

ip firewall nat add chain=srcnat action=masquerade out-interface=ether1

OSPF R6

/routing/ospf/instance/add name=default router-id=10.255.255.6 originate-default=if-installed


redistribute=ospf,bgp,static

/routing/ospf/area/ add name=backbone2 area-id=2.2.2.2 instance=default

/routing/ospf/interface-template add network=110.45.45.4/30 area=backbone2

/routing/ospf/interface-template add network=110.45.45.8/30 area=backbone2

R4
ip/route/print

R5
ip/route/print

R6
ip/route/print

ping R4
ping 110.45.45.5

ping 110.45.45.6

ping 110.45.45.9

ping 110.45.45.10

ping 110.45.45.2

ping R5
ping 110.45.45.1

ping 110.45.45.5

ping 110.45.45.6

ping 110.45.45.9

ping 110.45.45.10

ping R6
ping 110.45.45.1

ping 110.45.45.2

ping 110.45.45.9

ping 110.45.45.10

ping 110.45.45.5

ping 110.45.45.6

R4
ip route pr

R5

ip route pr

R6

ip route pr

R5

ip dhcp-server setup

Select interface to run DHCP server on

dhcp server interface: ether3

Select network for DHCP addresses

dhcp address space: 110.45.45.12/30

Select gateway for given network

gateway for dhcp network: 110.45.45.13

Select pool of ip addresses given out by DHCP


server

addresses to give out: 110.45.45.14

Select DNS servers

dns servers: 8.8.8.8

Select lease time

lease time: 1800

ip firewall nat add chain=srcnat action=masquerade out-interface=ether2

ip firewall nat add chain=srcnat action=masquerade out-interface=ether1


Debian2

sudo nano /etc/network/interfaces

sudo nano /etc/resolv.conf

nameserver 10.10.10.1

sudo reboot

ip a

Παραμετροποίηση BGP σύνδεσης R1


/ip address add address=192.168.5.1/30 interface=ether4

/routing/bgp/template/add name=bgp-template router-id=10.255.255.1 as=10945 output.redistribute=static,ospf,bgp routing-table=main

/routing/bgp/connection/ add name=toR4 remote.address=192.168.5.2 remote.as=11045 templates=bgp-template local.port=179 remote.port=179 listen=yes connect=yes output.default-
originate=if-installed local.role=ebgp keepalive-time=60s

/routing/bgp/connection/print

Παραμετροποίηση BGP σύνδεσης R4


/ip address add address=192.168.5.2/30 interface=ether1

/routing/bgp/template/add name=bgp-template router-id=10.255.255.4 as=11045 output.redistribute=static,ospf,bgp routing-table=main

/routing/bgp/connection/ add name=toR1 remote.address=192.168.5.1 remote.as=10945 templates=bgp-template local.port=179 remote.port=179 listen=yes connect=yes output.default-
originate=if-installed local.role=ebgp keepalive-time=60s

/routing/bgp/connection/print

Ping από R4 σε όλα τα interfaces


ping 109.45.45.1

ping 109.45.45.2

ping 109.45.45.9

ping 109.45.45.10

ping 109.45.45.5

ping 109.45.45.6

Ping από R1 σε όλα τα interfaces

ping 110.45.45.1

ping 110.45.45.2

ping 110.45.45.5

ping 110.45.45.6

ping 110.45.45.9

ping 110.45.45.10

Debian 2

Εκτελέστε traceroute από το debian-2 και δείξτε τις διαδρομές προς το 8.8.8.8
traceroute 8.8.8.8

Απάντηση

traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets

1 110.45.45.13 (110.45.45.13) 10.108 ms 12.153 ms 12.254 ms

2 110.45.45.1 (110.45.45.1) 12.246 ms 12.240 ms 12.217 ms

3 192.168.5.1 (192.168.5.1) 12.206 ms 12.192 ms 12.182 ms


4 192.168.126.2 (192.168.126.2) 12.174 ms 12.277 ms 12.272 ms

5 ***

6 ***

7 ***

8 ***

9 ***

10 * * *

11 * * *

12 * * *

13 * * *

14 * * *

15 * * *

16 * * *

17 * * *

18 * * *

19 * * *

20 * * *

21 * * *

22 * * *

23 * * *

24 * * *

25 * * *

26 * * *

27 * * *

28 * * *

29 * * *
Εκτελέστε ping από το debian 2

ping 8.8.8.8

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

64 bytes from 8.8.8.8: icmp_seq=1 ttl=125 time=51.9 ms

64 bytes from 8.8.8.8: icmp_seq=2 ttl=125 time=52.6 ms

64 bytes from 8.8.8.8: icmp_seq=3 ttl=125 time=51.7 ms

sudo apt-get update

sudo apt-get install telnet gcc

-------------------------------------------------- Υποβολή Εργασίας ------------------------------------------------


Από το τερματικό Debiab 12.4.1 εκτελέστε τις παρακάτω εντολές:
wget https://github.com/kyrg/gns3-test/raw/main/5th_Ergasia.sh.x
chmod ogu+x 5th_Ergasia.sh.x
sudo ./5th_Ergasia.sh.x

debian@debian:~$ sudo ./5th_Ergasia.sh.x


Give your Arithmo Mitroou/Δώστε τον αριθμο μητρώου (7ψήφιο) σας: 1094545
your ip address: 109.45.45.14 and your gateway: 109.45.45.13
Calculating IPs of: R1,R2,R4,debian 2, local/remote AS and all subnet network numbers.
Start traceroute to 8.8.8.8 with ICMP: SUCCESS : you reach 8.8.8.8 in 13 hops
Found Border gateway router (R1): 109.45.45.1
Finding IP of Debian 2....Pinging to 110.45.45.12/30 network....
Starting pinging to 110.45.45.15......
ping to 110.45.45.15 received: IP of Debian 2 is 110.45.45.15
Telnet to 109.45.45.1 (R1). Getting ip route tables.
Warning: Permanently added '109.45.45.1' (RSA) to the list of known hosts.
admin@109.45.45.1's password:
Connection to 109.45.45.1 closed.
Subnet 109.45.45.0/30 Found
Subnet 109.45.45.4/30 Found
Subnet 109.45.45.8/30 Found
Subnet 109.45.45.12/30 Failed
Connection to 0.0.0.0/0 Found
Subnet 110.45.45.0/30 Failed
Subnet 110.45.45.4/30 Failed
Subnet 110.45.45.8/30 Found
Subnet 109.45.45.12/30 Failed
Telnet to 109.45.45.1 (R1). Get BGP connection info.
admin@109.45.45.1's password:
Connection to 109.45.45.1 closed.
BGP connection exists: SUCCESS
BGP connection is active: SUCCESS
Found Remote AS: 11045
11045
Found BGP link remote address: 192.168.5.2
192.168.5.2
BGP link remote address (192.168.5.2 192.168.5.2) found in R1 tables: SUCCESS
sh: 307: [: Illegal number: 11045
11045
Remote AS is not correct. Should be 11045: FAILED
Found local AS: 10945
10945
Found local BGP link local address: 192.168.5.1
192.168.5.1
Calculating BGP subnet network:
192.168.5
192.168.5.0/30
BGP subnet network (192.168.5 192.168.5.0/30) found in R1 tables: SUCCESS
sh: 343: [: Illegal number: 10945
10945
Local AS is not correct. Should be 10945: FAILED
Telnet to 109.45.45.1 (R1). Get area-id of opsf
admin@109.45.45.1's password:
Connection to 109.45.45.1 closed.
area id is: 0.0.0.0: SUCCESS
Telnet to 192.168.5.2
192.168.5.2 (R4). Get area-id of opsf
: Could not resolve hostname 192.168.5.2
192.168.5.2: Name or service not known
area id is: . Should be 2.2.2.2: FAILED
Telnet to 109.45.45.1 (R1). Get interfaces info.
admin@109.45.45.1's password:
Connection to 109.45.45.1 closed.
Starting traceroute to Debian 2 (max hops set to 7)
traceroute to 110.45.45.15 (110.45.45.15), 7 hops max, 60 byte packets
1 109.45.45.13 0.398 ms * *
2 109.45.45.1 0.545 ms * *
3 192.168.126.2 3.546 ms 2.682 ms 2.343 ms
4 192.168.1.1 9.899 ms 9.611 ms 9.308 ms
5 80.106.125.100 11.298 ms 10.991 ms 10.158 ms
6 79.128.234.168 13.469 ms 13.063 ms 12.772 ms
7 79.128.224.218 15.245 ms 18.393 ms 18.103 ms
Traceroute to Debian 2 (110.45.45.15) not reach; FAILED
Testing IPs of hops:
ip address (109.45.45.1) of R1 found in path: SUCCESS
BGP remote address (192.168.5.2 192.168.5.2) not found in path: FAILED
Begin ping to 8.8.8.8: ping to 8.8.8.8: CORRECT
Begin ping to google.com: ping to google.com: CORRECT
Submit result: y/n ? y
entered yes. uploading results....good bye
debian@debian:~$

debian@debian:~$ sudo ./5th_Ergasia.sh.x


Give your Arithmo Mitroou/Δώστε τον αριθμο μητρώου (7ψήφιο) σας: 1094545
your ip address: 109.45.45.14 and your gateway: 109.45.45.13
Calculating IPs of: R1,R2,R4,debian 2, local/remote AS and all subnet network numbers.
Start traceroute to 8.8.8.8 with ICMP: SUCCESS : you reach 8.8.8.8 in 13 hops
Found Border gateway router (R1): 109.45.45.1
Finding IP of Debian 2....Pinging to 110.45.45.12/30 network....
Starting pinging to 110.45.45.15......
ping to 110.45.45.15 received: IP of Debian 2 is 110.45.45.15
Telnet to 109.45.45.1 (R1). Getting ip route tables.
admin@109.45.45.1's password:
Connection to 109.45.45.1 closed.
Subnet 109.45.45.0/30 Found
Subnet 109.45.45.4/30 Found
Subnet 109.45.45.8/30 Found
Subnet 109.45.45.12/30 Failed
Connection to 0.0.0.0/0 Found
Subnet 110.45.45.0/30 Failed
Subnet 110.45.45.4/30 Failed
Subnet 110.45.45.8/30 Found
Subnet 109.45.45.12/30 Failed
Telnet to 109.45.45.1 (R1). Get BGP connection info.
admin@109.45.45.1's password:
Connection to 109.45.45.1 closed.
BGP connection exists: SUCCESS
BGP connection is active: SUCCESS
Found Remote AS: 11045
11045
Found BGP link remote address: 192.168.5.2
192.168.5.2
BGP link remote address (192.168.5.2 192.168.5.2) found in R1 tables: SUCCESS
sh: 307: [: Illegal number: 11045
11045
Remote AS is not correct. Should be 11045: FAILED
Found local AS: 10945
10945
Found local BGP link local address: 192.168.5.1
192.168.5.1
Calculating BGP subnet network:
192.168.5
192.168.5.0/30
BGP subnet network (192.168.5 192.168.5.0/30) found in R1 tables: SUCCESS
sh: 343: [: Illegal number: 10945
10945
Local AS is not correct. Should be 10945: FAILED
Telnet to 109.45.45.1 (R1). Get area-id of opsf
admin@109.45.45.1's password:
Connection to 109.45.45.1 closed.
area id is: 0.0.0.0: SUCCESS
Telnet to 192.168.5.2
192.168.5.2 (R4). Get area-id of opsf
: Could not resolve hostname 192.168.5.2
192.168.5.2: Name or service not known
area id is: . Should be 2.2.2.2: FAILED
Telnet to 109.45.45.1 (R1). Get interfaces info.
admin@109.45.45.1's password:
Connection to 109.45.45.1 closed.
Starting traceroute to Debian 2 (max hops set to 7)
traceroute to 110.45.45.15 (110.45.45.15), 7 hops max, 60 byte packets
1 109.45.45.13 0.432 ms * *
2 109.45.45.1 0.568 ms * *
3 192.168.126.2 6.510 ms 5.266 ms 4.862 ms
4 192.168.1.1 9.529 ms 9.230 ms 8.921 ms
5 80.106.125.100 17.494 ms 17.189 ms 16.904 ms
6 79.128.234.168 16.585 ms 16.223 ms 17.642 ms
7 79.128.224.218 19.886 ms 19.563 ms 19.223 ms
Traceroute to Debian 2 (110.45.45.15) not reach; FAILED
Testing IPs of hops:
ip address (109.45.45.1) of R1 found in path: SUCCESS
BGP remote address (192.168.5.2 192.168.5.2) not found in path: FAILED
Begin ping to 8.8.8.8: ping to 8.8.8.8: CORRECT
Begin ping to google.com: ping to google.com: CORRECT
Submit result: y/n ? ping 110.45.45.15
entered No. Good bye

You might also like