diff --git a/SCR3.2/TP00.tar b/SCR3.2/TP00.tar new file mode 100644 index 0000000..7a0a391 Binary files /dev/null and b/SCR3.2/TP00.tar differ diff --git a/SCR3.2/TP1/one-gateway.imn b/SCR3.2/TP1/one-gateway.imn new file mode 100644 index 0000000..cd1c116 --- /dev/null +++ b/SCR3.2/TP1/one-gateway.imn @@ -0,0 +1,223 @@ +node n0 { + type lanswitch + network-config { + hostname S1 + ! + } + canvas c0 + iconcoords {192 216} + labelcoords {192 239} + interface-peer {e0 n3} + interface-peer {e1 n4} + interface-peer {e2 n2} +} + +node n1 { + type lanswitch + network-config { + hostname S2 + ! + } + canvas c0 + iconcoords {624 216} + labelcoords {624 239} + interface-peer {e0 n2} + interface-peer {e1 n5} + interface-peer {e2 n6} +} + +node n2 { + type host + network-config { + hostname P1 + ! + interface eth1 + ipv6 address fc00:1::10/64 + mac address 42:00:aa:00:00:03 + ip address 172.16.2.254/24 + ! + interface eth0 + ipv6 address fc00::10/64 + mac address 42:00:aa:00:00:02 + ip address 172.16.1.254/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {432 288} + labelcoords {432 324} + interface-peer {eth0 n0} + interface-peer {eth1 n1} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + ip addr add 172.16.1.254/24 dev eth0 + ip addr add 172.16.2.254/24 dev eth1 + ip -6 addr add ::1/128 dev lo0 + ip -6 addr add fc00::10/64 dev eth0 + ip -6 addr add fc00:1::10/64 dev eth1 + + iptables -t nat -A PREROUTING -d 172.16.2.0/24 -j DNAT --to-destination 172.16.2.254 + iptables -t nat -A PREROUTING -d 172.16.1.0/24 -j DNAT --to-destination 172.16.2.254 + ip route append 172.16.1.0/24 via 172.16.1.254 + ip route append 172.16.2.0/24 via 172.16.2.254 + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n3 { + type pc + network-config { + hostname pc1-1 + ! + interface eth0 + ipv6 address fc00::20/64 + mac address 42:00:aa:00:00:00 + ip address 172.16.1.1/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.1.254 + ! + } + canvas c0 + iconcoords {48 96} + labelcoords {48 127} + interface-peer {eth0 n0} +} + +node n4 { + type pc + network-config { + hostname pc1-2 + ! + interface eth0 + ipv6 address fc00::21/64 + mac address 42:00:aa:00:00:01 + ip address 172.16.1.58/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.1.254 + ! + } + canvas c0 + iconcoords {24 288} + labelcoords {24 319} + interface-peer {eth0 n0} +} + +node n5 { + type pc + network-config { + hostname pc2-1 + ! + interface eth0 + ipv6 address fc00:1::20/64 + mac address 42:00:aa:00:00:04 + ip address 172.16.2.1/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {792 96} + labelcoords {792 127} + interface-peer {eth0 n1} +} + +node n6 { + type pc + network-config { + hostname pc2-2 + ! + interface eth0 + ipv6 address fc00:1::21/64 + mac address 42:00:aa:00:00:05 + ip address 172.16.2.64/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {792 336} + labelcoords {792 367} + interface-peer {eth0 n1} +} + +link l0 { + nodes {n0 n3} + bandwidth 0 +} + +link l1 { + nodes {n0 n4} + bandwidth 0 +} + +link l2 { + nodes {n2 n0} + bandwidth 0 +} + +link l3 { + nodes {n1 n2} + bandwidth 0 +} + +link l4 { + nodes {n5 n1} + bandwidth 0 +} + +link l5 { + nodes {n6 n1} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses no + node_labels yes + link_labels yes + background_images no + annotations yes + hostsAutoAssign no + grid yes + iconSize normal + zoom 1.0 +} + diff --git a/SCR3.2/TP1/two-gateways.imn b/SCR3.2/TP1/two-gateways.imn new file mode 100644 index 0000000..9c8cfe3 --- /dev/null +++ b/SCR3.2/TP1/two-gateways.imn @@ -0,0 +1,408 @@ +node n0 { + type host + network-config { + hostname P1 + ! + interface eth0 + ipv6 address fc00::10/64 + mac address 42:00:aa:00:00:00 + ip address 172.16.1.254/24 + ! + interface eth1 + ipv6 address fc00:1::10/64 + mac address 42:00:aa:00:00:01 + ip address 172.16.2.253/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {600 264} + labelcoords {600 300} + interface-peer {eth0 n5} + interface-peer {eth1 n4} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + ip addr add 172.16.1.254/24 dev eth0 + ip addr add 172.16.2.253/24 dev eth1 + ip -6 addr add ::1/128 dev lo0 + ip -6 addr add fc00::10/64 dev eth0 + ip -6 addr add fc00:1::10/64 dev eth1 + + iptables -t nat -A PREROUTING -d 10.0.0.20 -j DNAT --to-destination 172.16.2.253 + iptables -t nat -A PREROUTING -d 172.16.2.0/24 -j DNAT --to-destination 172.16.2.253 + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n1 { + type host + network-config { + hostname P2 + ! + interface eth2 + ipv6 address fc00:5::10/64 + mac address 42:00:aa:00:00:04 + ip address 10.0.0.250/8 + ! + interface eth1 + ipv6 address fc00:2::10/64 + mac address 42:00:aa:00:00:03 + ip address 172.16.3.251/24 + ! + interface eth0 + ipv6 address fc00:1::11/64 + mac address 42:00:aa:00:00:02 + ip address 172.16.2.252/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ! + } + canvas c0 + iconcoords {528 504} + labelcoords {528 540} + interface-peer {eth0 n4} + interface-peer {eth1 n3} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + ip addr add 172.16.2.252/24 dev eth0 + ip addr add 172.16.3.251/24 dev eth1 + ip addr add 10.0.0.250/8 dev eth2 + ip -6 addr add ::1/128 dev lo0 + ip -6 addr add fc00:1::11/64 dev eth0 + ip -6 addr add fc00:2::10/64 dev eth1 + ip -6 addr add fc00:4::10/64 dev eth2 + + iptables -t nat -A PREROUTING -s 172.16.1.0/24 -d 10.0.0.20 -j DNAT --to-destination 10.0.0.250 + iptables -t nat -A PREROUTING -d 10.0.0.20 -j DNAT --to-destination 10.0.0.250 + iptables -t nat -A PREROUTING -d 172.16.3.0/24 -j DNAT --to-destination 172.16.3.251 + rpcbind + inetd + + } + } + } + custom-enabled true + interface-peer {eth2 n2} + custom-selected default +} + +node n3 { + type lanswitch + network-config { + hostname S3 + ! + } + canvas c0 + iconcoords {791 362} + labelcoords {791 385} + interface-peer {e0 n1} + interface-peer {e1 n10} + interface-peer {e2 n11} +} + +node n4 { + type lanswitch + network-config { + hostname S2 + ! + } + canvas c0 + iconcoords {302 301} + labelcoords {302 324} + interface-peer {e0 n0} + interface-peer {e1 n1} + interface-peer {e2 n8} + interface-peer {e3 n9} +} + +node n5 { + type lanswitch + network-config { + hostname S1 + ! + } + canvas c0 + iconcoords {370 100} + labelcoords {370 123} + interface-peer {e0 n0} + interface-peer {e1 n7} + interface-peer {e2 n6} +} + +node n6 { + type pc + network-config { + hostname pc1 + ! + interface eth0 + ipv6 address fc00::21/64 + mac address 42:00:aa:00:00:09 + ip address 172.16.1.1/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.1.254 + ! + } + canvas c0 + iconcoords {96 96} + labelcoords {96 127} + interface-peer {eth0 n5} +} + +node n7 { + type pc + network-config { + hostname pc2 + ! + interface eth0 + ipv6 address fc00::20/64 + mac address 42:00:aa:00:00:08 + ip address 172.16.1.2/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.1.254 + ! + } + canvas c0 + iconcoords {99 271} + labelcoords {99 302} + interface-peer {eth0 n5} +} + +node n8 { + type pc + network-config { + hostname pc3 + ! + interface eth0 + ipv6 address fc00:1::20/64 + mac address 42:00:aa:00:00:06 + ip address 172.16.2.1/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.2.252 + ! + } + canvas c0 + iconcoords {96 504} + labelcoords {96 535} + interface-peer {eth0 n4} +} + +node n9 { + type pc + network-config { + hostname pc4 + ! + interface eth0 + ipv6 address fc00:1::21/64 + mac address 42:00:aa:00:00:07 + ip address 172.16.2.2/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.2.252 + ! + } + canvas c0 + iconcoords {265 534} + labelcoords {265 565} + interface-peer {eth0 n4} +} + +node n10 { + type pc + network-config { + hostname pc5 + ! + interface eth0 + ipv6 address fc00:2::20/64 + mac address 42:00:aa:00:00:0a + ip address 172.16.3.1/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {624 96} + labelcoords {624 127} + interface-peer {eth0 n3} +} + +node n11 { + type pc + network-config { + hostname pc6 + ! + interface eth0 + ipv6 address fc00:2::21/64 + mac address 42:00:aa:00:00:0b + ip address 172.16.3.2/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {798 105} + labelcoords {798 136} + interface-peer {eth0 n3} +} + +node n2 { + type lanswitch + network-config { + hostname Wide_Net + ! + } + canvas c0 + iconcoords {720 528} + labelcoords {720 551} + interface-peer {e0 n1} + interface-peer {e1 n12} +} + +node n12 { + type pc + network-config { + hostname pc7 + ! + interface eth0 + ip address 10.0.0.20/8 + ipv6 address fc00:5::20/64 + mac address 42:00:aa:00:00:05 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {840 432} + labelcoords {840 463} + interface-peer {eth0 n2} +} + +link l0 { + nodes {n0 n5} + bandwidth 0 +} + +link l1 { + nodes {n4 n0} + bandwidth 0 +} + +link l2 { + nodes {n4 n1} + bandwidth 0 +} + +link l3 { + nodes {n3 n1} + bandwidth 0 +} + +link l5 { + nodes {n4 n8} + bandwidth 0 +} + +link l6 { + nodes {n9 n4} + bandwidth 0 +} + +link l7 { + nodes {n5 n7} + bandwidth 0 +} + +link l8 { + nodes {n5 n6} + bandwidth 0 +} + +link l9 { + nodes {n3 n10} + bandwidth 0 +} + +link l10 { + nodes {n3 n11} + bandwidth 0 +} + +link l4 { + nodes {n2 n1} + bandwidth 0 +} + +link l11 { + nodes {n12 n2} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses no + node_labels yes + link_labels yes + background_images no + annotations yes + hostsAutoAssign no + grid yes + iconSize normal + zoom 1.0 +} + diff --git a/SCR3.2/TP2/with-routers.imn b/SCR3.2/TP2/with-routers.imn new file mode 100644 index 0000000..49fa01a --- /dev/null +++ b/SCR3.2/TP2/with-routers.imn @@ -0,0 +1,472 @@ +node n0 { + type host + network-config { + hostname GW1 + ! + interface eth0 + ipv6 address fc00::10/64 + mac address 42:00:aa:00:00:00 + ip address 172.16.1.254/24 + ! + interface eth1 + ipv6 address fc00:1::10/64 + mac address 42:00:aa:00:00:01 + ip address 172.16.2.253/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {240 192} + labelcoords {240 228} + interface-peer {eth0 n5} + interface-peer {eth1 n4} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + ip addr add 172.16.1.254/24 dev eth0 + ip addr add 172.16.2.253/24 dev eth1 + ip -6 addr add ::1/128 dev lo0 + ip -6 addr add fc00::10/64 dev eth0 + ip -6 addr add fc00:1::10/64 dev eth1 + + iptables -t nat -A PREROUTING -s 172.16.1.0/24 ! -d 172.16.3.0/24 -j DNAT --to-destination 172.16.2.253 + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n1 { + type host + network-config { + hostname GW2 + ! + interface eth2 + ipv6 address fc00:3::10/64 + mac address 42:00:aa:00:00:04 + ip address 45.45.45.254/21 + ! + interface eth1 + ipv6 address fc00:2::10/64 + mac address 42:00:aa:00:00:03 + ip address 172.16.3.251/24 + ! + interface eth0 + ipv6 address fc00:1::11/64 + mac address 42:00:aa:00:00:02 + ip address 172.16.2.252/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ! + } + canvas c0 + iconcoords {552 240} + labelcoords {552 276} + interface-peer {eth0 n4} + interface-peer {eth1 n3} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + ip addr add 172.16.2.252/24 dev eth0 + ip addr add 172.16.3.251/24 dev eth1 + ip addr add 45.45.45.254/21 dev eth2 + ip -6 addr add ::1/128 dev lo0 + ip -6 addr add fc00:1::11/64 dev eth0 + ip -6 addr add fc00:2::10/64 dev eth1 + ip -6 addr add fc00:3::10/64 dev eth2 + ip route add 0.0.0.0/0 via 45.45.45.253 + + iptables -t nat -A PREROUTING -o eth1 -s 172.16.2.0/24 -j DNAT --to-destination 172.16.3.251 + iptables -t nat -A POSTROUTING -o eth2 -j SNAT --to-source 45.45.45.254 + + rpcbind + inetd + + } + } + } + custom-enabled true + interface-peer {eth2 n9} + custom-selected default +} + +node n3 { + type lanswitch + network-config { + hostname S3 + ! + } + canvas c0 + iconcoords {720 24} + labelcoords {720 47} + interface-peer {e0 n1} + interface-peer {e1 n10} +} + +node n4 { + type lanswitch + network-config { + hostname S2 + ! + } + canvas c0 + iconcoords {480 144} + labelcoords {480 167} + interface-peer {e0 n0} + interface-peer {e1 n1} + interface-peer {e2 n8} +} + +node n5 { + type lanswitch + network-config { + hostname S1 + ! + } + canvas c0 + iconcoords {192 24} + labelcoords {192 47} + interface-peer {e0 n0} + interface-peer {e2 n6} +} + +node n6 { + type pc + network-config { + hostname pc1 + ! + interface eth0 + ipv6 address fc00::21/64 + mac address 42:00:aa:00:00:09 + ip address 172.16.1.1/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.1.254 + ! + } + canvas c0 + iconcoords {48 168} + labelcoords {48 199} + interface-peer {eth0 n5} +} + +node n8 { + type pc + network-config { + hostname pc2 + ! + interface eth0 + ipv6 address fc00:1::20/64 + mac address 42:00:aa:00:00:06 + ip address 172.16.2.2/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.2.252 + ! + } + canvas c0 + iconcoords {240 336} + labelcoords {240 367} + interface-peer {eth0 n4} +} + +node n10 { + type pc + network-config { + hostname pc3 + ! + interface eth0 + ipv6 address fc00:2::20/64 + mac address 42:00:aa:00:00:0a + ip address 172.16.3.3/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {864 216} + labelcoords {864 247} + interface-peer {eth0 n3} +} + +node n2 { + type host + network-config { + hostname host1 + ! + interface eth0 + ipv6 address fc00:3::11/64 + mac address 42:00:aa:00:00:05 + ip address 45.45.45.1/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {720 216} + labelcoords {720 252} + interface-peer {eth0 n9} +} + +node n7 { + type host + network-config { + hostname host2 + ! + interface eth0 + ipv6 address fc00:3::12/64 + mac address 42:00:aa:00:00:07 + ip address 45.45.45.2/21 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {840 384} + labelcoords {840 420} + interface-peer {eth0 n9} +} + +node n9 { + type lanswitch + network-config { + hostname switch1 + ! + } + canvas c0 + iconcoords {600 408} + labelcoords {600 431} + interface-peer {e0 n1} + interface-peer {e1 n2} + interface-peer {e2 n7} + interface-peer {e3 n12} +} + +node n13 { + type pc + network-config { + hostname pc + ! + interface eth0 + ipv6 address fc00:9::20/64 + mac address 42:00:aa:00:00:0d + ip address 37.37.37.1/22 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {48 504} + labelcoords {48 535} + interface-peer {eth0 n11} +} + +node n12 { + type router + model quagga + network-config { + hostname router2 + ! + interface eth1 + ipv6 address fc00:8::1/64 + mac address 42:00:aa:00:00:08 + ip address 62.62.62.253/19 + ! + interface eth0 + ipv6 address fc00:3::1/64 + mac address 42:00:aa:00:00:0c + ip address 45.45.45.253/21 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + router rip + redistribute static + redistribute connected + redistribute ospf + network 0.0.0.0/0 + ! + router ripng + redistribute static + redistribute connected + redistribute ospf6 + network ::/0 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {528 576} + labelcoords {528 601} + interface-peer {eth0 n9} + interface-peer {eth1 n11} +} + +node n11 { + type router + model quagga + network-config { + hostname router3 + ! + interface eth1 + ipv6 address fc00:9::1/64 + mac address 42:00:aa:00:00:0e + ip address 37.37.37.254/22 + ! + interface eth0 + ipv6 address fc00:8::2/64 + mac address 42:00:aa:00:00:0b + ip address 62.62.62.254/19 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + router rip + redistribute static + redistribute connected + redistribute ospf + network 0.0.0.0/0 + ! + router ripng + redistribute static + redistribute connected + redistribute ospf6 + network ::/0 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {312 384} + labelcoords {312 409} + interface-peer {eth0 n12} + interface-peer {eth1 n13} +} + +link l0 { + nodes {n0 n5} + bandwidth 0 +} + +link l1 { + nodes {n4 n0} + bandwidth 0 +} + +link l2 { + nodes {n4 n1} + bandwidth 0 +} + +link l3 { + nodes {n3 n1} + bandwidth 0 +} + +link l5 { + nodes {n4 n8} + bandwidth 0 +} + +link l8 { + nodes {n5 n6} + bandwidth 0 +} + +link l9 { + nodes {n3 n10} + bandwidth 0 +} + +link l4 { + nodes {n9 n1} + bandwidth 0 +} + +link l6 { + nodes {n2 n9} + bandwidth 0 +} + +link l7 { + nodes {n7 n9} + bandwidth 0 +} + +link l11 { + nodes {n9 n12} + bandwidth 0 +} + +link l10 { + nodes {n12 n11} + bandwidth 0 +} + +link l12 { + nodes {n13 n11} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses no + node_labels yes + link_labels yes + background_images no + annotations yes + hostsAutoAssign no + grid yes + iconSize normal + zoom 1.0 +} + diff --git a/SCR3.2/TP2/ŵith-ftp-service.imn b/SCR3.2/TP2/ŵith-ftp-service.imn new file mode 100644 index 0000000..d7ea0b4 --- /dev/null +++ b/SCR3.2/TP2/ŵith-ftp-service.imn @@ -0,0 +1,522 @@ +node n0 { + type host + network-config { + hostname GW1 + ! + interface eth0 + ipv6 address fc00::10/64 + mac address 42:00:aa:00:00:00 + ip address 172.16.1.254/24 + ! + interface eth1 + ipv6 address fc00:1::10/64 + mac address 42:00:aa:00:00:01 + ip address 172.16.2.253/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {240 192} + labelcoords {240 228} + interface-peer {eth0 n5} + interface-peer {eth1 n4} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + ip addr add 172.16.1.254/24 dev eth0 + ip addr add 172.16.2.253/24 dev eth1 + ip -6 addr add ::1/128 dev lo0 + ip -6 addr add fc00::10/64 dev eth0 + ip -6 addr add fc00:1::10/64 dev eth1 + + iptables -t nat -A PREROUTING -s 172.16.1.0/24 ! -d 172.16.3.0/24 -j DNAT --to-destination 172.16.2.253 + iptables -A FORWARD -p tcp --dport 21 -d 172.16.2.10 -j ACCEPT + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n1 { + type host + network-config { + hostname GW2 + ! + interface eth2 + ipv6 address fc00:3::10/64 + mac address 42:00:aa:00:00:04 + ip address 45.45.45.254/21 + ! + interface eth1 + ipv6 address fc00:2::10/64 + mac address 42:00:aa:00:00:03 + ip address 172.16.3.251/24 + ! + interface eth0 + ipv6 address fc00:1::11/64 + mac address 42:00:aa:00:00:02 + ip address 172.16.2.252/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ! + } + canvas c0 + iconcoords {552 240} + labelcoords {552 276} + interface-peer {eth0 n4} + interface-peer {eth1 n3} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + ip addr add 172.16.2.252/24 dev eth0 + ip addr add 172.16.3.251/24 dev eth1 + ip addr add 45.45.45.254/21 dev eth2 + ip -6 addr add ::1/128 dev lo0 + ip -6 addr add fc00:1::11/64 dev eth0 + ip -6 addr add fc00:2::10/64 dev eth1 + ip -6 addr add fc00:3::10/64 dev eth2 + ip route add 0.0.0.0/0 via 45.45.45.253 + + iptables -t nat -A PREROUTING -o eth1 -s 172.16.2.0/24 -j DNAT --to-destination 172.16.3.251 + iptables -t nat -A POSTROUTING -o eth2 -j SNAT --to-source 45.45.45.254 + + rpcbind + inetd + + } + } + } + custom-enabled true + interface-peer {eth2 n9} + custom-selected default +} + +node n3 { + type lanswitch + network-config { + hostname S3 + ! + } + canvas c0 + iconcoords {720 24} + labelcoords {720 47} + interface-peer {e0 n1} + interface-peer {e1 n10} +} + +node n4 { + type lanswitch + network-config { + hostname S2 + ! + } + canvas c0 + iconcoords {480 144} + labelcoords {480 167} + interface-peer {e0 n0} + interface-peer {e1 n1} + interface-peer {e2 n8} + interface-peer {e3 n14} +} + +node n5 { + type lanswitch + network-config { + hostname S1 + ! + } + canvas c0 + iconcoords {192 24} + labelcoords {192 47} + interface-peer {e0 n0} + interface-peer {e2 n6} +} + +node n6 { + type pc + network-config { + hostname pc1 + ! + interface eth0 + ipv6 address fc00::21/64 + mac address 42:00:aa:00:00:09 + ip address 172.16.1.1/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.1.254 + ! + } + canvas c0 + iconcoords {48 168} + labelcoords {48 199} + interface-peer {eth0 n5} +} + +node n8 { + type pc + network-config { + hostname pc2 + ! + interface eth0 + ipv6 address fc00:1::20/64 + mac address 42:00:aa:00:00:06 + ip address 172.16.2.2/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.2.252 + ! + } + canvas c0 + iconcoords {240 336} + labelcoords {240 367} + interface-peer {eth0 n4} +} + +node n10 { + type pc + network-config { + hostname pc3 + ! + interface eth0 + ipv6 address fc00:2::20/64 + mac address 42:00:aa:00:00:0a + ip address 172.16.3.3/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {864 216} + labelcoords {864 247} + interface-peer {eth0 n3} +} + +node n2 { + type host + network-config { + hostname host1 + ! + interface eth0 + ipv6 address fc00:3::11/64 + mac address 42:00:aa:00:00:05 + ip address 45.45.45.1/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {720 216} + labelcoords {720 252} + interface-peer {eth0 n9} +} + +node n7 { + type host + network-config { + hostname host2 + ! + interface eth0 + ipv6 address fc00:3::12/64 + mac address 42:00:aa:00:00:07 + ip address 45.45.45.2/21 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {840 384} + labelcoords {840 420} + interface-peer {eth0 n9} +} + +node n9 { + type lanswitch + network-config { + hostname switch1 + ! + } + canvas c0 + iconcoords {600 408} + labelcoords {600 431} + interface-peer {e0 n1} + interface-peer {e1 n2} + interface-peer {e2 n7} + interface-peer {e3 n12} +} + +node n13 { + type pc + network-config { + hostname pc + ! + interface eth0 + ipv6 address fc00:9::20/64 + mac address 42:00:aa:00:00:0d + ip address 37.37.37.1/22 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {48 504} + labelcoords {48 535} + interface-peer {eth0 n11} +} + +node n12 { + type router + model quagga + network-config { + hostname router2 + ! + interface eth1 + ipv6 address fc00:8::1/64 + mac address 42:00:aa:00:00:08 + ip address 62.62.62.253/19 + ! + interface eth0 + ipv6 address fc00:3::1/64 + mac address 42:00:aa:00:00:0c + ip address 45.45.45.253/21 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + router rip + redistribute static + redistribute connected + redistribute ospf + network 0.0.0.0/0 + ! + router ripng + redistribute static + redistribute connected + redistribute ospf6 + network ::/0 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {528 576} + labelcoords {528 601} + interface-peer {eth0 n9} + interface-peer {eth1 n11} +} + +node n11 { + type router + model quagga + network-config { + hostname router3 + ! + interface eth1 + ipv6 address fc00:9::1/64 + mac address 42:00:aa:00:00:0e + ip address 37.37.37.254/22 + ! + interface eth0 + ipv6 address fc00:8::2/64 + mac address 42:00:aa:00:00:0b + ip address 62.62.62.254/19 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + router rip + redistribute static + redistribute connected + redistribute ospf + network 0.0.0.0/0 + ! + router ripng + redistribute static + redistribute connected + redistribute ospf6 + network ::/0 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {312 384} + labelcoords {312 409} + interface-peer {eth0 n12} + interface-peer {eth1 n13} +} + +node n14 { + type host + network-config { + hostname ftp + ! + interface eth0 + ip address 172.16.2.10/24 + ipv6 address fc00:1::12/64 + mac address 42:00:aa:00:00:0f + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {312 48} + labelcoords {312 84} + interface-peer {eth0 n4} + services {ftp} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + ip addr add 172.16.2.10/24 dev eth0 + ip -6 addr add ::1/128 dev lo0 + ip -6 addr add fc00:1::12/64 dev eth0 + iptables -A INPUT -j ACCEPT + + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +link l0 { + nodes {n0 n5} + bandwidth 0 +} + +link l1 { + nodes {n4 n0} + bandwidth 0 +} + +link l2 { + nodes {n4 n1} + bandwidth 0 +} + +link l3 { + nodes {n3 n1} + bandwidth 0 +} + +link l5 { + nodes {n4 n8} + bandwidth 0 +} + +link l8 { + nodes {n5 n6} + bandwidth 0 +} + +link l9 { + nodes {n3 n10} + bandwidth 0 +} + +link l4 { + nodes {n9 n1} + bandwidth 0 +} + +link l6 { + nodes {n2 n9} + bandwidth 0 +} + +link l7 { + nodes {n7 n9} + bandwidth 0 +} + +link l11 { + nodes {n9 n12} + bandwidth 0 +} + +link l10 { + nodes {n12 n11} + bandwidth 0 +} + +link l12 { + nodes {n13 n11} + bandwidth 0 +} + +link l13 { + nodes {n4 n14} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses no + node_labels yes + link_labels yes + background_images no + annotations yes + hostsAutoAssign no + grid yes + iconSize normal + zoom 1.0 +} + diff --git a/SCR3.2/TP3/DHCP-dhcpd.conf b/SCR3.2/TP3/DHCP-dhcpd.conf new file mode 100644 index 0000000..4ae2d0f --- /dev/null +++ b/SCR3.2/TP3/DHCP-dhcpd.conf @@ -0,0 +1,67 @@ + + +# Sample configuration file for ISC dhcpd +# + + +# This is a very basic subnet declaration. + +#subnet 10.254.239.0 netmask 255.255.255.224 { +# range 10.254.239.10 10.254.239.20; +# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; +#} + +option rfc3442-classless-static-route code 121 = array of integer 8; +subnet 192.168.0.0 netmask 255.255.240.0 { + range 192.168.10.20 192.168.10.40 ; + #option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; + option rfc3442-classless-static-route 24, 172, 16, 2, 0, 192, 168, 10, 254; +} + +option rfc3442-classless-static-route code 121 = array of integer 8; +subnet 172.16.2.0 netmask 255.255.255.0 { + range 172.16.2.1 172.16.2.253 + option rfc3442-classless-static-route 20, 192, 168, 0, 172, 16, 2, 254; +} +# This declaration allows BOOTP clients to get dynamic addresses, +# which we don't really recommend. + +#subnet 10.254.239.32 netmask 255.255.255.224 { +# range dynamic-bootp 10.254.239.40 10.254.239.60; +# option broadcast-address 10.254.239.31; +# option routers rtr-239-32-1.example.org; +#} + +# A slightly different configuration for an internal subnet. +#subnet 10.5.5.0 netmask 255.255.255.224 { +# range 10.5.5.26 10.5.5.30; +# option domain-name-servers ns1.internal.example.org; +# option domain-name "internal.example.org"; +# option routers 10.5.5.1; +# option broadcast-address 10.5.5.31; +# default-lease-time 600; +# max-lease-time 7200; +#} + +# Hosts which require special configuration options can be listed in +# host statements. If no address is specified, the address will be +# allocated dynamically (if possible), but the host-specific information +# will still come from the host declaration. + +host GW { + hardware ethernet 42:00:aa:00:00:04; + fixed-address 172.16.2.254; +} + +# Fixed IP addresses can also be specified for hosts. These addresses +# should not also be listed as being available for dynamic assignment. +# Hosts for which fixed IP addresses have been specified can boot using +# BOOTP or DHCP. Hosts for which no fixed address is specified can only +# be booted with DHCP, unless there is an address range on the subnet +# to which a BOOTP client is connected which has the dynamic-bootp flag +# set. +host GW { + hardware ethernet 42:00:aa:00:00:03; + fixed-address 192.168.10.254; +} + diff --git a/SCR3.2/TP3/DHCPsrv--dhcpd.conf b/SCR3.2/TP3/DHCPsrv--dhcpd.conf new file mode 100644 index 0000000..c41b593 --- /dev/null +++ b/SCR3.2/TP3/DHCPsrv--dhcpd.conf @@ -0,0 +1,67 @@ + + +# Sample configuration file for ISC dhcpd +# + + +# This is a very basic subnet declaration. + +#subnet 10.254.239.0 netmask 255.255.255.224 { +# range 10.254.239.10 10.254.239.20; +# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; +#} + +option rfc3442-classless-static-route code 121 = array of integer 8; +subnet 192.168.0.0 netmask 255.255.240.0 { + range 192.168.10.20 192.168.10.40; + #option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; + option rfc3442-classless-static-route 24, 172, 16, 2, 0, 192, 168, 10, 254; +} + +option rfc3442-classless-static-route code 121 = array of integer 8; +subnet 172.16.2.0 netmask 255.255.255.0 { + range 172.16.2.1 172.16.2.253; + option rfc3442-classless-static-route 20, 192, 168, 0, 172, 16, 2, 254; +} +# This declaration allows BOOTP clients to get dynamic addresses, +# which we don't really recommend. + +#subnet 10.254.239.32 netmask 255.255.255.224 { +# range dynamic-bootp 10.254.239.40 10.254.239.60; +# option broadcast-address 10.254.239.31; +# option routers rtr-239-32-1.example.org; +#} + +# A slightly different configuration for an internal subnet. +#subnet 10.5.5.0 netmask 255.255.255.224 { +# range 10.5.5.26 10.5.5.30; +# option domain-name-servers ns1.internal.example.org; +# option domain-name "internal.example.org"; +# option routers 10.5.5.1; +# option broadcast-address 10.5.5.31; +# default-lease-time 600; +# max-lease-time 7200; +#} + +# Hosts which require special configuration options can be listed in +# host statements. If no address is specified, the address will be +# allocated dynamically (if possible), but the host-specific information +# will still come from the host declaration. + +host GW1 { + hardware ethernet 42:00:aa:00:00:04; + fixed-address 172.16.2.254; +} + +# Fixed IP addresses can also be specified for hosts. These addresses +# should not also be listed as being available for dynamic assignment. +# Hosts for which fixed IP addresses have been specified can boot using +# BOOTP or DHCP. Hosts for which no fixed address is specified can only +# be booted with DHCP, unless there is an address range on the subnet +# to which a BOOTP client is connected which has the dynamic-bootp flag +# set. +host GW2 { + hardware ethernet 42:00:aa:00:00:03; + fixed-address 192.168.10.254; +} + diff --git a/SCR3.2/TP3/GH-dhcpd.conf b/SCR3.2/TP3/GH-dhcpd.conf new file mode 100644 index 0000000..7c6eeea --- /dev/null +++ b/SCR3.2/TP3/GH-dhcpd.conf @@ -0,0 +1,107 @@ +# dhcpd.conf +# +# Sample configuration file for ISC dhcpd +# + +# option definitions common to all supported networks... +option domain-name "example.org"; +option domain-name-servers ns1.example.org, ns2.example.org; + +default-lease-time 600; +max-lease-time 7200; + +# The ddns-updates-style parameter controls whether or not the server will +# attempt to do a DNS update when a lease is confirmed. We default to the +# behavior of the version 2 packages ('none', since DHCP v2 didn't +# have support for DDNS.) +ddns-update-style none; + +# If this DHCP server is the official DHCP server for the local +# network, the authoritative directive should be uncommented. +#authoritative; + +# Use this to send dhcp log messages to a different log file (you also +# have to hack syslog.conf to complete the redirection). +#log-facility local7; + +# No service will be given on this subnet, but declaring it helps the +# DHCP server to understand the network topology. + +#subnet 10.152.187.0 netmask 255.255.255.0 { +#} + +# This is a very basic subnet declaration. + +#subnet 10.254.239.0 netmask 255.255.255.224 { +# range 10.254.239.10 10.254.239.20; +# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; +#} + +# This declaration allows BOOTP clients to get dynamic addresses, +# which we don't really recommend. + +#subnet 10.254.239.32 netmask 255.255.255.224 { +# range dynamic-bootp 10.254.239.40 10.254.239.60; +# option broadcast-address 10.254.239.31; +# option routers rtr-239-32-1.example.org; +#} + +# A slightly different configuration for an internal subnet. +#subnet 10.5.5.0 netmask 255.255.255.224 { +# range 10.5.5.26 10.5.5.30; +# option domain-name-servers ns1.internal.example.org; +# option domain-name "internal.example.org"; +# option routers 10.5.5.1; +# option broadcast-address 10.5.5.31; +# default-lease-time 600; +# max-lease-time 7200; +#} + +# Hosts which require special configuration options can be listed in +# host statements. If no address is specified, the address will be +# allocated dynamically (if possible), but the host-specific information +# will still come from the host declaration. + +#host passacaglia { +# hardware ethernet 0:0:c0:5d:bd:95; +# filename "vmunix.passacaglia"; +# server-name "toccata.example.com"; +#} + +# Fixed IP addresses can also be specified for hosts. These addresses +# should not also be listed as being available for dynamic assignment. +# Hosts for which fixed IP addresses have been specified can boot using +# BOOTP or DHCP. Hosts for which no fixed address is specified can only +# be booted with DHCP, unless there is an address range on the subnet +# to which a BOOTP client is connected which has the dynamic-bootp flag +# set. +#host fantasia { +# hardware ethernet 08:00:07:26:c0:a5; +# fixed-address fantasia.example.com; +#} + +# You can declare a class of clients and then do address allocation +# based on that. The example below shows a case where all clients +# in a certain class get addresses on the 10.17.224/24 subnet, and all +# other clients get addresses on the 10.0.29/24 subnet. + +#class "foo" { +# match if substring (option vendor-class-identifier, 0, 4) = "SUNW"; +#} + +#shared-network 224-29 { +# subnet 10.17.224.0 netmask 255.255.255.0 { +# option routers rtr-224.example.org; +# } +# subnet 10.0.29.0 netmask 255.255.255.0 { +# option routers rtr-29.example.org; +# } +# pool { +# allow members of "foo"; +# range 10.17.224.10 10.17.224.250; +# } +# pool { +# deny members of "foo"; +# range 10.0.29.10 10.0.29.230; +# } +#} diff --git a/SCR3.2/TP3/GW-dhcpd.conf b/SCR3.2/TP3/GW-dhcpd.conf new file mode 100644 index 0000000..069bffa --- /dev/null +++ b/SCR3.2/TP3/GW-dhcpd.conf @@ -0,0 +1,105 @@ +# dhcpd.conf +# +# Sample configuration file for ISC dhcpd +# + +# option definitions common to all supported networks... +option domain-name "example.org"; +option domain-name-servers ns1.example.org, ns2.example.org; + +default-lease-time 600; +max-lease-time 7200; + +# The ddns-updates-style parameter controls whether or not the server will +# attempt to do a DNS update when a lease is confirmed. We default to the +# behavior of the version 2 packages ('none', since DHCP v2 didn't +# have support for DDNS.) +ddns-update-style none; + +# If this DHCP server is the official DHCP server for the local +# network, the authoritative directive should be uncommented. +#authoritative; + +# Use this to send dhcp log messages to a different log file (you also +# have to hack syslog.conf to complete the redirection). +#log-facility local7; + +# No service will be given on this subnet, but declaring it helps the +# DHCP server to understand the network topology. + +#subnet 10.152.187.0 netmask 255.255.255.0 { +#} + +# This is a very basic subnet declaration. + +subnet 172.16.2.0 netmask 255.255.255.0 { + range 172.16.2.1 172.16.2.253; + option rfc3442-classless-static-route 24,172,16,2,172,16,2,254; +} + +# This declaration allows BOOTP clients to get dynamic addresses, +# which we don't really recommend. + +#subnet 10.254.239.32 netmask 255.255.255.224 { +# range dynamic-bootp 10.254.239.40 10.254.239.60; +# option broadcast-address 10.254.239.31; +# option routers rtr-239-32-1.example.org; +#} + +# A slightly different configuration for an internal subnet. +#subnet 10.5.5.0 netmask 255.255.255.224 { +# range 10.5.5.26 10.5.5.30; +# option domain-name-servers ns1.internal.example.org; +# option domain-name "internal.example.org"; +# option routers 10.5.5.1; +# option broadcast-address 10.5.5.31; +# default-lease-time 600; +# max-lease-time 7200; +#} + +# Hosts which require special configuration options can be listed in +# host statements. If no address is specified, the address will be +# allocated dynamically (if possible), but the host-specific information +# will still come from the host declaration. + +host GW { + hardware ethernet 42:00:aa:00:00:04; + fixed-address 172.16.2.254 +} +# Fixed IP addresses can also be specified for hosts. These addresses +# should not also be listed as being available for dynamic assignment. +# Hosts for which fixed IP addresses have been specified can boot using +# BOOTP or DHCP. Hosts for which no fixed address is specified can only +# be booted with DHCP, unless there is an address range on the subnet +# to which a BOOTP client is connected which has the dynamic-bootp flag +# set. +#host fantasia { +# hardware ethernet 08:00:07:26:c0:a5; +# fixed-address fantasia.example.com; +#} + +# You can declare a class of clients and then do address allocation +# based on that. The example below shows a case where all clients +# in a certain class get addresses on the 10.17.224/24 subnet, and all +# other clients get addresses on the 10.0.29/24 subnet. + +#class "foo" { +# match if substring (option vendor-class-identifier, 0, 4) = "SUNW"; +#} + +#shared-network 224-29 { +# subnet 10.17.224.0 netmask 255.255.255.0 { +# option routers rtr-224.example.org; +# } +# subnet 10.0.29.0 netmask 255.255.255.0 { +# option routers rtr-29.example.org; +# } +# pool { +# allow members of "foo"; +# range 10.17.224.10 10.17.224.250; +# } +# pool { +# deny members of "foo"; +# range 10.0.29.10 10.0.29.230; +# } +#}