nouveau fichier : giti.sh

nouveau fichier : nat.sh
	nouveau fichier : siotp-main(3).zip
	nouveau fichier : siotp/README.md
	nouveau fichier : siotp/automate.sh
	nouveau fichier : siotp/sisr1/README.md
	nouveau fichier : siotp/sisr1/tp01-02/README.md
	nouveau fichier : siotp/sisr1/tp01-02/files_dhcp/README.md
	nouveau fichier : siotp/sisr1/tp01-02/files_dhcp/dhcpd.conf
	nouveau fichier : siotp/sisr1/tp01-02/files_dhcp/hosts
	nouveau fichier : siotp/sisr1/tp01-02/files_dhcp/interfaces
	nouveau fichier : siotp/sisr1/tp01-02/files_dhcp/isc-dhcp-server
	nouveau fichier : siotp/sisr1/tp01-02/files_dhcp/nat.sh
	nouveau fichier : siotp/sisr1/tp01-02/files_dns1/README.md
	nouveau fichier : siotp/sisr1/tp01-02/files_dns1/db.sio1lab.lan
	nouveau fichier : siotp/sisr1/tp01-02/files_dns1/db.sio1lab.lan.rev
	nouveau fichier : siotp/sisr1/tp01-02/files_dns1/hosts
	nouveau fichier : siotp/sisr1/tp01-02/files_dns1/interfaces
	nouveau fichier : siotp/sisr1/tp01-02/files_dns1/named.conf.local
	nouveau fichier : siotp/sisr1/tp01-02/files_dns1/named.conf.options
	nouveau fichier : siotp/sisr1/tp01-02/files_dns1/resolv.conf
	nouveau fichier : siotp/sisr1/tp01-02/files_dns2/README.md
	nouveau fichier : siotp/sisr1/tp01-02/files_dns2/db.sio1lab.lan
	nouveau fichier : siotp/sisr1/tp01-02/files_dns2/db.sio1lab.lan.rev
	nouveau fichier : siotp/sisr1/tp01-02/files_dns2/hosts
	nouveau fichier : siotp/sisr1/tp01-02/files_dns2/interfaces
	nouveau fichier : siotp/sisr1/tp01-02/files_dns2/named.conf.local
	nouveau fichier : siotp/sisr1/tp01-02/files_dns2/named.conf.options
	nouveau fichier : siotp/sisr1/tp01-02/files_dns2/resolv.conf
	nouveau fichier : siotp/sisr1/tp03/README.md
	nouveau fichier : siotp/sisr1/tp03/files_admin/README.md
	nouveau fichier : siotp/sisr1/tp03/files_admin/hostname
	nouveau fichier : siotp/sisr1/tp03/files_admin/hosts
	nouveau fichier : siotp/sisr1/tp03/files_admin/interfaces
	nouveau fichier : siotp/sisr1/tp03/files_admin/nat.sh
	nouveau fichier : siotp/sisr1/tp03/files_admin/resolv.conf
	nouveau fichier : siotp/sisr1/tp03/files_dns2/README.md
	nouveau fichier : siotp/sisr1/tp03/files_dns2/db.monlabo.lan
	nouveau fichier : siotp/sisr1/tp03/files_dns2/db.monlabo.lan.rev
	nouveau fichier : siotp/sisr1/tp03/files_dns2/hostname
	nouveau fichier : siotp/sisr1/tp03/files_dns2/hosts
	nouveau fichier : siotp/sisr1/tp03/files_dns2/named.conf
	nouveau fichier : siotp/sisr1/tp03/files_dns2/named.conf.local
	nouveau fichier : siotp/sisr1/tp03/files_dns2/named.conf.options
	nouveau fichier : siotp/sisr1/tp03/files_dns2/resolv.conf
	nouveau fichier : siotp/sisr1/tp03/files_service/README.md
	nouveau fichier : siotp/sisr1/tp03/files_service/db.monlabo.lan
	nouveau fichier : siotp/sisr1/tp03/files_service/db.monlabo.lan.rev
	nouveau fichier : siotp/sisr1/tp03/files_service/dhclient.conf
	nouveau fichier : siotp/sisr1/tp03/files_service/dhcpd.conf
	nouveau fichier : siotp/sisr1/tp03/files_service/hostname
	nouveau fichier : siotp/sisr1/tp03/files_service/hosts
	nouveau fichier : siotp/sisr1/tp03/files_service/interfaces
	nouveau fichier : siotp/sisr1/tp03/files_service/isc-dhcp-server
	nouveau fichier : siotp/sisr1/tp03/files_service/named.conf
	nouveau fichier : siotp/sisr1/tp03/files_service/named.conf.local
	nouveau fichier : siotp/sisr1/tp03/files_service/named.conf.options
	nouveau fichier : siotp/sisr1/tp03/files_service/resolv.conf
	nouveau fichier : siotp/sisr1/tp04/README.md
	nouveau fichier : siotp/sisr1/tp04/auto_nat/README.md
	nouveau fichier : siotp/sisr1/tp04/auto_nat/nat.service
	nouveau fichier : siotp/sisr1/tp04/scripts_and_files/README.md
	nouveau fichier : siotp/sisr1/tp04/scripts_and_files/Users.csv
	nouveau fichier : siotp/sisr1/tp04/scripts_and_files/createLogins.sh
	nouveau fichier : siotp/sisr1/tp04/scripts_and_files/createUsers.sh
	nouveau fichier : siotp/sisr1/tp04/scripts_and_files/logins.csv
	nouveau fichier : siotp/sisr1/tp04/scripts_and_files/remoteCreation.sh
	nouveau fichier : siotp/sisr1/tp05/README.md
	nouveau fichier : siotp/sisr1/tp05/deployment_samba.sh
	nouveau fichier : siotp/sisr1/tp05/smb.conf
	nouveau fichier : siotp/sisr1/tp06/README.md
	nouveau fichier : siotp/sisr1/tp06/files_admin/README.md
	nouveau fichier : siotp/sisr1/tp06/files_admin/dnsfwd.service
	nouveau fichier : siotp/sisr1/tp06/files_admin/dnsfwd.sh
	nouveau fichier : siotp/sisr1/tp06/files_admin/squid_v1.conf
	nouveau fichier : siotp/sisr1/tp06/files_admin/squid_v2.conf
	nouveau fichier : siotp/sisr1/tp06/files_admin/squid_v3.conf
	nouveau fichier : siotp/sisr1/tp06/files_admin/squid_v4.conf
	nouveau fichier : siotp/sisr1/tp06/files_admin/squid_v5_auth.conf
	nouveau fichier : siotp/sisr1/tp07/files_firewall/current_ruleset_partie_1.nft
	nouveau fichier : siotp/sisr1/tp07/files_firewall/current_ruleset_partie_2.nft
	nouveau fichier : siotp/sisr1/tp07/files_firewall/current_ruleset_partie_3.nft
	nouveau fichier : siotp/sisr1/tp07/files_firewall/current_ruleset_partie_4.nft
	nouveau fichier : siotp/sisr1/tp07/files_firewall/interfaces
	nouveau fichier : siotp/sisr1/tp07/files_firewall/proxy.conf
	nouveau fichier : siotp/sisr1/tp07/files_firewall/refresh_firewall.sh
	nouveau fichier : siotp/sisr1/tp07/files_firewall/resolv.conf
	nouveau fichier : siotp/sisr1/tp07/files_pclan/interfaces
	nouveau fichier : siotp/sisr1/tp07/files_pclan/resolv.conf
	nouveau fichier : siotp/sisr1/tp07/files_pcnet/interfaces
	nouveau fichier : siotp/sisr1/tp07/files_pcnet/resolv.conf
	nouveau fichier : siotp/sisr1/tp07/files_srvweb/interfaces
	nouveau fichier : siotp/sisr1/tp07/files_srvweb/resolv.conf
This commit is contained in:
Jibril Bouhbas 2024-04-08 09:46:22 +02:00
parent 64a291a07a
commit 6483da63ea
93 changed files with 47432 additions and 0 deletions

6
giti.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
git pull
git add .
git commit
git push

6
nat.sh Executable file
View File

@ -0,0 +1,6 @@
echo "1" > /proc/sys/net/ipv4/ip_forward
nft add table basic_nat_table
nft add chain basic_nat_table prerouting {type nat hook prerouting priority 0 \; }
nft add chain basic_nat_table postrouting {type nat hook postrouting priority 0 \; }
nft add rule basic_nat_table postrouting masquerade

BIN
siotp-main(3).zip Normal file

Binary file not shown.

1
siotp/README.md Normal file
View File

@ -0,0 +1 @@
This is a file depot, storing all files that had to be created during practical works, and that I might need in the future. It's also worth archiving these files, as the Virtual Machines tend to be deleted once they've outgrown their use.

5
siotp/automate.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
git pull
git add .
git commit
git push

1
siotp/sisr1/README.md Normal file
View File

@ -0,0 +1 @@
Each folder bears the name of the TP (practical work) it belongs to.

View File

@ -0,0 +1,2 @@
Each folder is called files_{Virtual Machine's name}.
First and second practical work's folders, combined.

View File

@ -0,0 +1 @@
Files for the srv-dhcp-ge Virtual Machine, from the FIRST and SECOND TPs.

View File

@ -0,0 +1,116 @@
# 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 604800;
max-lease-time 604800;
option domain-name-servers 192.168.0.121;
option domain-name-servers 192.168.0.122;
# 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 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.5 192.168.2.99;
option routers 192.168.0.120;
}
host xp-master {
hardware ethernet 08:00:27:77:70:0D;
fixed-address 192.168.2.167;
}
# 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;
# }
#}

View File

@ -0,0 +1,8 @@
127.0.0.1 localhost
127.0.0.1 dhcp-ge.sio.lan dhcp-ge
192.168.0.24 bookworm-jp.sio.lan bookworm-jp
192.168.0.40 bookworm-jb.sio.lan bookworm-jb
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

View File

@ -0,0 +1,18 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s8
iface enp0s8 inet static
address 192.168.2.1/24
#enp0s3 static
auto enp0s3
iface enp0s3 inet static
address 192.168.0.120/24
gateway 192.168.0.1

View File

@ -0,0 +1,18 @@
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid
# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="enp0s8"
INTERFACESv6=""

View File

@ -0,0 +1,6 @@
#!/bin/bash
sudo sysctl net.ipv4.ip_forward="1"
nft add table basic_nat_table
nft add chain basic_nat_table prerouting {type nat hook prerouting priority 0 \; }
nft add chain basic_nat_table postrouting {type nat hook postrouting priority 0 \; }
nft add rule basic_nat_table postrouting masquerade

View File

@ -0,0 +1 @@
Files for the srv-dns1-ge Virtual Machine, from the FIRST and SECOND TPs.

View File

@ -0,0 +1,33 @@
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA deb-dns1-ge.sio1lab.lan. root.sio1lab.lan. (
2635478965 ; Serial
21600 ; Refresh
3600 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
IN NS deb-dns1-ge.sio1lab.lan.
IN NS deb-dns2-ge.sio1lab.lan.
IN A 192.168.0.120
IN A 192.168.0.121
IN A 192.168.0.140
IN A 192.168.0.141
IN A 192.168.0.142
deb-dhcp-ge IN A 192.168.0.120
deb-dns1-ge IN A 192.168.0.121
deb-dns2-ge IN A 192.168.0.122
deb-dhcp-jp IN A 192.168.0.141
deb-dns-jp IN A 192.168.0.140
deb-dns2-jp IN A 192.168.0.142
dhcp IN CNAME deb-dhcp-ge
dns1 IN CNAME deb-dns1-ge
dns2 IN CNAME deb-dns2-ge
dhcpjp IN CNAME deb-dhcp-jp
dns1jp IN CNAME deb-dns-jp
dns2jp IN CNAME deb-dns2-jp

View File

@ -0,0 +1,28 @@
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA deb-dns1-ge.sio1lab.lan. root.sio1lab.lan. (
2635478965 ; Serial
21600 ; Refresh
3600 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
IN NS deb-dns1-ge.sio1lab.lan.
IN NS deb-dns2-ge.sio1lab.lan.
deb-dhcp-ge IN A 192.168.0.120
deb-dns1-ge IN A 192.168.0.121
deb-dns2-ge IN A 192.168.0.122
deb-dhcp-jp IN A 192.168.0.141
deb-dns-jp IN A 192.168.0.140
deb-dns2-jp IN A 192.168.0.142
120 IN PTR deb-dhcp-ge.sio1lab.lan.
121 IN PTR deb-dns1-ge.sio1lab.lan.
122 IN PTR deb-dns2-ge.sio1lab.lan.
140 IN PTR deb-dns-jp.sio1lab.lan.
141 IN PTR deb-dhcp-jp.sio1lab.lan.
142 IN PTR deb-dns2-jp.sio1lab.lan.

View File

@ -0,0 +1,7 @@
127.0.0.1 localhost
127.0.1.1 dns1-ge.sio.lan dns1-ge
192.168.0.24 bookworm-jp.sio.lan bookworm-jp
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

View File

@ -0,0 +1,14 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.0.121/24
gateway 192.168.0.1

View File

@ -0,0 +1,21 @@
//
// Do any local configuration here
//
// zone directe
zone "sio1lab.lan" {
type master;
file "/etc/bind/db.sio1lab.lan";
};
// zone inverse
zone "0.168.192.in-addr.arpa" {
type master;
notify no;
file "/etc/bind/db.sio1lab.lan.rev";
};
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

View File

@ -0,0 +1,25 @@
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
forwarders {
10.121.38.7;
10.121.38.8;
};
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation no;
listen-on-v6 { any; };
};

View File

@ -0,0 +1,2 @@
search sio1lab.lan
nameserver 127.0.0.1

View File

@ -0,0 +1 @@
Files for the srv-dns2-ge Virtual Machine, from the FIRST AND SECOND TPs.

View File

@ -0,0 +1,20 @@
$ORIGIN .
$TTL 604800 ; 1 week
sio1lab.lan IN SOA deb-dns1-ge.sio1lab.lan. root.sio1lab.lan. (
2635478965 ; serial
21600 ; refresh (6 hours)
3600 ; retry (1 hour)
2419200 ; expire (4 weeks)
86400 ; minimum (1 day)
)
NS deb-dns1-ge.sio1lab.lan.
NS deb-dns2-ge.sio1lab.lan.
A 192.168.0.120
A 192.168.0.121
$ORIGIN sio1lab.lan.
deb-dhcp-ge A 192.168.0.120
deb-dns1-ge A 192.168.0.121
deb-dns2-ge A 192.168.0.122
dhcp CNAME deb-dhcp-ge
dns1 CNAME deb-dns1-ge
dns2 CNAME deb-dns2-ge

View File

@ -0,0 +1,18 @@
$ORIGIN .
$TTL 604800 ; 1 week
0.168.192.in-addr.arpa IN SOA deb-dns1-ge.sio1lab.lan. root.sio1lab.lan. (
2635478965 ; serial
21600 ; refresh (6 hours)
3600 ; retry (1 hour)
2419200 ; expire (4 weeks)
86400 ; minimum (1 day)
)
NS deb-dns1-ge.sio1lab.lan.
NS deb-dns2-ge.sio1lab.lan.
$ORIGIN 0.168.192.in-addr.arpa.
120 PTR deb-dhcp-ge.sio1lab.lan.
121 PTR deb-dns1-ge.sio1lab.lan.
122 PTR deb-dns2-ge.sio1lab.lan.
deb-dhcp-ge A 192.168.0.120
deb-dns1-ge A 192.168.0.121
deb-dns2-ge A 192.168.0.122

View File

@ -0,0 +1,7 @@
127.0.0.1 localhost
127.0.1.1 dns2-ge.sio.lan dns2-ge
192.168.0.24 bookworm-jp.sio.lan bookworm-jp
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

View File

@ -0,0 +1,14 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.0.122/24
gateway 192.168.0.1

View File

@ -0,0 +1,25 @@
//
// Do any local configuration here
//
// zone directe
zone "sio1lab.lan" {
type slave;
file "/etc/bind/db.sio1lab.lan";
masters { 192.168.0.121; };
masterfile-format text;
};
// zone inverse
zone "0.168.192.in-addr.arpa" {
type slave;
notify no;
file "/etc/bind/db.sio1lab.lan.rev";
masters { 192.168.0.121; };
masterfile-format text;
};
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

View File

@ -0,0 +1,25 @@
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
forwarders {
10.121.38.7;
10.121.38.8;
};
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
listen-on-v6 { any; };
};

View File

@ -0,0 +1,2 @@
search sio1lab.lan
server 127.0.0.1

View File

@ -0,0 +1,2 @@
Each folder is called files_{Virtual Machine's name}.
Third practical work's folder.

View File

@ -0,0 +1 @@
Files for the srv-admin-ge Virtual Machine.

View File

@ -0,0 +1 @@
srv-admin-ge

View File

@ -0,0 +1,7 @@
127.0.0.1 localhost
127.0.1.1 srv-admin-ge.sio.lan srv-admin-ge
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

View File

@ -0,0 +1,18 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.0.120/24
gateway 192.168.0.1
# The secondary (internal) network interface
allow-hotplug enp0s8
iface enp0s8 inet dhcp

View File

@ -0,0 +1,6 @@
#!/bin/bash
echo "1" > /proc/sys/net/ipv4/ip_forward
nft add table basic_nat_table
nft add chain basic_nat_table prerouting {type nat hook prerouting priority 0 \; }
nft add chain basic_nat_table postrouting {type nat hook postrouting priority 0 \; }
nft add rule basic_nat_table postrouting masquerade

View File

@ -0,0 +1,4 @@
domain monlabo.lan
search monlabo.lan
nameserver 172.16.0.1
nameserver 172.16.0.2

View File

@ -0,0 +1 @@
Files for the srv-dns2-ge Virtual Machine.

View File

@ -0,0 +1,36 @@
$ORIGIN .
$TTL 604800
@ IN SOA srv-service-ge.monlabo.lan. root.monlabo.lan. (
2635478965 ; Serial
216 ; Refresh
3600 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
IN NS srv-service-ge.monlabo.lan.
IN NS srv-dns2-ge.monlabo.lan.
IN A 172.16.0.1
IN A 172.16.0.2
IN A 172.16.0.254
IN A 172.16.0.100
$ORIGIN monlabo.lan.
srv-service-ge IN A 172.16.0.1
srv-dns2-ge IN A 172.16.0.2
srv-admin-ge IN A 172.16.0.254
pc-cli-ge IN A 172.16.0.100
srvdns IN CNAME srv-service-ge
dns IN CNAME srv-service-ge
dns1 IN CNAME srv-service-ge
srvdhcp IN CNAME srv-service-ge
dhcp IN CNAME srv-service-ge
srvadmin IN CNAME srv-admin-ge
router IN CNAME srv-admin-ge
pc IN CNAME pc-cli-ge
client IN CNAME pc-cli-ge
pccli IN CNAME pc-cli-ge
srvdns2 IN CNAME srv-dns2-ge
dns2 IN CNAME srv-dns2-ge

View File

@ -0,0 +1,23 @@
$ORIGIN .
$TTL 604800
@ IN SOA srv-service-ge.monlabo.lan. root.monlabo.lan. (
2635478965 ; Serial
216 ; Refresh
3600 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
IN NS srv-service-ge.monlabo.lan.
IN NS srv-dns2-ge.monlabo.lan.
$ORIGIN 0.16.172.in-addr.arpa.
1 IN PTR srv-service-ge.monlabo.lan.
2 IN PTR srv-dns2-ge.monlabo.lan.
100 IN PTR pc-cli-ge.monlabo.lan.
254 IN PTR srv-admin-ge.monlabo.lan.
srv-service-ge IN A 172.16.0.1
srv-dns2-ge IN A 172.16.0.2
srv-admin-ge IN A 172.16.0.254
pc-cli-ge IN A 172.16.0.100

View File

@ -0,0 +1 @@
srv-dns2-ge

View File

@ -0,0 +1,7 @@
127.0.0.1 localhost
127.0.1.1 srv-dns2-ge.sio.lan srv-dns2-ge
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

View File

@ -0,0 +1,11 @@
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

View File

@ -0,0 +1,26 @@
//
// Do any local configuration here
//
// zone directe
zone "monlabo.lan" {
type slave;
file "/etc/bind/db.monlabo.lan";
masters { 172.16.0.1; };
masterfile-format text;
};
// zone inverse
zone "0.16.172.in-addr.arpa" {
type slave;
notify no;
file "/etc/bind/db.monlabo.lan.rev";
masters { 172.16.0.1; };
masterfile-format text;
};
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

View File

@ -0,0 +1,25 @@
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
forwarders {
10.121.38.7;
10.121.38.8;
};
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation no;
listen-on-v6 { any; };
};

View File

@ -0,0 +1,3 @@
domain monlabo.lan
search monlabo.lan
nameserver 172.16.0.2

View File

@ -0,0 +1 @@
Files for the srv-dns1-ge Virtual Machine.

View File

@ -0,0 +1,36 @@
$TTL 604800
@ IN SOA srv-service-ge.monlabo.lan. root.monlabo.lan. (
2635478965 ; Serial
216 ; Refresh
3600 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
IN NS srv-service-ge.monlabo.lan.
IN NS srv-dns2-ge.monlabo.lan.
IN A 172.16.0.1
IN A 172.16.0.2
IN A 172.16.0.10
IN A 172.16.0.100
IN A 172.16.0.254
srv-service-ge IN A 172.16.0.1
srv-dns2-ge IN A 172.16.0.2
srv-admin-ge IN A 172.16.0.254
pc-cli-ge IN A 172.16.0.100
pc-secure-ge IN A 172.16.0.10
srvdns IN CNAME srv-service-ge
dns IN CNAME srv-service-ge
dns1 IN CNAME srv-service-ge
srvdhcp IN CNAME srv-service-ge
dhcp IN CNAME srv-service-ge
srvadmin IN CNAME srv-admin-ge
router IN CNAME srv-admin-ge
pc IN CNAME pc-cli-ge
client IN CNAME pc-cli-ge
pccli IN CNAME pc-cli-ge
pcsecure IN CNAME pc-secure-ge
srvdns2 IN CNAME srv-dns2-ge
dns2 IN CNAME srv-dns2-ge

View File

@ -0,0 +1,25 @@
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA srv-service-ge.monlabo.lan. root.monlabo.lan. (
2635478965 ; Serial
216 ; Refresh
3600 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
IN NS srv-service-ge.monlabo.lan.
IN NS srv-dns2-ge.monlabo.lan.
1 IN PTR srv-service-ge.monlabo.lan.
2 IN PTR srv-dns2-ge.monlabo.lan.
10 IN PTR pc-secure-ge.monlabo.lan.
100 IN PTR pc-cli-ge.monlabo.lan.
254 IN PTR srv-admin-ge.monlabo.lan.
srv-service-ge IN A 172.16.0.1
srv-dns2-ge IN A 172.16.0.2
srv-admin-ge IN A 172.16.0.254
pc-cli-ge IN A 172.16.0.100
pc-secure-ge IN A 172.16.0.10

View File

@ -0,0 +1,55 @@
# Configuration file for /sbin/dhclient.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
# man page for more information about the syntax of this file
# and a more comprehensive list of the parameters understood by
# dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
# not leave anything out (like the domain name, for example), then
# few changes must be made to this file, if any.
#
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, ntp-servers;
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
#prepend domain-name-servers 172.16.0.2;
#require subnet-mask, domain-name-servers;
#timeout 60;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/sbin/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;
#alias {
# interface "eth0";
# fixed-address 192.5.5.213;
# option subnet-mask 255.255.255.255;
#}
#lease {
# interface "eth0";
# fixed-address 192.33.137.200;
# medium "link0 link1";
# option host-name "andare.swiftmedia.com";
# option subnet-mask 255.255.255.0;
# option broadcast-address 192.33.137.255;
# option routers 192.33.137.250;
# option domain-name-servers 127.0.0.1;
# renew 2 2000/1/12 00:00:01;
# rebind 2 2000/1/12 00:00:01;
# expire 2 2000/1/12 00:00:01;
#}

View File

@ -0,0 +1,114 @@
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# option definitions common to all supported networks...
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.0.0 netmask 255.255.255.0 {
range 172.16.0.100 172.16.0.200;
option routers 172.16.0.254;
option domain-name "monlabo.lan";
option domain-name-servers 172.16.0.1, 172.16.0.2;
}
# 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 srv-admin-ge {
hardware ethernet 08:00:27:6e:32:49;
fixed-address 172.16.0.254;
}
host srv-dns2-ge {
hardware ethernet 08:00:27:8e:f7:39;
fixed-address 172.16.0.2;
}
host pc-secure-ge {
hardware ethernet 08:00:27:01:99:b3;
fixed-address 172.16.0.10;
}
# 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;
# }
#}

View File

@ -0,0 +1 @@
srv-service-ge

View File

@ -0,0 +1,7 @@
127.0.0.1 localhost
127.0.1.1 srv-service-ge.sio.lan srv-service-ge
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

View File

@ -0,0 +1,14 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet static
address 172.16.0.1/24
gateway 172.16.0.254

View File

@ -0,0 +1,18 @@
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid
# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="enp0s3"
INTERFACESv6=""

View File

@ -0,0 +1,11 @@
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

View File

@ -0,0 +1,21 @@
//
// Do any local configuration here
//
// zone directe
zone "monlabo.lan" {
type master;
file "/etc/bind/db.monlabo.lan";
};
// zone inverse
zone "0.16.172.in-addr.arpa" {
type master;
notify no;
file "/etc/bind/db.monlabo.lan.rev";
};
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

View File

@ -0,0 +1,25 @@
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
forwarders {
10.121.38.7;
10.121.38.8;
};
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation no;
listen-on-v6 { any; };
};

View File

@ -0,0 +1,3 @@
domain monlabo.lan
search monlabo.lan
nameserver 127.0.0.1

View File

@ -0,0 +1,2 @@
Folders bear an explicit name, unlike the predecessors.
Fourth practical work's folder.

View File

@ -0,0 +1,2 @@
Copy to /etc/systemd/system.
This file is a service to automate the NAT on the Virtual Machine.

View File

@ -0,0 +1,9 @@
[Unit]
Description=Running nat.sh script on startup thanks to a systemd unit.
[Service]
Type=oneshot
ExecStart=/bin/bash /root/nat.sh
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
This folder holds every single file and script done in the FOURTH TP.

View File

@ -0,0 +1,30 @@
Ermengarde,Berthelmot,eberthelmot0@webmd.com,Female,Accountant,
Kassi,Bunker,kbunker1@xinhuanet.com,Female,Production,
Moises,McCallum,mmccallum2@i2i.jp,Male,Production,
Patrizio,Lune,plune3@upenn.edu,Male,Accountant,
Blanch,Everix,beverix4@php.net,Female,Accountant,
Stafani,Kibbel,skibbel5@marriott.com,Female,Production,
Ignacius,Mosdell,imosdell6@cloudflare.com,Male,Management,
Jeana,Waller-Bridge,jwallerbridge7@mapy.cz,Female,Management,
Elroy,Dressel,edressel8@opera.com,Male,Production,
Thea,Strettell,tstrettell9@nature.com,Female,Production,
Solomon,Insoll,sinsolla@utexas.edu,Male,Accountant,
Carri,Feedome,cfeedomeb@ask.com,Female,Accountant,
Padraic,Chetwind,pchetwindc@last.fm,Male,Management,
Solly,D'Ugo,sdugod@uiuc.edu,Male,Production,
Konstanze,MacCostigan,kmaccostigane@seattletimes.com,Female,Accountant,
Roxane,Powlesland,rpowleslandf@pcworld.com,Female,Management,
Orelle,Kennealy,okennealyg@arstechnica.com,Female,Production,
Sukey,Soitoux,ssoitouxh@shinystat.com,Female,Production,
Nelli,Syce,nsycei@blogger.com,Female,Production,
Clarisse,Shillam,cshillamj@dailymotion.com,Female,Production,
Carin,Gueny,cguenyk@naver.com,Female,Management,
Donny,Riepel,driepell@addtoany.com,Male,Production,
Daniella,Ralfe,dralfem@wunderground.com,Female,Production,
Lexy,Clynmans,lclynmansn@furl.net,Female,Production,
Gardiner,Adamthwaite,gadamthwaiteo@spotify.com,Male,Production,
Woodman,Lippett,wlippettp@purevolume.com,Male,Production,
Nadya,Munnion,nmunnionq@flavors.me,Female,Production,
Llewellyn,Habershon,lhabershonr@alibaba.com,Male,Production,
Isaak,Greatrex,igreatrexs@seesaa.net,Male,Production,
Darill,Frostdyke,dfrostdyket@cafepress.com,Male,Production,
1 Ermengarde Berthelmot eberthelmot0@webmd.com Female Accountant
2 Kassi Bunker kbunker1@xinhuanet.com Female Production
3 Moises McCallum mmccallum2@i2i.jp Male Production
4 Patrizio Lune plune3@upenn.edu Male Accountant
5 Blanch Everix beverix4@php.net Female Accountant
6 Stafani Kibbel skibbel5@marriott.com Female Production
7 Ignacius Mosdell imosdell6@cloudflare.com Male Management
8 Jeana Waller-Bridge jwallerbridge7@mapy.cz Female Management
9 Elroy Dressel edressel8@opera.com Male Production
10 Thea Strettell tstrettell9@nature.com Female Production
11 Solomon Insoll sinsolla@utexas.edu Male Accountant
12 Carri Feedome cfeedomeb@ask.com Female Accountant
13 Padraic Chetwind pchetwindc@last.fm Male Management
14 Solly D'Ugo sdugod@uiuc.edu Male Production
15 Konstanze MacCostigan kmaccostigane@seattletimes.com Female Accountant
16 Roxane Powlesland rpowleslandf@pcworld.com Female Management
17 Orelle Kennealy okennealyg@arstechnica.com Female Production
18 Sukey Soitoux ssoitouxh@shinystat.com Female Production
19 Nelli Syce nsycei@blogger.com Female Production
20 Clarisse Shillam cshillamj@dailymotion.com Female Production
21 Carin Gueny cguenyk@naver.com Female Management
22 Donny Riepel driepell@addtoany.com Male Production
23 Daniella Ralfe dralfem@wunderground.com Female Production
24 Lexy Clynmans lclynmansn@furl.net Female Production
25 Gardiner Adamthwaite gadamthwaiteo@spotify.com Male Production
26 Woodman Lippett wlippettp@purevolume.com Male Production
27 Nadya Munnion nmunnionq@flavors.me Female Production
28 Llewellyn Habershon lhabershonr@alibaba.com Male Production
29 Isaak Greatrex igreatrexs@seesaa.net Male Production
30 Darill Frostdyke dfrostdyket@cafepress.com Male Production

View File

@ -0,0 +1,17 @@
#!/bin/bash
#
rm ./logins.csv
while read line
do
touch ./temptp4.txt
file='./temptp4.txt'
echo $line > $file
surname=$(cut -d "," -f 1 $file)
name=$(cut -d "," -f 2 $file)
group=$(cut -d "," -f 5 $file)
initials=$(cut -c 1 $file)
id=$(echo $initials$name | tr [:upper:] [:lower:])
passwd=$(echo $RANDOM | md5sum | head -c 8)
echo $id","$passwd","$surname","$name","$group>> logins.csv
rm ./temptp4.txt
done < ./Users.csv

View File

@ -0,0 +1,18 @@
#!/bin/bash
while read line
do
touch ./temptp4.txt
file="./temptp4.txt"
echo $line > $file
user=$(cut -d "," -f 1 $file)
usergroup=$(cut -d "," -f 5 $file)
passwd=$(cut -d "," -f 2 $file)
if ! grep -q $usergroup /etc/group ; then
echo "tentative creation $usergroup"
groupadd "$usergroup"
fi
useradd --create-home --groups $usergroup --shell /bin/bash $user
(echo $passwd ; echo $passwd) | passwd $user
chown $user /home/$user
rm ./temptp4.txt
done < ./logins.csv

View File

@ -0,0 +1,30 @@
eberthelmot,a0faa388,Ermengarde,Berthelmot,Accountant
kbunker,cc9b1c09,Kassi,Bunker,Production
mmccallum,81f11471,Moises,McCallum,Production
plune,0a52910c,Patrizio,Lune,Accountant
beverix,f0736efe,Blanch,Everix,Accountant
skibbel,f890d6d1,Stafani,Kibbel,Production
imosdell,a97cd2b8,Ignacius,Mosdell,Management
jwaller-bridge,9c43389e,Jeana,Waller-Bridge,Management
edressel,8831e520,Elroy,Dressel,Production
tstrettell,0bd22c22,Thea,Strettell,Production
sinsoll,91c81969,Solomon,Insoll,Accountant
cfeedome,be5d9acb,Carri,Feedome,Accountant
pchetwind,f60802f5,Padraic,Chetwind,Management
sd'ugo,8b6cd4c2,Solly,D'Ugo,Production
kmaccostigan,4114aff4,Konstanze,MacCostigan,Accountant
rpowlesland,05e19a95,Roxane,Powlesland,Management
okennealy,04f8d927,Orelle,Kennealy,Production
ssoitoux,9e931572,Sukey,Soitoux,Production
nsyce,29a54396,Nelli,Syce,Production
cshillam,8a394f6a,Clarisse,Shillam,Production
cgueny,6d30f53a,Carin,Gueny,Management
driepel,45db9a6b,Donny,Riepel,Production
dralfe,d14bcb76,Daniella,Ralfe,Production
lclynmans,98d3e926,Lexy,Clynmans,Production
gadamthwaite,4d6313a8,Gardiner,Adamthwaite,Production
wlippett,9423f972,Woodman,Lippett,Production
nmunnion,80f1c167,Nadya,Munnion,Production
lhabershon,67c2be97,Llewellyn,Habershon,Production
igreatrex,90715fb9,Isaak,Greatrex,Production
dfrostdyke,4abe7ab1,Darill,Frostdyke,Production
1 eberthelmot a0faa388 Ermengarde Berthelmot Accountant
2 kbunker cc9b1c09 Kassi Bunker Production
3 mmccallum 81f11471 Moises McCallum Production
4 plune 0a52910c Patrizio Lune Accountant
5 beverix f0736efe Blanch Everix Accountant
6 skibbel f890d6d1 Stafani Kibbel Production
7 imosdell a97cd2b8 Ignacius Mosdell Management
8 jwaller-bridge 9c43389e Jeana Waller-Bridge Management
9 edressel 8831e520 Elroy Dressel Production
10 tstrettell 0bd22c22 Thea Strettell Production
11 sinsoll 91c81969 Solomon Insoll Accountant
12 cfeedome be5d9acb Carri Feedome Accountant
13 pchetwind f60802f5 Padraic Chetwind Management
14 sd'ugo 8b6cd4c2 Solly D'Ugo Production
15 kmaccostigan 4114aff4 Konstanze MacCostigan Accountant
16 rpowlesland 05e19a95 Roxane Powlesland Management
17 okennealy 04f8d927 Orelle Kennealy Production
18 ssoitoux 9e931572 Sukey Soitoux Production
19 nsyce 29a54396 Nelli Syce Production
20 cshillam 8a394f6a Clarisse Shillam Production
21 cgueny 6d30f53a Carin Gueny Management
22 driepel 45db9a6b Donny Riepel Production
23 dralfe d14bcb76 Daniella Ralfe Production
24 lclynmans 98d3e926 Lexy Clynmans Production
25 gadamthwaite 4d6313a8 Gardiner Adamthwaite Production
26 wlippett 9423f972 Woodman Lippett Production
27 nmunnion 80f1c167 Nadya Munnion Production
28 lhabershon 67c2be97 Llewellyn Habershon Production
29 igreatrex 90715fb9 Isaak Greatrex Production
30 dfrostdyke 4abe7ab1 Darill Frostdyke Production

View File

@ -0,0 +1,8 @@
#!/bin/bash
scp ./createUsers.sh root@$1:/root
scp ./logins.csv root@$1:/root
ssh root@$1 "chmod -x /root/createUsers.sh"
ssh root@$1 "bash /root/createUsers.sh"
ssh root@$1 "rm /root/logins.csv"
ssh root@$1 "rm /root/createUsers.sh"
exit

View File

@ -0,0 +1 @@
Fifth practical work's folder, withholds Samba's configuration file and the script for remote deployment.

View File

@ -0,0 +1,18 @@
#!/bin/bash
while read line
do
touch ./temptp4.txt
file="./temptp4.txt"
echo $line > $file
user=$(cut -d "," -f 1 $file)
usergroup=$(cut -d "," -f 5 $file)
passwd=$(cut -d "," -f 2 $file)
if ! grep -q $usergroup /etc/group ; then
echo "Tentative de création du groupe"
groupadd "$usergroup"
fi
useradd $user -d /dev/null -s /bin/false
usermod -aG $usergroup $user
(echo $passwd ; echo $passwd) | smbpasswd -a $user
rm ./temptp4.txt
done < /root/files/logins.csv

285
siotp/sisr1/tp05/smb.conf Normal file
View File

@ -0,0 +1,285 @@
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
#======================= Global Settings =======================
[global]
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
; workgroup = monlabo.lan
#### Networking ####
# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
interfaces = enp0s8
# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
bind interfaces only = yes
#### Debugging/Accounting ####
# This tells Samba to use a separate log file for each machine
# that connects
; log file = /var/log/samba/log.%m
# Cap the size of the individual log files (in KiB).
; max log size = 1000
# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
; logging = file
# Do something sensible when Samba crashes: mail the admin a backtrace
; panic action = /usr/share/samba/panic-action %d
####### Authentication #######
# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
server role = standalone server
obey pam restrictions = no
# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes
# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = no
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user
########## Domains ###########
#
# The following settings only takes effect if 'server role = classic
# primary domain controller', 'server role = classic backup domain controller'
# or 'domain logons' is set
#
# It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U
# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd
# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/useradd --create-home %u
# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup --force-badname %g
############ Misc ############
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m
# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap config * : backend = tdb
; idmap config * : range = 3000-7999
; idmap config YOURDOMAINHERE : backend = tdb
; idmap config YOURDOMAINHERE : range = 100000-999999
; template shell = /bin/bash
# Setup usershare options to enable non-root users to share folders
# with the net usershare command.
# Maximum number of usershare. 0 means that usershare is disabled.
usershare max shares = 100
# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes
#======================= Share Definitions =======================
[homes]
comment = Home Directories
browseable = no
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0775
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0775
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
valid users = %S
# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700
[printers]
comment = All Printers
browseable = no
path = /var/tmp
printable = yes
guest ok = no
read only = yes
create mask = 0700
# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin
[sambademo]
comment = testing folder
path = /sambashare/test
browsable = yes
valid users = tester, @testing
read only = no
create mask = 0770
directory mask = 0770
write list = tester, @testing
[management]
comment = folder for management
path = /sambashare/management
browsable = yes
valid users = @Management
read only = yes
create mask = 0770
directory mask = 0770
write list = @Management
[accounting]
comment = folder for accounting
path = /sambashare/comptabilité
browsable = yes
valid users = @Management, @Accountant
read only = yes
create mask = 0770
directory mask = 0770
write list = @Accountant
[commun]
comment = common work folder
path = /sambashare/commun
browsable = yes
valid users = @Management, @Accountant, @Production
read only = yes
create mask = 0770
directory mask = 0770
write list = @Management, @Accountant, @Production
[production]
comment = folder for production team
path = /sambashare/production
browsable = yes
valid users = @Production, @Management, @Accountant
read only = yes
create mask = 0770
directory mask = 0770
write list = @Production

View File

@ -0,0 +1 @@
Sixth practical work's folder. Practical work on proxies with squid.

View File

@ -0,0 +1 @@
Files for the NAT replacement.

View File

@ -0,0 +1,7 @@
[Unit]
Description=Running port forwarding script on startup thanks to a systemd unit.
[Service]
Type=oneshot
ExecStart=/bin/bash /root/dnsfwd.sh
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,7 @@
#!/bin/bash
echo "1" > /proc/sys/net/ipv4/ip_forward
nft add table dnsfwd
nft add chain dnsfwd prerouting {type nat hook prerouting priority 0 \; }
nft add chain dnsfwd postrouting {type nat hook postrouting priority 0 \; }
nft add rule dnsfwd postrouting tcp dport 53 masquerade
nft add rule dnsfwd postrouting udp dport 53 masquerade

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
define netif = enp0s3
define dmzif = enp0s8
define lanif = enp0s9
table ip ipfilter {
chain routing {
type filter hook forward priority filter; policy accept;
icmp type echo-request iif { $netif, $dmzif } drop
icmp type { echo-reply, echo-request } accept
drop
}
chain system_in {
type filter hook input priority filter; policy accept;
icmp type echo-request iif { $netif, $dmzif } drop
}
}

View File

@ -0,0 +1,25 @@
define netif = enp0s3
define dmzif = enp0s8
define lanif = enp0s9
table ip ipfilter{
chain prerouting {
type filter hook prerouting priority filter; policy drop;
tcp dport 22 accept
}
chain system_in {
type filter hook input priority filter; policy drop;
tcp dport 22 accept
}
chain routing {
type filter hook forward priority filter; policy drop;
}
chain system_out {
type filter hook output priority filter; policy drop;
tcp sport 22 accept
}
chain postrouting {
type filter hook postrouting priority filter; policy drop;
tcp sport 22 accept
}
}

View File

@ -0,0 +1,42 @@
define netif = enp0s3
define dmzif = enp0s8
define lanif = enp0s9
define firewall = 192.168.0.120
define ipdmz = 172.16.0.254
define iplan = 10.0.0.254
table ip ipfilter{
chain prerouting {
type filter hook prerouting priority filter; policy drop;
icmp type echo-reply accept
icmp type echo-request iif {$lanif} ip daddr 172.16.0.1-172.16.0.254 accept
icmp type echo-request iif {$lanif} ip daddr {$iplan} accept
tcp dport 22 accept
}
chain system_in {
type filter hook input priority filter; policy drop;
icmp type echo-reply accept
icmp type echo-request iif {$lanif} accept
tcp dport 22 accept
}
chain routing {
type filter hook forward priority filter; policy drop;
icmp type echo-request iif {$lanif} oif {$dmzif} accept
icmp type echo-reply iif {$dmzif} oif {$lanif} accept
}
chain system_out {
type filter hook output priority filter; policy drop;
icmp type echo-reply oif {$lanif} accept
icmp type echo-request accept
tcp sport 22 accept
}
chain postrouting {
type filter hook postrouting priority filter; policy drop;
icmp type echo-request ip saddr {$iplan, $ipdmz, $firewall} accept
icmp type echo-reply iif {$dmzif} oif {$lanif} accept
icmp type echo-request iif {$lanif} oif {$dmzif} accept
icmp type echo-request ip saddr $iplan oif $lanif accept
tcp sport 22 accept
}
}

View File

@ -0,0 +1,68 @@
define netif = enp0s3
define dmzif = enp0s8
define lanif = enp0s9
define firewall = 192.168.0.120
define ipdmz = 172.16.0.254
define iplan = 10.0.0.254
table ip ipfilter{
chain prerouting {
type filter hook prerouting priority filter; policy drop;
icmp type echo-reply accept
ct state established, related accept
icmp type echo-request iif {$lanif} ip daddr 172.16.0.1-172.16.0.254 accept
icmp type echo-request iif {$lanif} ip daddr {$iplan} accept
tcp dport 20 accept
tcp dport 21 accept
tcp dport {80, 443} accept
tcp dport 22 accept
ip saddr 10.121.38.1 tcp dport {80, 443} accept
}
chain system_in {
type filter hook input priority filter; policy drop;
icmp type echo-reply accept
icmp type echo-request iif {$lanif} accept
ct state established, related accept
tcp dport 20 accept
tcp dport 21 accept
tcp dport {80, 443} accept
tcp dport 22 accept
ip saddr 10.121.38.1 tcp dport {80, 443} accept
}
chain routing {
type filter hook forward priority filter; policy drop;
icmp type echo-request iif {$lanif} oif {$dmzif} accept
icmp type echo-reply iif {$dmzif} oif {$lanif} accept
}
chain system_out {
type filter hook output priority filter; policy drop;
ip daddr 10.121.38.7-10.121.38.8 accept
ip daddr 10.121.38.1 tcp dport 8080 accept
icmp type echo-reply oif {$lanif} accept
icmp type echo-request accept
tcp dport 20 accept
tcp sport 20 accept
tcp dport 21 accept
tcp sport 21 accept
tcp dport {80, 443} accept
tcp sport {80, 443} accept
tcp sport 22 accept
}
chain postrouting {
type filter hook postrouting priority filter; policy drop;
ip daddr 10.121.38.7-10.121.38.8 accept
ip daddr 10.121.38.1 tcp dport 8080 accept
icmp type echo-request ip saddr {$iplan, $ipdmz, $firewall} accept
icmp type echo-reply iif {$dmzif} oif {$lanif} accept
icmp type echo-request iif {$lanif} oif {$dmzif} accept
icmp type echo-request ip saddr $iplan oif $lanif accept
tcp dport 20 accept
tcp sport 20 accept
tcp dport 21 accept
tcp sport 21 accept
tcp dport {80, 443} accept
tcp sport {80, 443} accept
tcp sport 22 accept
}
}

View File

@ -0,0 +1,25 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.0.120
gateway 192.168.0.1
pre-up bash /root/scriptsnft/refresh_firewall.sh
# Second network interface : DMZ
allow-hotplug enp0s8
iface enp0s8 inet static
address 172.16.0.254/24
# Third network interface : LAN
allow-hotplug enp0s9
iface enp0s9 inet static
address 10.0.0.254/24

View File

@ -0,0 +1,3 @@
Acquire::http::Proxy "http://10.121.38.1:8080/";
Acquire::https::Proxy "http://10.121.38.1:8080/";

View File

@ -0,0 +1,7 @@
#!/bin/bash
# active le routage entre les interfaces réseau du firewall
echo "1" > /proc/sys/net/ipv4/ip_forward
#vide les règles actuelles du pare-feu
nft flush ruleset
#charge les règles du pare-feu présentes dans le fichier
nft -f /root/scriptsnft/current_ruleset.nft

View File

@ -0,0 +1,4 @@
domain sio.lan
search sio.lan
nameserver 10.121.38.7
nameserver 10.121.38.8

View File

@ -0,0 +1,14 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet static
address 10.0.0.1/24
gateway 10.0.0.254

View File

@ -0,0 +1,4 @@
domain sio.lan
search sio.lan
nameserver 10.121.38.7
nameserver 10.121.38.8

View File

@ -0,0 +1,14 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.0.121
gateway 192.168.0.120

View File

@ -0,0 +1,4 @@
domain sio.lan
search sio.lan
nameserver 10.121.38.7
nameserver 10.121.38.8

View File

@ -0,0 +1,14 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet static
address 172.16.0.1/24
gateway 172.16.0.254

View File

@ -0,0 +1,4 @@
domain sio.lan
search sio.lan
nameserver 10.121.38.7
nameserver 10.121.38.8