diff --git a/SCR2.2/TP21/Reponses.txt b/SCR2.2/TP21/Reponses.txt new file mode 100644 index 0000000..396bcdf --- /dev/null +++ b/SCR2.2/TP21/Reponses.txt @@ -0,0 +1,31 @@ +PC3: +10.32.0.0/17 10.16.0.254 + +PC4: +10.16.0.0/17 10.32.0.254 +10.48.0.0/17 10.32.0.255 + +PC6-5: +0.0.0.0/0 10.48.0.6 +10.16.0.0/17 10.48.0.255 + +PC5: +0.0.0.0/0 10.48.0.254 + +PC6: +0.0.0.0/0 10.64.0.254 +10.16.0.0/17 10.64.0.254 + +PC7: +0.0.0.0/0 10.80.0.255 +10.64.0.0/17 10.80.0.254 + +PC8: +0.0.0.0/0 10.80.0.255 +10.64.0.0/17 10.80.0.254 + +Host2 +0.0.0.0/0 102.103.104.254 + +Host3 +0.0.0.0/0 202.203.204.254 diff --git a/SCR3.1/TP4/Exo1/parexec.c b/SCR3.1/TP4/Exo1/parexec.c new file mode 100644 index 0000000..c09fc06 --- /dev/null +++ b/SCR3.1/TP4/Exo1/parexec.c @@ -0,0 +1,17 @@ +#include +#include +#include + +int main(int argc, char** argv) { + int nb = argc-2; + pid_t pid; + + for (int i=1 ; i<= nb ; i++){ + pid = fork(); + if (pid==0){ + printf("processus : %d\n", getpid()); + execl(argv[1], argv[1+i]); + } + } + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/SCR3.1/TP4/Exo1/rebours b/SCR3.1/TP4/Exo1/rebours new file mode 100755 index 0000000..9f99ce1 Binary files /dev/null and b/SCR3.1/TP4/Exo1/rebours differ diff --git a/SCR3.1/TP4/Exo1/rebours.c b/SCR3.1/TP4/Exo1/rebours.c new file mode 100644 index 0000000..93e9a2c --- /dev/null +++ b/SCR3.1/TP4/Exo1/rebours.c @@ -0,0 +1,17 @@ +#include +#include +#include + +int main(int argc, char** argv) +{ + int cpt = (int)strtol(argv[1],NULL,0); + printf("%d : debut\n", getpid()); + + for (cpt ; cpt>=1; cpt--) + { + printf("%d : %d\n", getpid(), cpt); + sleep(1); + } + printf("%d : fin\n", getpid()); + return EXIT_SUCCESS; +} diff --git a/SCR3.1/TP4/Exo2/montecarlo.c b/SCR3.1/TP4/Exo2/montecarlo.c new file mode 100644 index 0000000..9ae4952 --- /dev/null +++ b/SCR3.1/TP4/Exo2/montecarlo.c @@ -0,0 +1,18 @@ +uint64_t shots_in=0,shots=0; +double x,y; + +int main(int argc, char **argv) +{ + shots_in = 0; + shots = 0; + for (;;){ + x = rand()/(RAND_MAX*1.0); + y = rand()/(RAND_MAX*1.0); + shots ++; + if ((x*x+y*y)<=1){ + shots_in ++; + } + } + /* la probabilité vaut tirsIn/tirs, + Elle converge lentement vers pi/4*/ +} diff --git a/SCR3.2/TP00.1/tp03.SCR.3.2.pdf b/SCR3.2/TP00.1/tp03.SCR.3.2.pdf new file mode 100644 index 0000000..05c86d2 Binary files /dev/null and b/SCR3.2/TP00.1/tp03.SCR.3.2.pdf differ diff --git a/SCR3.2/TP00/tp00.SCR.3.2.imn b/SCR3.2/TP00/tp00.SCR.3.2.imn new file mode 100644 index 0000000..0d2346e --- /dev/null +++ b/SCR3.2/TP00/tp00.SCR.3.2.imn @@ -0,0 +1,671 @@ +node n2 { + type lanswitch + network-config { + hostname switch3 + ! + } + canvas c0 + iconcoords {96 528} + labelcoords {97 556} + interface-peer {e0 n10} + interface-peer {e1 n19} + interface-peer {e2 n0} +} + +node n3 { + type lanswitch + network-config { + hostname switch4 + ! + } + canvas c0 + iconcoords {120 72} + labelcoords {75 55} + interface-peer {e0 n10} + interface-peer {e1 n11} + interface-peer {e2 n20} +} + +node n4 { + type lanswitch + network-config { + hostname switch5 + ! + } + canvas c0 + iconcoords {360 288} + labelcoords {341 309} + interface-peer {e0 n9} + interface-peer {e1 n11} + interface-peer {e2 n21} + interface-peer {e3 n1} +} + +node n5 { + type lanswitch + network-config { + hostname switch6 + ! + } + canvas c0 + iconcoords {816 48} + labelcoords {765 27} + interface-peer {e0 n9} + interface-peer {e1 n22} +} + +node n6 { + type lanswitch + network-config { + hostname switch7 + ! + } + canvas c0 + iconcoords {816 264} + labelcoords {810 232} + interface-peer {e0 n9} + interface-peer {e1 n12} + interface-peer {e2 n23} + interface-peer {e3 n8} +} + +node n7 { + type lanswitch + network-config { + hostname switch8 + ! + } + canvas c0 + iconcoords {528 312} + labelcoords {513 289} + interface-peer {e0 n12} + interface-peer {e1 n13} + interface-peer {e2 n14} +} + +node n9 { + type host + network-config { + hostname P5 + ! + interface eth3 + mac address 42:00:aa:00:00:09 + ip address 10.80.0.254/17 + ! + interface eth2 + mac address 42:00:aa:00:00:04 + ip address 10.64.0.254/17 + ! + interface eth1 + mac address 42:00:aa:00:00:03 + ip address 10.48.0.254/17 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {576 96} + labelcoords {543 52} + interface-peer {eth1 n4} + interface-peer {eth2 n5} + interface-peer {eth3 n6} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + + ip addr add 10.48.0.254/17 dev eth1 + ip addr add 10.64.0.254/17 dev eth2 + ip addr add 10.80.0.254/17 dev eth3 + ip -6 addr add ::1/128 dev lo0 + + ip route add 10.16.0.0/17 via 10.48.0.255 + ip route add 0.0.0.0/0 via 10.80.0.255 + + iptables -t nat -A POSTROUTING -o eth3 -s 10.48.0.0/17 -j SNAT --to-source 10.80.0.254 + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n10 { + type host + network-config { + hostname P3 + ! + interface eth1 + mac address 42:00:aa:00:00:06 + ip address 10.32.0.254/17 + ! + interface eth0 + mac address 42:00:aa:00:00:05 + ip address 10.16.0.254/17 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {240 288} + labelcoords {246 328} + interface-peer {eth0 n2} + interface-peer {eth1 n3} +} + +node n11 { + type host + network-config { + hostname P4 + ! + interface eth1 + mac address 42:00:aa:00:00:08 + ip address 10.48.0.255/17 + ! + interface eth0 + mac address 42:00:aa:00:00:07 + ip address 10.32.0.255/17 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {312 96} + labelcoords {319 52} + interface-peer {eth0 n3} + 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 10.32.0.255/17 dev eth0 + ip addr add 10.48.0.255/17 dev eth1 + ip -6 addr add ::1/128 dev lo0 + + ip route add 0.0.0.0/0 via 10.48.0.254 + ip route add 10.16.0.0/17 via 10.32.0.254 + + iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 10.32.0.255 + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 10.48.0.255 + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n12 { + type host + network-config { + hostname P6 + ! + interface eth0 + mac address 42:00:aa:00:00:0a + ip address 10.80.0.255/17 + ! + interface eth1 + mac address 42:00:aa:00:00:0b + ip address 102.103.104.255/15 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ! + } + canvas c0 + iconcoords {792 456} + labelcoords {751 479} + interface-peer {eth0 n6} + interface-peer {eth1 n7} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + ip addr add 10.80.0.255/17 dev eth0 + ip addr add 102.103.104.255/15 dev eth1 + ip -6 addr add ::1/128 dev lo0 + + ip route add 10.64.0.0/17 via 10.80.0.254 + ip route add 0.0.0.0/0 via 102.103.104.254 + + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 102.103.104.255 + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n13 { + type router + model quagga + network-config { + hostname router1 + ! + interface eth1 + mac address 42:00:aa:00:00:0e + ip address 202.203.204.254/11 + ! + interface eth0 + mac address 42:00:aa:00:00:0c + ip address 102.103.104.254/15 + ! + 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 + ! + } + canvas c0 + iconcoords {792 576} + labelcoords {792 601} + interface-peer {eth0 n7} + interface-peer {eth1 n15} +} + +node n14 { + type host + network-config { + hostname host2 + ! + interface eth0 + mac address 42:00:aa:00:00:0d + ip address 102.103.104.104/15 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ip route 0.0.0.0/0 102.103.104.254 + ! + } + canvas c0 + iconcoords {384 456} + labelcoords {369 415} + interface-peer {eth0 n7} +} + +node n15 { + type host + network-config { + hostname host3 + ! + interface eth0 + mac address 42:00:aa:00:00:0f + ip address 202.203.204.204/11 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ! + ip route 0.0.0.0/0 202.203.204.254 + ! + } + canvas c0 + iconcoords {408 552} + labelcoords {408 588} + interface-peer {eth0 n13} +} + +node n19 { + type pc + network-config { + hostname pc3 + ! + interface eth0 + mac address 42:00:aa:00:00:13 + ip address 10.16.0.3/17 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ip route 10.32.0.0/17 10.16.0.254 + ! + } + canvas c0 + iconcoords {264 432} + labelcoords {264 463} + interface-peer {eth0 n2} +} + +node n20 { + type pc + network-config { + hostname pc4 + ! + interface eth0 + mac address 42:00:aa:00:00:14 + ip address 10.32.0.4/17 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ip route 10.16.0.0/17 10.32.0.254 + ip route 10.48.0.0/17 10.32.0.255 + ! + } + canvas c0 + iconcoords {48 264} + labelcoords {48 295} + interface-peer {eth0 n3} +} + +node n21 { + type pc + network-config { + hostname pc5 + ! + interface eth0 + mac address 42:00:aa:00:00:15 + ip address 10.48.0.5/17 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ip route 0.0.0.0/0 10.48.0.254 + ! + } + canvas c0 + iconcoords {528 216} + labelcoords {528 247} + interface-peer {eth0 n4} +} + +node n22 { + type pc + network-config { + hostname pc6 + ! + interface eth0 + mac address 42:00:aa:00:00:16 + ip address 10.64.0.6/17 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ip route 0.0.0.0/0 10.64.0.254 + ip route 10.16.0.0/17 10.64.0.254 + ! + } + canvas c0 + iconcoords {768 144} + labelcoords {768 175} + interface-peer {eth0 n5} +} + +node n23 { + type pc + network-config { + hostname pc7 + ! + interface eth0 + mac address 42:00:aa:00:00:17 + ip address 10.80.0.7/17 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ip route 0.0.0.0/0 10.80.0.255 + ip route 10.64.0.0/17 10.80.0.254 + ! + } + canvas c0 + iconcoords {624 216} + labelcoords {624 247} + interface-peer {eth0 n6} +} + +node n0 { + type host + network-config { + hostname host1 + ! + interface eth0 + mac address 42:00:aa:00:00:00 + ip address 10.16.0.200/17 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {48 360} + labelcoords {31 327} + interface-peer {eth0 n2} +} + +node n1 { + type pc + network-config { + hostname pc6-5 + ! + interface eth0 + mac address 42:00:aa:00:00:01 + ip address 10.48.0.6/17 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 10.48.0.6 + ip route 10.16.0.0/17 10.48.0.255 + ! + } + canvas c0 + iconcoords {456 72} + labelcoords {429 41} + interface-peer {eth0 n4} +} + +node n8 { + type pc + network-config { + hostname pc8 + ! + interface eth0 + mac address 42:00:aa:00:00:02 + ip address 10.80.0.8/17 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 10.80.0.255 + ip route 10.64.0.0/17 10.80.0.254 + ! + } + canvas c0 + iconcoords {648 288} + labelcoords {648 319} + interface-peer {eth0 n6} +} + +link l3 { + nodes {n9 n4} + bandwidth 0 +} + +link l4 { + nodes {n5 n9} + bandwidth 0 +} + +link l5 { + nodes {n10 n2} + bandwidth 0 +} + +link l6 { + nodes {n3 n10} + bandwidth 0 +} + +link l7 { + nodes {n11 n3} + bandwidth 0 +} + +link l8 { + nodes {n4 n11} + bandwidth 0 +} + +link l9 { + nodes {n6 n9} + bandwidth 0 +} + +link l10 { + nodes {n6 n12} + bandwidth 0 +} + +link l11 { + nodes {n7 n12} + bandwidth 0 +} + +link l12 { + nodes {n13 n7} + bandwidth 0 +} + +link l13 { + nodes {n7 n14} + bandwidth 0 +} + +link l14 { + nodes {n15 n13} + bandwidth 0 +} + +link l18 { + nodes {n19 n2} + bandwidth 0 +} + +link l19 { + nodes {n20 n3} + bandwidth 0 +} + +link l20 { + nodes {n4 n21} + bandwidth 0 +} + +link l21 { + nodes {n5 n22} + bandwidth 0 +} + +link l22 { + nodes {n6 n23} + bandwidth 0 +} + +link l0 { + nodes {n2 n0} + bandwidth 0 +} + +link l1 { + nodes {n1 n4} + bandwidth 0 +} + +link l2 { + nodes {n6 n8} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +canvas c1 { + name {Canvas1} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses yes + 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/TP00/tp00.SCR.3.2.pdf b/SCR3.2/TP00/tp00.SCR.3.2.pdf new file mode 100644 index 0000000..0f33157 Binary files /dev/null and b/SCR3.2/TP00/tp00.SCR.3.2.pdf differ diff --git a/SCR3.2/TP01/one-gateway.imn b/SCR3.2/TP01/one-gateway.imn new file mode 100644 index 0000000..65799eb --- /dev/null +++ b/SCR3.2/TP01/one-gateway.imn @@ -0,0 +1,213 @@ +node n0 { + type host + network-config { + hostname GW + ! + interface eth1 + mac address 42:00:aa:00:00:03 + ip address 172.16.2.254/24 + ! + interface eth0 + mac address 42:00:aa:00:00:00 + 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 {408 216} + labelcoords {408 252} + interface-peer {eth0 n5} + interface-peer {eth1 n6} + 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 + + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 172.16.2.254 + + rpcbind + inetd + + } + } + } + custom-selected default + custom-enabled true +} + +node n1 { + type pc + network-config { + hostname pc1-1 + ! + interface eth0 + mac address 42:00:aa:00:00:01 + ip address 172.16.1.1/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 172.16.2.0/24 172.16.1.254 + ! + } + canvas c0 + iconcoords {120 120} + labelcoords {120 151} + interface-peer {eth0 n5} +} + +node n2 { + type pc + network-config { + hostname pc1-2 + ! + interface eth0 + mac address 42:00:aa:00:00:02 + ip address 172.16.1.2/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 172.16.2.0/24 172.16.1.254 + ! + } + canvas c0 + iconcoords {120 312} + labelcoords {120 343} + interface-peer {eth0 n5} +} + +node n3 { + type pc + network-config { + hostname pc2-1 + ! + interface eth0 + 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 {696 120} + labelcoords {696 151} + interface-peer {eth0 n6} +} + +node n4 { + type pc + network-config { + hostname pc2-2 + ! + interface eth0 + mac address 42:00:aa:00:00:05 + ip address 172.16.2.2/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ! + } + canvas c0 + iconcoords {696 312} + labelcoords {696 343} + interface-peer {eth0 n6} +} + +node n5 { + type lanswitch + network-config { + hostname switch1 + ! + } + canvas c0 + iconcoords {216 216} + labelcoords {216 239} + interface-peer {e0 n0} + interface-peer {e1 n1} + interface-peer {e2 n2} +} + +node n6 { + type lanswitch + network-config { + hostname switch2 + ! + } + canvas c0 + iconcoords {600 216} + labelcoords {600 239} + interface-peer {e0 n0} + interface-peer {e1 n3} + interface-peer {e2 n4} +} + +link l0 { + nodes {n5 n0} + bandwidth 0 +} + +link l1 { + nodes {n1 n5} + bandwidth 0 +} + +link l2 { + nodes {n2 n5} + bandwidth 0 +} + +link l3 { + nodes {n6 n0} + bandwidth 0 +} + +link l4 { + nodes {n3 n6} + bandwidth 0 +} + +link l5 { + nodes {n4 n6} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses yes + 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/TP01/tp01.SCR.3.2.pdf b/SCR3.2/TP01/tp01.SCR.3.2.pdf new file mode 100644 index 0000000..962df38 Binary files /dev/null and b/SCR3.2/TP01/tp01.SCR.3.2.pdf differ diff --git a/SCR3.2/TP01/two-gateways.imn b/SCR3.2/TP01/two-gateways.imn new file mode 100644 index 0000000..5c3f95c --- /dev/null +++ b/SCR3.2/TP01/two-gateways.imn @@ -0,0 +1,330 @@ +node n3 { + type pc + network-config { + hostname A + ! + interface eth0 + mac address 42:00:aa:00:00:02 + 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 {72 120} + labelcoords {72 151} + interface-peer {eth0 n4} +} + +node n4 { + type lanswitch + network-config { + hostname switch2 + ! + } + canvas c0 + iconcoords {264 120} + labelcoords {264 143} + interface-peer {e0 n3} + interface-peer {e1 n0} +} + +node n0 { + type host + network-config { + hostname P1 + ! + interface eth1 + mac address 42:00:aa:00:00:01 + ip address 172.16.2.253/24 + ! + interface eth0 + mac address 42:00:aa:00:00:00 + 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 {264 264} + labelcoords {264 300} + interface-peer {eth0 n4} + 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.253/24 dev eth1 + ip -6 addr add ::1/128 dev lo0 + + ip route add 0.0.0.0/0 via 172.16.2.252 + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 172.16.2.253 + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n1 { + type lanswitch + network-config { + hostname switch3 + ! + } + canvas c0 + iconcoords {264 408} + labelcoords {264 431} + interface-peer {e0 n0} + interface-peer {e1 n2} + interface-peer {e2 n5} +} + +node n2 { + type pc + network-config { + hostname B + ! + interface eth0 + mac address 42:00:aa:00:00:03 + 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 {72 408} + labelcoords {72 439} + interface-peer {eth0 n1} +} + +node n5 { + type host + network-config { + hostname P2 + ! + interface eth2 + mac address 42:00:aa:00:00:07 + ip address 10.0.0.250/8 + ! + interface eth1 + mac address 42:00:aa:00:00:06 + ip address 172.16.3.251/24 + ! + interface eth0 + mac address 42:00:aa:00:00:04 + 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 {456 408} + labelcoords {456 444} + interface-peer {eth0 n1} + interface-peer {eth1 n7} + 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/24 dev eth2 + ip -6 addr add ::1/128 dev lo0 + + iptables -t filter -A FORWARD -s 172.16.2.253 -d 172.16.3.1 -j DROP + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 172.16.3.251 + iptables -t nat -A POSTROUTING -o eth2 -j SNAT --to-source 10.0.0.250 + + rpcbind + inetd + + } + } + } + custom-enabled true + interface-peer {eth2 n6} + custom-selected default +} + +node n7 { + type lanswitch + network-config { + hostname switch4 + ! + } + canvas c0 + iconcoords {456 264} + labelcoords {456 287} + interface-peer {e0 n8} + interface-peer {e1 n5} +} + +node n8 { + type pc + network-config { + hostname C + ! + interface eth0 + mac address 42:00:aa:00:00:05 + 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 {456 120} + labelcoords {456 151} + interface-peer {eth0 n7} +} + +node n6 { + type lanswitch + network-config { + hostname switch5 + ! + } + canvas c0 + iconcoords {648 408} + labelcoords {648 431} + interface-peer {e0 n5} + interface-peer {e1 n9} + interface-peer {e2 n10} +} + +node n9 { + type pc + network-config { + hostname pc4 + ! + interface eth0 + mac address 42:00:aa:00:00:08 + ip address 10.0.0.2/8 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {648 264} + labelcoords {648 295} + interface-peer {eth0 n6} +} + +node n10 { + type pc + network-config { + hostname pc5 + ! + interface eth0 + mac address 42:00:aa:00:00:09 + ip address 10.0.0.1/8 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {792 408} + labelcoords {792 439} + interface-peer {eth0 n6} +} + +link l2 { + nodes {n4 n3} + bandwidth 0 +} + +link l0 { + nodes {n0 n4} + bandwidth 0 +} + +link l1 { + nodes {n1 n0} + bandwidth 0 +} + +link l3 { + nodes {n2 n1} + bandwidth 0 +} + +link l4 { + nodes {n5 n1} + bandwidth 0 +} + +link l5 { + nodes {n7 n8} + bandwidth 0 +} + +link l6 { + nodes {n5 n7} + bandwidth 0 +} + +link l7 { + nodes {n6 n5} + bandwidth 0 +} + +link l8 { + nodes {n9 n6} + bandwidth 0 +} + +link l9 { + nodes {n10 n6} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses yes + 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/TP02/solar-2-tp02.imn b/SCR3.2/TP02/solar-2-tp02.imn new file mode 100644 index 0000000..951f678 --- /dev/null +++ b/SCR3.2/TP02/solar-2-tp02.imn @@ -0,0 +1,488 @@ +node n0 { + type lanswitch + network-config { + hostname switch1 + ! + } + canvas c0 + iconcoords {264 72} + labelcoords {264 95} + interface-peer {e0 n6} + interface-peer {e1 n7} +} + +node n1 { + type lanswitch + network-config { + hostname switch2 + ! + } + canvas c0 + iconcoords {456 216} + labelcoords {456 239} + interface-peer {e0 n6} + interface-peer {e1 n8} + interface-peer {e2 n9} + interface-peer {e3 n14} +} + +node n4 { + type router + model quagga + network-config { + hostname router1 + ! + interface eth0 + mac address 42:00:aa:00:00:0d + ip address 45.45.45.253/21 + ! + interface eth1 + mac address 42:00:aa:00:00:08 + ip address 62.62.62.253/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 {648 552} + labelcoords {648 577} + interface-peer {eth1 n5} + interface-peer {eth0 n3} + custom-configs { + } + custom-selected +} + +node n5 { + type router + model quagga + network-config { + hostname router2 + ! + interface eth1 + mac address 42:00:aa:00:00:0a + ip address 37.37.37.254/22 + ! + interface eth0 + mac address 42:00:aa:00:00:07 + 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 {264 552} + labelcoords {264 577} + interface-peer {eth0 n4} + interface-peer {eth1 n10} +} + +node n6 { + type host + network-config { + hostname GW1 + ! + interface eth1 + mac address 42:00:aa:00:00:01 + ip address 172.16.2.253/24 + ! + interface eth0 + mac address 42:00:aa:00:00:00 + ip address 172.16.1.253/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {264 216} + labelcoords {264 252} + 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.253/24 dev eth0 + ip addr add 172.16.2.253/24 dev eth1 + ip -6 addr add ::1/128 dev lo0 + + ip route add 0.0.0.0/0 via 172.16.2.254 + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 172.16.2.253 + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n7 { + type pc + network-config { + hostname pc1 + ! + interface eth0 + mac address 42:00:aa:00:00:02 + 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.253 + ! + } + canvas c0 + iconcoords {24 72} + labelcoords {24 103} + interface-peer {eth0 n0} +} + +node n8 { + type pc + network-config { + hostname pc2 + ! + interface eth0 + mac address 42:00:aa:00:00:03 + 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.254 + ! + } + canvas c0 + iconcoords {456 360} + labelcoords {456 391} + interface-peer {eth0 n1} +} + +node n10 { + type pc + network-config { + hostname pc + ! + interface eth0 + mac address 42:00:aa:00:00:09 + ip address 37.37.37.1/22 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 37.37.37.254 + ! + } + canvas c0 + iconcoords {24 552} + labelcoords {24 583} + interface-peer {eth0 n5} +} + +node n11 { + type pc + network-config { + hostname pc3 + ! + interface eth0 + mac address 42:00:aa:00:00:0e + 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 {840 72} + labelcoords {840 103} + interface-peer {eth0 n2} +} + +node n12 { + type host + network-config { + hostname host1 + ! + interface eth0 + mac address 42:00:aa:00:00:0b + ip address 45.45.45.1/21 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 45.45.45.253 + ! + } + canvas c0 + iconcoords {840 360} + labelcoords {840 396} + interface-peer {eth0 n3} +} + +node n13 { + type host + network-config { + hostname host2 + ! + interface eth0 + mac address 42:00:aa:00:00:0c + ip address 45.45.45.2/21 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ip route 0.0.0.0/0 45.45.45.253 + ! + } + canvas c0 + iconcoords {840 552} + labelcoords {840 588} + interface-peer {eth0 n3} +} + +node n2 { + type lanswitch + network-config { + hostname switch3 + ! + } + canvas c0 + iconcoords {648 72} + labelcoords {648 95} + interface-peer {e1 n11} + interface-peer {e0 n9} +} + +node n3 { + type lanswitch + network-config { + hostname switch4 + ! + } + canvas c0 + iconcoords {648 456} + labelcoords {648 479} + interface-peer {e1 n12} + interface-peer {e2 n13} + interface-peer {e3 n4} + interface-peer {e0 n9} +} + +node n9 { + type host + network-config { + hostname GW2 + ! + interface eth2 + mac address 42:00:aa:00:00:06 + ip address 45.45.45.254/21 + ! + interface eth1 + mac address 42:00:aa:00:00:05 + ip address 172.16.3.254/24 + ! + interface eth0 + mac address 42:00:aa:00:00:04 + ip address 172.16.2.254/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {648 216} + labelcoords {648 252} + interface-peer {eth0 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.2.254/24 dev eth0 + ip addr add 172.16.3.254/24 dev eth1 + ip addr add 45.45.45.254/21 dev eth2 + ip -6 addr add ::1/128 dev lo0 + + ip route add 0.0.0.0/0 via 45.45.45.253 + iptables -t nat -A POSTROUTING -o eth2 -j SNAT --to-source 45.45.45.254 + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 172.16.3.254 + iptables -A FORWARD -i eth2 -d 172.16.2.10 -p tcp --dport 21 -j ACCEPT + iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 21 -j DNAT --to-destination 172.16.2.10 + + rpcbind + inetd + + } + } + } + interface-peer {eth1 n2} + interface-peer {eth2 n3} + custom-enabled true + custom-selected default +} + +node n14 { + type host + network-config { + hostname host + ! + interface eth0 + ip address 172.16.2.10/24 + 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 {456 72} + labelcoords {456 108} + services {ftp} + interface-peer {eth0 n1} +} + +link l0 { + nodes {n0 n6} + bandwidth 0 +} + +link l1 { + nodes {n1 n6} + bandwidth 0 +} + +link l2 { + nodes {n7 n0} + bandwidth 0 +} + +link l3 { + nodes {n8 n1} + bandwidth 0 +} + +link l7 { + nodes {n5 n4} + bandwidth 0 +} + +link l8 { + nodes {n10 n5} + bandwidth 0 +} + +link l9 { + nodes {n12 n3} + bandwidth 0 +} + +link l10 { + nodes {n13 n3} + bandwidth 0 +} + +link l11 { + nodes {n4 n3} + bandwidth 0 +} + +link l12 { + nodes {n11 n2} + bandwidth 0 +} + +link l4 { + nodes {n9 n1} + bandwidth 0 +} + +link l5 { + nodes {n2 n9} + bandwidth 0 +} + +link l6 { + nodes {n3 n9} + bandwidth 0 +} + +link l13 { + nodes {n14 n1} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses yes + 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/TP02/tp02.SCR.3.2.pdf b/SCR3.2/TP02/tp02.SCR.3.2.pdf new file mode 100644 index 0000000..34d2f88 Binary files /dev/null and b/SCR3.2/TP02/tp02.SCR.3.2.pdf differ diff --git a/SCR3.2/TP02/two-gateways.imn b/SCR3.2/TP02/two-gateways.imn new file mode 100644 index 0000000..42445ff --- /dev/null +++ b/SCR3.2/TP02/two-gateways.imn @@ -0,0 +1,457 @@ +node n0 { + type lanswitch + network-config { + hostname switch1 + ! + } + canvas c0 + iconcoords {264 72} + labelcoords {264 95} + interface-peer {e0 n6} + interface-peer {e1 n7} +} + +node n1 { + type lanswitch + network-config { + hostname switch2 + ! + } + canvas c0 + iconcoords {456 216} + labelcoords {456 239} + interface-peer {e0 n6} + interface-peer {e1 n8} + interface-peer {e2 n9} +} + +node n4 { + type router + model quagga + network-config { + hostname router1 + ! + interface eth0 + mac address 42:00:aa:00:00:0d + ip address 45.45.45.253/21 + ! + interface eth1 + mac address 42:00:aa:00:00:08 + ip address 62.62.62.253/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 {648 552} + labelcoords {648 577} + interface-peer {eth1 n5} + interface-peer {eth0 n3} + custom-configs { + } + custom-selected {} +} + +node n5 { + type router + model quagga + network-config { + hostname router2 + ! + interface eth1 + mac address 42:00:aa:00:00:0a + ip address 37.37.37.254/22 + ! + interface eth0 + mac address 42:00:aa:00:00:07 + 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 {264 552} + labelcoords {264 577} + interface-peer {eth0 n4} + interface-peer {eth1 n10} +} + +node n6 { + type host + network-config { + hostname GW1 + ! + interface eth1 + mac address 42:00:aa:00:00:01 + ip address 172.16.2.253/24 + ! + interface eth0 + mac address 42:00:aa:00:00:00 + ip address 172.16.1.253/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {264 216} + labelcoords {264 252} + 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.253/24 dev eth0 + ip addr add 172.16.2.253/24 dev eth1 + ip -6 addr add ::1/128 dev lo0 + + ip route add 0.0.0.0/0 via 172.16.2.254 + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 172.16.2.253 + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n7 { + type pc + network-config { + hostname pc1 + ! + interface eth0 + mac address 42:00:aa:00:00:02 + 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.253 + ! + } + canvas c0 + iconcoords {24 72} + labelcoords {24 103} + interface-peer {eth0 n0} +} + +node n8 { + type pc + network-config { + hostname pc2 + ! + interface eth0 + mac address 42:00:aa:00:00:03 + 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.254 + ! + } + canvas c0 + iconcoords {456 360} + labelcoords {456 391} + interface-peer {eth0 n1} +} + +node n10 { + type pc + network-config { + hostname pc + ! + interface eth0 + mac address 42:00:aa:00:00:09 + ip address 37.37.37.1/22 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 37.37.37.254 + ! + } + canvas c0 + iconcoords {24 552} + labelcoords {24 583} + interface-peer {eth0 n5} +} + +node n11 { + type pc + network-config { + hostname pc3 + ! + interface eth0 + mac address 42:00:aa:00:00:0e + 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 {840 72} + labelcoords {840 103} + interface-peer {eth0 n2} +} + +node n12 { + type host + network-config { + hostname host1 + ! + interface eth0 + mac address 42:00:aa:00:00:0b + ip address 45.45.45.1/21 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 45.45.45.253 + ! + } + canvas c0 + iconcoords {840 360} + labelcoords {840 396} + interface-peer {eth0 n3} +} + +node n13 { + type host + network-config { + hostname host2 + ! + interface eth0 + mac address 42:00:aa:00:00:0c + ip address 45.45.45.2/21 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ip route 0.0.0.0/0 45.45.45.253 + ! + } + canvas c0 + iconcoords {840 552} + labelcoords {840 588} + interface-peer {eth0 n3} +} + +node n2 { + type lanswitch + network-config { + hostname switch3 + ! + } + canvas c0 + iconcoords {648 72} + labelcoords {648 95} + interface-peer {e1 n11} + interface-peer {e0 n9} +} + +node n3 { + type lanswitch + network-config { + hostname switch4 + ! + } + canvas c0 + iconcoords {648 456} + labelcoords {648 479} + interface-peer {e1 n12} + interface-peer {e2 n13} + interface-peer {e3 n4} + interface-peer {e0 n9} +} + +node n9 { + type host + network-config { + hostname GW2 + ! + interface eth2 + mac address 42:00:aa:00:00:06 + ip address 45.45.45.254/21 + ! + interface eth1 + mac address 42:00:aa:00:00:05 + ip address 172.16.3.254/24 + ! + interface eth0 + mac address 42:00:aa:00:00:04 + ip address 172.16.2.254/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {648 216} + labelcoords {648 252} + interface-peer {eth0 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.2.254/24 dev eth0 + ip addr add 172.16.3.254/24 dev eth1 + ip addr add 45.45.45.254/21 dev eth2 + ip -6 addr add ::1/128 dev lo0 + + ip route add 0.0.0.0/0 via 45.45.45.253 + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 172.16.3.254 + iptables -t nat -A POSTROUTING -o eth2 -j SNAT --to-source 45.45.45.254 + + rpcbind + inetd + + } + } + } + interface-peer {eth1 n2} + interface-peer {eth2 n3} + custom-enabled true + custom-selected default +} + +link l0 { + nodes {n0 n6} + bandwidth 0 +} + +link l1 { + nodes {n1 n6} + bandwidth 0 +} + +link l2 { + nodes {n7 n0} + bandwidth 0 +} + +link l3 { + nodes {n8 n1} + bandwidth 0 +} + +link l7 { + nodes {n5 n4} + bandwidth 0 +} + +link l8 { + nodes {n10 n5} + bandwidth 0 +} + +link l9 { + nodes {n12 n3} + bandwidth 0 +} + +link l10 { + nodes {n13 n3} + bandwidth 0 +} + +link l11 { + nodes {n4 n3} + bandwidth 0 +} + +link l12 { + nodes {n11 n2} + bandwidth 0 +} + +link l4 { + nodes {n9 n1} + bandwidth 0 +} + +link l5 { + nodes {n2 n9} + bandwidth 0 +} + +link l6 { + nodes {n3 n9} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses yes + 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/TP03/Répones.txt b/SCR3.2/TP03/Répones.txt new file mode 100644 index 0000000..386e1a5 --- /dev/null +++ b/SCR3.2/TP03/Répones.txt @@ -0,0 +1,37 @@ +I) +1-4) regarder le dhcpd.conf + +5. +vim /etc/default/isc-dhcp-server +commenter la ligne INTERFACESv6 et mettez INTERFACESv4="eth0" +sudo himage DHCPsrv /etc/init.d/isc-dhcp-server start + +6. +ps aux | grep "dhcp" + +7. +C'est le port 67 pour le serveur et 68 pour le client + +9. +sudo himage pc1-1 +root@pc1-1:/# dhclient eth0 + +II) + +4. +a) +Forwarded BOOTREQUEST for 42:00:aa:00:00:05 to 192.168.10.10 + +b) +DHCPDISCOVER from 42:00:aa:00:00:05 (pc2-2) via 172.16.2.254 +DHCPOFFER on 172.16.2.1 to 42:00:aa:00:00:05 (pc2-2) via 172.16.2.254 + +5. +UDP ne possède pas de garantie lors du DHCPDISCOVER ou le DHCPREQUEST + +6. +Le DHCPDISCOVER et le DHCPREQUEST sont renvoyé 2 fois car il envoie un DHCPDISCOVER puis DHCPREQUEST et si il ne trouve pas il renvoie un DHCPDISCOVER et donc un DHCPREQUEST + +7. +fait rajouter -q a dhcrelay + diff --git a/SCR3.2/TP03/dhcp-serv.imn b/SCR3.2/TP03/dhcp-serv.imn new file mode 100644 index 0000000..3e9e862 --- /dev/null +++ b/SCR3.2/TP03/dhcp-serv.imn @@ -0,0 +1,214 @@ +node n0 { + type host + network-config { + hostname DHCPsrv + ! + interface eth0 + mac address 42:00:aa:00:00:00 + ip address 192.168.10.10/20 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {120 120} + labelcoords {120 156} + interface-peer {eth0 n1} +} + +node n1 { + type lanswitch + network-config { + hostname switch1 + ! + } + canvas c0 + iconcoords {216 264} + labelcoords {216 287} + interface-peer {e0 n0} + interface-peer {e1 n2} + interface-peer {e2 n3} + interface-peer {e3 n4} +} + +node n2 { + type pc + network-config { + hostname pc1-1 + ! + interface eth0 + mac address 42:00:aa:00:00:01 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {120 408} + labelcoords {120 439} + interface-peer {eth0 n1} + auto_default_routes enabled +} + +node n3 { + type pc + network-config { + hostname pc1-2 + ! + interface eth0 + mac address 42:00:aa:00:00:02 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {312 408} + labelcoords {312 439} + interface-peer {eth0 n1} + auto_default_routes enabled +} + +node n4 { + type host + network-config { + hostname GW + ! + interface eth1 + mac address 42:00:aa:00:00:04 + ip address 172.16.2.254/24 + ! + interface eth0 + mac address 42:00:aa:00:00:03 + ip address 192.168.10.254/20 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {408 216} + labelcoords {408 252} + interface-peer {eth0 n1} + interface-peer {eth1 n5} + auto_default_routes enabled +} + +node n5 { + type lanswitch + network-config { + hostname switch2 + ! + } + canvas c0 + iconcoords {600 264} + labelcoords {600 287} + interface-peer {e0 n4} + interface-peer {e1 n7} + interface-peer {e2 n6} +} + +node n6 { + type pc + network-config { + hostname pc2-1 + ! + interface eth0 + mac address 42:00:aa:00:00:06 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {504 408} + labelcoords {504 439} + interface-peer {eth0 n5} +} + +node n7 { + type pc + network-config { + hostname pc2-2 + ! + interface eth0 + mac address 42:00:aa:00:00:05 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {696 408} + labelcoords {696 439} + interface-peer {eth0 n5} +} + +link l0 { + nodes {n1 n0} + bandwidth 0 +} + +link l1 { + nodes {n2 n1} + bandwidth 0 +} + +link l2 { + nodes {n3 n1} + bandwidth 0 +} + +link l3 { + nodes {n4 n1} + bandwidth 0 +} + +link l4 { + nodes {n5 n4} + bandwidth 0 +} + +link l5 { + nodes {n7 n5} + bandwidth 0 +} + +link l6 { + nodes {n6 n5} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses yes + 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/TP03/dhcpd.conf b/SCR3.2/TP03/dhcpd.conf new file mode 100644 index 0000000..332b805 --- /dev/null +++ b/SCR3.2/TP03/dhcpd.conf @@ -0,0 +1,24 @@ +option RFC-3442-classless-static-routes code 121=array of unsigned integer 8; + +subnet 192.168.10.0 netmask 255.255.255.0 +{ + range 192.168.10.20 192.168.10.40; + option routers 192.168.10.254; + default-lease-time 600; + max-lease-time 7200; + option RFC-3442-classless-static-routes 24,172,16,2,192,168,10,254, 0,192,168,10,253; +} + +host GW +{ + hardware ethernet 42:00:aa:00:00:03; +} + +subnet 172.16.2.0 netmask 255.255.255.0 +{ + range 172.16.2.1 172.16.2.254; + option routers 172.16.2.254; + option broadcast-address 172.16.2.255; + default-lease-time 600; + max-lease-time 7200; +} \ No newline at end of file diff --git a/SCR3.2/TP03/dhcpd.conf.default b/SCR3.2/TP03/dhcpd.conf.default new file mode 100644 index 0000000..02fe696 --- /dev/null +++ b/SCR3.2/TP03/dhcpd.conf.default @@ -0,0 +1,80 @@ +# 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; +} \ No newline at end of file diff --git a/SCR3.2/TP04/ddns.imn b/SCR3.2/TP04/ddns.imn new file mode 100644 index 0000000..ea10416 --- /dev/null +++ b/SCR3.2/TP04/ddns.imn @@ -0,0 +1,193 @@ +node n0 { + type lanswitch + network-config { + hostname switch1 + ! + } + canvas c0 + iconcoords {408 120} + labelcoords {422 90} + interface-peer {e0 n1} + interface-peer {e1 n6} + interface-peer {e2 n2} + interface-peer {e3 n3} + interface-peer {e4 n4} + interface-peer {e5 n5} +} + +node n1 { + type host + network-config { + hostname osiris + ! + interface eth0 + mac address 42:00:aa:00:00:00 + ip address 162.168.1.125/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {168 120} + labelcoords {168 156} + interface-peer {eth0 n0} +} + +node n2 { + type pc + network-config { + hostname eno + ! + interface eth0 + mac address 42:00:aa:00:00:02 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {264 312} + labelcoords {264 343} + interface-peer {eth0 n0} +} + +node n3 { + type pc + network-config { + hostname owt + ! + interface eth0 + mac address 42:00:aa:00:00:03 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {408 312} + labelcoords {408 343} + interface-peer {eth0 n0} +} + +node n4 { + type pc + network-config { + hostname eerht + ! + interface eth0 + mac address 42:00:aa:00:00:04 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {552 312} + labelcoords {552 343} + interface-peer {eth0 n0} +} + +node n5 { + type pc + network-config { + hostname ruof + ! + interface eth0 + mac address 42:00:aa:00:00:05 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {696 264} + labelcoords {696 295} + interface-peer {eth0 n0} +} + +node n6 { + type host + network-config { + hostname isis + ! + interface eth0 + ip address 162.168.1.10/24 + mac address 42:00:aa:00:00:01 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + auto_default_routes enabled + canvas c0 + iconcoords {744 120} + labelcoords {744 156} + interface-peer {eth0 n0} +} + +link l0 { + nodes {n0 n1} + bandwidth 0 +} + +link l1 { + nodes {n6 n0} + bandwidth 0 +} + +link l2 { + nodes {n2 n0} + bandwidth 0 +} + +link l3 { + nodes {n3 n0} + bandwidth 0 +} + +link l4 { + nodes {n0 n4} + bandwidth 0 +} + +link l5 { + nodes {n0 n5} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses yes + 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/TP04/osiris.db.tp.scr b/SCR3.2/TP04/osiris.db.tp.scr new file mode 100644 index 0000000..f1426cd --- /dev/null +++ b/SCR3.2/TP04/osiris.db.tp.scr @@ -0,0 +1,17 @@ +; +; BIND data file for tp.scr +; +$TTL 604800 +@ IN SOA osiris.tp.scr. root.tp.scr. ( + 2 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; +@ IN NS osiris.tp.scr. +osiris.tp.scr. IN A 192.168.1.158 +eno.tp.scr. IN A 192.168.1.1 +owt.tp.scr. IN A 192.168.1.2 +eerht.tp.scr. IN A 192.168.1.3 +ruof.tp.scr. IN A 192.168.1.4 diff --git a/SCR3.2/TP04/osiris.db.tp.scr.inv b/SCR3.2/TP04/osiris.db.tp.scr.inv new file mode 100644 index 0000000..0134bc3 --- /dev/null +++ b/SCR3.2/TP04/osiris.db.tp.scr.inv @@ -0,0 +1,17 @@ +; +; BIND reverse data file for tp.scr +; +$TTL 604800 +@ IN SOA osiris.tp.scr. root.tp.scr. ( + 1 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; +@ IN NS osiris.tp.scr. +158.1.168.192.in-addr.arpa IN PTR osiris.tp.scr. +1.1.168.192.in-addr.arpa IN PTR eno.tp.scr. +2.1.168.192.in-addr.arpa IN PTR owt.tp.scr. +3.1.168.192.in-addr.arpa IN PTR eerht.tp.scr. +4.1.168.192.in-addr.arpa IN PTR ruof.tp.scr. diff --git a/SCR3.2/TP04/osiris.named.conf.local b/SCR3.2/TP04/osiris.named.conf.local new file mode 100644 index 0000000..da55712 --- /dev/null +++ b/SCR3.2/TP04/osiris.named.conf.local @@ -0,0 +1,19 @@ +// +// Do any local configuration here +// + +// Consider adding the 1918 zones here, if they are not used in your +// organization +//include "/etc/bind/zones.rfc1918"; + +zone "tp.scr" +{ +type master; +file "/etc/bind/db.tp.scr"; +}; + +zone "1.168.192.in-addr.arpa" +{ +type master; +file "/etc/bind/db.tp.scr.inv"; +}; \ No newline at end of file