tuto2: wg working
This commit is contained in:
parent
cd848e3ff6
commit
33f0698f1e
9 changed files with 196 additions and 30 deletions
|
@ -2,10 +2,13 @@ FROM debian
|
|||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
busybox \
|
||||
ca-certificates \
|
||||
console-data \
|
||||
cron \
|
||||
curl \
|
||||
ifupdown \
|
||||
kbd \
|
||||
kmod \
|
||||
nano \
|
||||
openssh-server \
|
||||
python \
|
||||
|
@ -15,10 +18,13 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
|||
vim.tiny \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl -L -o /tmp/wireguard.deb http://httpredir.debian.org/debian/pool/main/w/wireguard/wireguard-tools_0.0.20190227-1_amd64.deb && dpkg -i /tmp/wireguard.deb; rm /tmp/wireguard.deb
|
||||
|
||||
RUN rm -rf /etc/init.d/ && \
|
||||
mkdir /overlay && \
|
||||
ln -sf /init /sbin/init && \
|
||||
ln -sf /lib/systemd/system/systemd-netwkord.service /etc/systemd/system/multi-user.target.wants/systemd-networkd.service
|
||||
|
||||
COPY default.script /etc/udhcpc/default.script
|
||||
COPY issue /etc/issue
|
||||
COPY sshd_config /etc/ssh/sshd_config
|
||||
|
|
60
pkg/debian-tuto2/default.script
Executable file
60
pkg/debian-tuto2/default.script
Executable file
|
@ -0,0 +1,60 @@
|
|||
#!/bin/sh
|
||||
# Busybox udhcpc dispatcher script. Copyright (C) 2009 by Axel Beckert.
|
||||
#
|
||||
# Based on the busybox example scripts and the old udhcp source
|
||||
# package default.* scripts.
|
||||
|
||||
RESOLV_CONF="/etc/resolv.conf"
|
||||
|
||||
case $1 in
|
||||
bound|renew)
|
||||
/bin/ip address add dev $interface $ip/$subnet
|
||||
|
||||
if [ -n "$router" ]; then
|
||||
echo "$0: Resetting default routes"
|
||||
while /bin/ip route del default via 0.0.0.0 dev $interface; do :; done
|
||||
|
||||
metric=0
|
||||
for i in $router; do
|
||||
/bin/ip route add default via $i dev $interface metric $metric
|
||||
metric=$(($metric + 1))
|
||||
done
|
||||
fi
|
||||
|
||||
# Update resolver configuration file
|
||||
R=""
|
||||
[ -n "$domain" ] && R="domain $domain
|
||||
"
|
||||
for i in $dns; do
|
||||
echo "$0: Adding DNS $i"
|
||||
R="${R}nameserver $i
|
||||
"
|
||||
done
|
||||
|
||||
if [ -x /sbin/resolvconf ]; then
|
||||
echo -n "$R" | resolvconf -a "${interface}.udhcpc"
|
||||
else
|
||||
echo -n "$R" > "$RESOLV_CONF"
|
||||
fi
|
||||
;;
|
||||
|
||||
deconfig)
|
||||
if [ -x /sbin/resolvconf ]; then
|
||||
resolvconf -d "${interface}.udhcpc"
|
||||
fi
|
||||
/bin/ip a del dev $interface
|
||||
;;
|
||||
|
||||
leasefail)
|
||||
echo "$0: Lease failed: $message"
|
||||
;;
|
||||
|
||||
nak)
|
||||
echo "$0: Received a NAK: $message"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "$0: Unknown udhcpc command: $1";
|
||||
exit 1;
|
||||
;;
|
||||
esac
|
30
pkg/debian-tuto2/isolinux.cfg
Normal file
30
pkg/debian-tuto2/isolinux.cfg
Normal file
|
@ -0,0 +1,30 @@
|
|||
DEFAULT vesamenu.c32
|
||||
|
||||
MENU RESOLUTION 1024 768
|
||||
|
||||
menu background #00000000 * *
|
||||
menu color title * #FF22BBCC *
|
||||
menu color sel * #FFFFFFFF #FF22BBCC *
|
||||
menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *
|
||||
menu tabmsg Press ENTER to boot or TAB to edit a menu entry
|
||||
|
||||
prompt 0
|
||||
timeout 0
|
||||
|
||||
menu title Welcome to the EPITA ADvanced LINux administration course!
|
||||
|
||||
LABEL tutorial-nohdd
|
||||
MENU LABEL ^Erase my first drive if necessary, then enter tutorial
|
||||
KERNEL /boot/kernel
|
||||
APPEND <CMDLINE> adlin.format=/dev/sda root=/dev/sda1 root=/dev/sr0
|
||||
|
||||
LABEL tutorial-hdd
|
||||
MENU LABEL Enter tutorial without erasing ^disk
|
||||
KERNEL /boot/kernel
|
||||
APPEND <CMDLINE> root=/dev/sda1 root=/dev/sr0
|
||||
|
||||
MENU SEPARATOR
|
||||
|
||||
LABEL poweroff
|
||||
MENU LABEL ^Shutdown
|
||||
KERNEL poweroff.c32
|
|
@ -11,7 +11,7 @@
|
|||
# default value.
|
||||
|
||||
#Port 22
|
||||
#AddressFamily any
|
||||
AddressFamily inet
|
||||
#ListenAddress 0.0.0.0
|
||||
#ListenAddress ::
|
||||
|
||||
|
|
Reference in a new issue