You are on page 1of 7

Networks

Ring Network
Configurare la rete in modo che tu2 gli host possano comunicare fra di loro nei termini defini6
(prestare par6colare a8enzione ai gateway).

Soluzione:
Rete Marionnet
1. Machine: H1, H2, H3, H4
2. Switch: S1, S2
3. Machine > Modify > H2 > Ethernet cards = 2
4. Machine > Modify > H4 > Ethernet cards = 2
5. Straight cable:
d1 [H1 (eth0) to S1 (port 1)]
d2 [S1 (port 2) to H2 (eth0)]
d3 [H2 (eth1) to S2 (port 1)]
d4 [S2 (port 2) to H3 (eth0)]
d5 [H4 (eth1) to S2 (port 3)]
d6 [S1 (port 3) to H4 (eth0)]
§ Then press the [Start all] bu8on.

Con6nuazione →
1
Networks
Ring Network
Configurazione
§ H1 Terminal (LAN 1)
$ nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.2
$ ifup eth0
§ H2 Terminal (LAN 1-2)
$ sysctl -w net.ipv4.ip_forward=1
$ nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0

auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.4
$ ifup eth0 eth1
§ H4 Terminal (LAN 1-2)
$ sysctl -w net.ipv4.ip_forward=1
$ nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.4
netmask 255.255.255.0
gateway 192.168.0.2

auto eth1
iface eth0 inet static
address 192.168.1.4
netmask 255.255.255.0
$ ifup eth0 eth1
§ H3 Terminal (LAN 2)
$ nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.4
$ ifup eth0

2
Networks
Ring Network + Internet
Estendere la rete per perme8ere agli host di comunicare verso Internet (u6lizzare il blocco
apposito in Marionnet per simulare Internet, ricordarsi di non u6lizzare ping per testare la
connessione verso Internet)

Soluzione:
Rete Marionnet
1. Machine: H1, H2, H3, H4, H5, H6
2. Switch: S1, S2, S3
3. Machine > Modify > H2 > Ethernet cards = 2
4. Machine > Modify > H3 > Ethernet cards = 2
5. Machine > Modify > H4 > Ethernet cards = 2
6. Machine > Modify > H6 > Ethernet cards = 2
7. Straight cable:
d1 [H1 (eth0) to S1 (port 1)]
d2 [S1 (port 2) to H2 (eth0)]
d3 [H2 (eth1) to S2 (port 1)]
d4 [S2 (port 2) to H3 (eth0)]
d5 [H4 (eth1) to S2 (port 3)]
d6 [S1 (port 3) to H4 (eth0)]
d7 [H3 (eth1) to S3 (port 1)]
d8 [S3 (port 2) to H5 (eth0)]
d9 [S3 (port 3) to H6 (eth0)]
8. Real World Access > Gateway > G1
9. Crossover cable: c1 [G1 (port 1) to H6 (eth1)]
§ Then press the [Start all] bu8on.

Con6nuazione →

3
Networks
Ring Network + Internet

Configurazione
H1 Terminal (LAN 1)
$ sysctl -w net.ipv4.ip_forward=1
$ nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.2
$ ifup eth0
H2 Terminal (LAN 1-2)
$ sysctl -w net.ipv4.ip_forward=1
$ nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0

auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
$ ifup eth0 eth1
H4 Terminal (LAN 1-2)
$ sysctl -w net.ipv4.ip_forward=1
$ nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.4
netmask 255.255.255.0
gateway 192.168.0.2

auto eth1
iface eth1 inet static
address 192.168.1.4
netmask 255.255.255.0
$ ifup eth0 eth1
Con6nuazione →

4
Networks
Ring Network + Internet
Configurazione
H3 Terminal (LAN 2-3)
$ sysctl -w net.ipv4.ip_forward=1
$ nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
post-up route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.1.4

auto eth1
iface eth1 inet static
address 192.168.2.1
netmask 255.255.255.0
gateway 192.168.2.254
$ ifup eth0 eth1
H5 Terminal
$ sysctl -w net.ipv4.ip_forward=1
$ nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.2.2
netmask 255.255.255.0
gateway 192.168.2.254
post-up route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.2.1
post-up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1
$ ifup eth0
H6 Terminal
$ sysctl -w net.ipv4.ip_forward=1
$ dhclient eth1
$ nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.2.254
netmask 255.255.255.0
post-up route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.2.1
post-up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1

auto eth1
iface eth1 inet dhcp
$ ifup eth0 eth1
$ cat /etc/resolv.conf
nameserver 10.0.2.3
Per ogni Host, H1, H2, H3, H4, H5, và configurato il DNS Resolver:
$ echo namesarver 10.0.2.3 > /etc/resolv.conf

5
Networks
Star Network + Internet
Modificare la rete precedente collegando tu2 gli host allo stesso switch (u6lizzando per ogni host
un singolo collegamento fisico) e mantenendo separa6 i domini di broadcast Ethernet di LAN
differen6 tramite l'uso di VLAN.

Soluzione:
Rete Marionnet
1. Machine: H1, H2, H3, H4, H5, H6
2. Machine > Modify > H2 > Ethernet cards = 2
3. Machine > Modify > H3 > Ethernet cards = 2
4. Machine > Modify > H4 > Ethernet cards = 2
5. Machine > Modify > H6 > Ethernet cards = 2
6. Switch: S1
7. Switch > Modify > S1 > Ports number = 10
8. Switch > Modify > S1 > Show VDE terminal
9. Straight cable:
d1 [H1 (eth0) to S1 (port 1)]
d2 [S1 (port 2) to H2 (eth0)]
d3 [S1 (port 3) to H2 (eth1)]
d4 [S1 (port 4) to H5 (eth0)]
d5 [S1 (port 5) to H6 (eth0)]
d6 [H4 (eth0) to S1 (port 6)]
d7 [H4 (eth1) to S1 (port 7)]
d8 [H3 (eth0) to S1 (port 8)]
d9 [H3 (eth1) to S1 (port 9)]
10. Real World Access > Gateway > G1
11. Crossover cable: c1 [G1 (port 1) to H6 (eth1)]
§ Then press the [Start all] bu8on.

6
Networks
Star Network + Internet
Configurazione

You might also like