diff --git a/dhcp b/dhcp index 20e5835..59c0f86 100755 --- a/dhcp +++ b/dhcp @@ -1,4 +1,5 @@ #!/bin/bash +read -p "Ввеедите интерфейс(v200): " In read -p "Введите начало диапазона(192.168.4.2): " S read -p "Введите конец диапазона(192.168.4.6): " K read -p "Введите подсеть(192.168.4.0): " Q @@ -93,7 +94,7 @@ EOF chmod 600 /etc/dhcp/dhcpd.conf cat > /etc/sysconfig/dhcpd << EOF -DHCPDARGS="enp0s8" +DHCPDARGS="$In" EOF echo "_________________Перезагрузка и старт dncpd________________________" diff --git a/dns b/dns index da21ce6..810f9d6 100755 --- a/dns +++ b/dns @@ -30,7 +30,7 @@ options { recursing-file "/var/named/data/named.recursing"; allow-query { any; }; forward first; - forwarders { 8.8.8.8; 5.255.255.242; }; + forwarders { 77.88.8.8; 8.8.8.8; }; allow-transfer { $brs; }; }; @@ -58,15 +58,21 @@ type master; file "master/3.168.192.in-addr.arpa"; }; -zone "4.168.192.in-addr.arpa" { +zone "2.168.192.in-addr.arpa" { type master; -file "master/4.168.192.in-addr.arpa"; +file "master/2.168.192.in-addr.arpa"; }; -zone "4.16.172.in-addr.arpa" { -type master; -file "master/4.16.172.in-addr.arpa"; -}; +#zone "4.168.192.in-addr.arpa" { +#type master; +#file "master/4.168.192.in-addr.arpa"; +#}; + +#zone "4.16.172.in-addr.arpa" { +#type master; +#file "master/4.16.172.in-addr.arpa"; +#}; + EOF @@ -139,6 +145,11 @@ cat > /var/named/master/4.16.172.in-addr.arpa << EOF 2 IN PTR hq-rtr.au-team.irpo. EOF +# Zone for BR-SRV +#cat > /var/named/master/2.168.192.in-addr.arpa << EOF +#\$TTL 604800 ; +#@ IN SOA + read -p "Resolution?: " res if [[ -n $res ]]; then chown -R root:named /var/named/master diff --git a/ospf_brr b/ospf_brr index 8214817..53e70e0 100755 --- a/ospf_brr +++ b/ospf_brr @@ -34,6 +34,7 @@ no ipv6 forwarding ! interface $tun no ip ospf passive +ip ospf mtu-ignore exit ! router ospf @@ -48,13 +49,13 @@ exit interface gre1 ip ospf network point-to-point ip ospf authentication message-digest - ip ospf message-digest-key 1 md5 1 + ip ospf message-digest-key 1 md5 P@ssw0rd ! interface enp0s8 ip ospf authentication message-digest - ip ospf message-digest-key 1 md5 1 + ip ospf message-digest-key 1 md5 P@ssw0rd ! -line vtysh +line vty ! EOF diff --git a/ospf_hqr b/ospf_hqr index 2dc5ca9..30a756b 100755 --- a/ospf_hqr +++ b/ospf_hqr @@ -35,6 +35,7 @@ no ipv6 forwarding ! interface $tun no ip ospf passive +ip ospf mtu-ignore exit ! router ospf @@ -50,19 +51,19 @@ exit interface gre1 ip ospf network point-to-point ip ospf authentication message-digest - ip ospf message-digest-key 1 md5 1 + ip ospf message-digest-key 1 md5 P@ssw0rd ! interface enp0s8 ip ospf authentication message-digest - ip ospf message-digest-key 1 md5 1 + ip ospf message-digest-key 1 md5 P@ssw0rd ! interface enp0s9 ip ospf authentication message-digest - ip ospf message-digest-key 1 md5 1 + ip ospf message-digest-key 1 md5 P@ssw0rd ! interface enp0s10 ip ospf authentication message-digest - ip ospf message-digest-key 1 md5 1 + ip ospf message-digest-key 1 md5 P@ssw0rd ! line vty ! diff --git a/usr b/usr index c47008f..4d80131 100755 --- a/usr +++ b/usr @@ -2,14 +2,15 @@ # Задание 3, Модуль 1 (HQ-SRV / BR-SRV) read -p "Введите логин: " L read -p "Введите пароль: " P - +read -p "Введите id полльзоваелья: " I +read -p " Введите port: " Po [ $EUID -ne 0 ] && echo "Требуется root" && exit 1 # 1. Пользователь remote_user useradd -m remote_user 2>/dev/null -# 2. Пользователь sshuser (UID 2026, пароль P@ssw0rd) -useradd -u 2026 -m $L 2>/dev/null +# 2. Пользователь sshuser +useradd -u $I -m $L 2>/dev/null echo "$L:$P" | chpasswd # 3. Sudo без пароля для sshuser @@ -17,7 +18,7 @@ echo "$L ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers chmod 440 /etc/sudoers cat > /etc/ssh/sshd_config << EOF -Port 2026 +Port $Po AllowUsers $L MaxAuthTries 2 EOF @@ -28,8 +29,11 @@ SELINUX=targeted EOF touch /etc/ssh/ban +echo "----------------------------------------------------------------------------------------------------------------------------------------" +echo "" echo "Authorized access only" > /etc/ssh/ban - +echo "" +echo "-------------------------------------------------------------------------------------------------------------------------------------------------------" echo "Banner /etc/ssh/ban" >> /etc/ssh/sshd_config systemctl restart sshd @@ -37,3 +41,5 @@ echo "Готово" echo "" echo "Имя: $L" echo "Пароль: $P" +echo "ID: $I " +echo "Port $Po" diff --git a/vm b/vm index 520d813..f2b4e0c 100755 --- a/vm +++ b/vm @@ -1,38 +1,36 @@ #!/bin/bash -#VBoxManage unregistervm "origin" -#VBoxManage registervm "/user4b_1/origin/origin.vbox" - - if [ -z "$1" ]; then - VBoxManage clonevm "origin" --name "ISP" --register --basefolder "/user4b_1" --options=keepallmacs - VBoxManage clonevm "origin" --name "HQ-RTR" --register --basefolder "/user4b_1" --options=keepallmacs + read -p "Введите путиь(/mnt/disk/user_4b1): " P + + VBoxManage clonevm "origin" --name "ISP" --register --basefolder "$P" + VBoxManage clonevm "origin" --name "HQ-RTR" --register --basefolder "$P" VBoxManage modifyvm "HQ-RTR" --nic1 intnet --intnet1 "intnet" - VBoxManage clonevm "origin" --name "BR-RTR" --register --basefolder "/user4b_1" --options=keepallmacs + VBoxManage clonevm "origin" --name "BR-RTR" --register --basefolder "$P" VBoxManage modifyvm "BR-RTR" --nic1 intnet --intnet1 "intnet" VBoxManage modifyvm "BR-RTR" --nic3 none --nic4 none - VBoxManage clonevm "origin" --name "HQ-SRV" --register --basefolder "/user4b_1" --options=keepallmacs + VBoxManage clonevm "origin" --name "HQ-SRV" --register --basefolder "$P" VBoxManage modifyvm "HQ-SRV" --nic1 intnet --intnet1 "intnet" VBoxManage modifyvm "HQ-SRV" --nic2 none --nic3 none --nic4 none - VBoxManage clonevm "origin" --name "HQ-CLI" --register --basefolder "/user4b_1" --options=keepallmacs + VBoxManage clonevm "origin" --name "HQ-CLI" --register --basefolder "$P" VBoxManage modifyvm "HQ-CLI" --nic1 intnet --intnet1 "intnet" VBoxManage modifyvm "HQ-CLI" --nic2 none --nic3 none --nic4 none - VBoxManage clonevm "origin" --name "BR-SRV" --register --basefolder "/user4b_1" --options=keepallmacs + VBoxManage clonevm "origin" --name "BR-SRV" --register --basefolder "$P" VBoxManage modifyvm "BR-SRV" --nic1 intnet --intnet1 "intnet" VBoxManage modifyvm "BR-SRV" --nic2 none --nic3 none --nic4 none elif [[ $1 == "--del" ]]; then - VBoxManage controlvm "ISP" acpipowerbutton + VBoxManage controlvm "ISP" poweroff VBoxManage unregistervm "ISP" --delete - VBoxManage controlvm "HQ-RTR" acpipowerbutton + VBoxManage controlvm "HQ-RTR" poweroff VBoxManage unregistervm "HQ-RTR" --delete - VBoxManage controlvm "BR-RTR" acpipowerbutton + VBoxManage controlvm "BR-RTR" poweroff VBoxManage unregistervm "BR-RTR" --delete - VBoxManage controlvm "BR-SRV" acpipowerbutton + VBoxManage controlvm "BR-SRV" poweroff VBoxManage unregistervm "BR-SRV" --delete - VBoxManage controlvm "HQ-SRV" acpipowerbutton + VBoxManage controlvm "HQ-SRV" poweroff VBoxManage unregistervm "HQ-SRV" --delete - VBoxManage controlvm "HQ-CLI" acpipowerbutton + VBoxManage controlvm "HQ-CLI" poweroff VBoxManage unregistervm "HQ-CLI" --delete elif [[ $1 == "--set" ]]; then