j'ai faim putaaaaaain

This commit is contained in:
DylanVsn 2019-11-14 12:51:11 +01:00
parent 7a8af5aee4
commit e0adc1e19e
4 changed files with 175 additions and 15 deletions

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
if [ $(id -u) != 0 ]; then #if [ $(id -u) != 0 ]; then
setxkbmap fr bepo -option ctrl:nocaps # setxkbmap fr bepo -option ctrl:nocaps
xset r rate 200 30 # xset r rate 200 30
exit 0 # exit 0
fi #fi
sysctl -w net.ipv4.ip_forward=1 sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv6.conf.all.forwarding=1 sysctl -w net.ipv6.conf.all.forwarding=1
@ -20,8 +20,8 @@ case $(hostname) in
vm1) vm1)
ip address add 172.16.2.131/28 dev eth1 ip address add 172.16.2.131/28 dev eth1
ip address add 172.16.2.151/28 dev eth2 ip address add 172.16.2.151/28 dev eth2
ip route add $lan2 via 172.16.2.132 ip route add $lan2 via 172.16.2.156 #132
ip route add $lan4 via 172.16.2.132 ip route add $lan4 via 172.16.2.156 #132
;; ;;
vm2) vm2)
ip address add 172.16.2.132/28 dev eth1 ip address add 172.16.2.132/28 dev eth1
@ -32,16 +32,17 @@ case $(hostname) in
vm3) vm3)
ip address add 172.16.2.163/28 dev eth1 ip address add 172.16.2.163/28 dev eth1
ip address add 172.16.2.183/28 dev eth2 ip address add 172.16.2.183/28 dev eth2
ip route add $lan1 via 172.16.2.162 ip route add $lan1 via 172.16.2.186 #162
ip route add $lan3 via 172.16.2.162 ip route add $lan3 via 172.16.2.186 #162
;; ;;
vm1-6) vm1-6)
ip address add 172.16.2.156/28 dev eth1 ip address add 172.16.2.156/28 dev eth1
ip address add fc00:1234:1::16/64 dev eth2 ip address add fc00:1234:1::16/64 dev eth2
ip route add $lan2_6 via fc00:1234:1::26 ip route add $lan2_6 via fc00:1234:1::26
ip route add $lan1 via 172.16.2.151 #ip route add $lan1 via 172.16.2.151
ip route add $lan2 via 172.16.2.151 #ip route add $lan2 via 172.16.2.151
ip route add $lan4 via 172.16.2.151 #ip route add $lan4 via 172.16.2.151
#ip route add $lan4 dev tun0
;; ;;
vm2-6) vm2-6)
ip address add fc00:1234:1::26/64 dev eth1 ip address add fc00:1234:1::26/64 dev eth1
@ -51,9 +52,10 @@ case $(hostname) in
ip address add fc00:1234:2::36/64 dev eth1 ip address add fc00:1234:2::36/64 dev eth1
ip address add 172.16.2.186/28 dev eth2 ip address add 172.16.2.186/28 dev eth2
ip route add $lan1_6 via fc00:1234:2::26 ip route add $lan1_6 via fc00:1234:2::26
ip route add $lan1 via 172.16.2.183 #ip route add $lan1 via 172.16.2.183
ip route add $lan2 via 172.16.2.183 #ip route add $lan2 via 172.16.2.183
ip route add $lan3 via 172.16.2.183 #ip route add $lan3 via 172.16.2.183
#ip route add $lan3 dev tun0
;; ;;
*) *)
echo "Nom dhôte non reconu." echo "Nom dhôte non reconu."

View File

@ -1,3 +1,11 @@
#!/bin/sh #!/bin/sh
ip l set "$1" up ip l set "$1" up
ip a a "$2" dev tun0 ip a a "$2" dev tun0
case $(hostname) in
vm1-6)
ip r add 172.16.2.176/28 dev tun0
;;
vm3-6)
ip r add 172.16.2.144/28 dev tun0
;;
esac

125
partage/ip_a.txt Normal file
View File

@ -0,0 +1,125 @@
vm1
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:f8:33:b7 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fef8:33b7/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:f2:3f:76 brd ff:ff:ff:ff:ff:ff
inet 172.16.2.131/28 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fef2:3f76/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:55:f9:e8 brd ff:ff:ff:ff:ff:ff
inet 172.16.2.151/28 scope global eth2
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe55:f9e8/64 scope link
valid_lft forever preferred_lft forever
vm3
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:f8:33:b7 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fef8:33b7/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:1a:58:5d brd ff:ff:ff:ff:ff:ff
inet 172.16.2.163/28 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe1a:585d/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:9e:2f:c0 brd ff:ff:ff:ff:ff:ff
inet 172.16.2.183/28 scope global eth2
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe9e:2fc0/64 scope link
valid_lft forever preferred_lft forever
vm1-6
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:f8:33:b7 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fef8:33b7/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:1c:5a:8f brd ff:ff:ff:ff:ff:ff
inet 172.16.2.156/28 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe1c:5a8f/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:03:01:a9 brd ff:ff:ff:ff:ff:ff
inet6 fc00:1234:1::16/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe03:1a9/64 scope link
valid_lft forever preferred_lft forever
vm2-6
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:f8:33:b7 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fef8:33b7/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:95:de:c7 brd ff:ff:ff:ff:ff:ff
inet6 fc00:1234:1::26/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe95:dec7/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:60:11:c6 brd ff:ff:ff:ff:ff:ff
inet6 fc00:1234:2::26/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe60:11c6/64 scope link
valid_lft forever preferred_lft forever
vm3-6
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:f8:33:b7 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fef8:33b7/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:c8:7b:cc brd ff:ff:ff:ff:ff:ff
inet6 fc00:1234:2::36/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fec8:7bcc/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:cb:8c:38 brd ff:ff:ff:ff:ff:ff
inet 172.16.2.186/28 scope global eth2
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fecb:8c38/64 scope link
valid_lft forever preferred_lft forever

25
partage/ip_r.txt Normal file
View File

@ -0,0 +1,25 @@
vm1
default via 10.0.2.2 dev eth0
10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15
172.16.2.128/28 dev eth1 proto kernel scope link src 172.16.2.131
172.16.2.144/28 dev eth2 proto kernel scope link src 172.16.2.151
172.16.2.160/28 via 172.16.2.156 dev eth2
172.16.2.176/28 via 172.16.2.156 dev eth2
vm3
default via 10.0.2.2 dev eth0
10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15
172.16.2.128/28 via 172.16.2.186 dev eth2
172.16.2.144/28 via 172.16.2.186 dev eth2
172.16.2.160/28 dev eth1 proto kernel scope link src 172.16.2.163
172.16.2.176/28 dev eth2 proto kernel scope link src 172.16.2.183
vm1-6
default via 10.0.2.2 dev eth0
10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15
172.16.2.144/28 dev eth1 proto kernel scope link src 172.16.2.156
vm2-6
default via 10.0.2.2 dev eth0
10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15
vm3-6
default via 10.0.2.2 dev eth0
10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15
172.16.2.176/28 dev eth2 proto kernel scope link src 172.16.2.186