This commit is contained in:
root 2026-03-19 13:05:52 +05:00
parent 380b10c9dd
commit 63505ff351
2 changed files with 21 additions and 18 deletions

18
dns
View file

@ -14,12 +14,18 @@ options {
forwarders { 8.8.8.8; }; forwarders { 8.8.8.8; };
}; };
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN { zone "." IN {
type hint; type hint;
file "var/named/named.ca"; file "named.ca";
}; };
include "/etc/named.rfcq912.zones"; include "/etc/named.rfc1912.zones";
include "/etc/named.root.key"; include "/etc/named.root.key";
zone "au-team.irpo" { zone "au-team.irpo" {
@ -37,10 +43,10 @@ type master;
file "master/4.168.192.in-addr.arpa"; file "master/4.168.192.in-addr.arpa";
}; };
zone "4.16.172.in-addr.arpa" { #zone "4.16.172.in-addr.arpa" {
type master; #type master;
file "4.16.172.in-addr.arpa"; #file "4.16.172.in-addr.arpa";
}; #};
EOF EOF

21
int
View file

@ -11,7 +11,7 @@ while a==1
echo "3. IP-адрес" echo "3. IP-адрес"
echo "4. Forward и masquerade" echo "4. Forward и masquerade"
echo "5. Перезагрузить машину" echo "5. Перезагрузить машину"
echo "6. Аккаунты" echo "6. Time zone"
echo "0. Выход" echo "0. Выход"
echo "" echo ""
read num read num
@ -30,7 +30,7 @@ while a==1
echo "_____________________Enp0s3_______________________" echo "_____________________Enp0s3_______________________"
read -p "Введите ip-адрес или пропустите для DHCP: " ip_s3 read -p "Введите ip-адрес или пропустите для DHCP: " ip_s3
if [[ -n $ip_s3 ]]; then if [[ -n $ip_s3 ]]; then
read -p "Введите шлюз: " gt_s3 read -p "Введите шлюз или пропустите: " gt_s3
cat > /etc/NetworkManager/system-connections/enp0s3.nmconnection << EOF cat > /etc/NetworkManager/system-connections/enp0s3.nmconnection << EOF
[connection] [connection]
id=enp0s3 id=enp0s3
@ -73,7 +73,7 @@ EOF
fi fi
echo "" echo ""
echo "___________________________Enp0s10___________________________" echo "___________________________Enp0s10___________________________"
read -p "Enter ip or skip: " ip_s10 read -p "Введите ip-адрес или пропустите: " ip_s10
if [[ -n $ip_s10 ]]; then if [[ -n $ip_s10 ]]; then
nmcli connection modify enp0s10 ipv4.method manual ipv4.addresses $ip_s10 ipv6.method disabled nmcli connection modify enp0s10 ipv4.method manual ipv4.addresses $ip_s10 ipv6.method disabled
systemctl restart NetworkManager systemctl restart NetworkManager
@ -86,11 +86,12 @@ EOF
sysctl net.ipv4.ip_forward=1 >> /etc/sysctl.conf sysctl net.ipv4.ip_forward=1 >> /etc/sysctl.conf
systemctl enable --now iptables systemctl enable --now iptables
iptables -F iptables -F
read -p "Введите количество ip-адресов для Masquerade: " a read -p "Введите количество ip-адресов для которых необходимо задать Masquerade: " a
if (( $a == 2 )); then if (( $a == 2 )); then
if [[ -n $ip_s8 || $ip_s9 ]]; then if [[ -n $ip_s8 || $ip_s9 ]]; then
iptables -t nat -A POSTROUTING -s $ip_s8 -o enp0s3 -j MASQUERADE iptables -t nat -A POSTROUTING -s $ip_s8 -o enp0s3 -j MASQUERADE
iptables -t nat -A POSTROUTING -s $ip_s9 -o enp0s3 -j MASQUERADE iptables -t nat -A POSTROUTING -s $ip_s9 -o enp0s3 -j MASQUERADE
echo "Готово"
else else
read -p "Введите ip-адрес для enp0s8(192.168.0.0/30): " ip_s8 read -p "Введите ip-адрес для enp0s8(192.168.0.0/30): " ip_s8
read -p "Введите ip-адрес для enp0s9(192.168.0.0/30): " ip_s9 read -p "Введите ip-адрес для enp0s9(192.168.0.0/30): " ip_s9
@ -100,6 +101,7 @@ EOF
elif (( $a == 1)); then elif (( $a == 1)); then
if [[ -n $ip_s8 ]]; then if [[ -n $ip_s8 ]]; then
iptables -t nat -A POSTROUTING -s $ip_s8 -o enp0s3 -j MASQUERADE iptables -t nat -A POSTROUTING -s $ip_s8 -o enp0s3 -j MASQUERADE
echo "Готово"
else else
read -p "Введите ip для enp0s8: " ip_s8 read -p "Введите ip для enp0s8: " ip_s8
iptables -t nat -A POSTROUTING -s $ip_s8 -o enp0s3 -j MASQUERADE iptables -t nat -A POSTROUTING -s $ip_s8 -o enp0s3 -j MASQUERADE
@ -126,14 +128,9 @@ EOF
echo"" echo""
elif (( $num == 6)); then elif (( $num == 6)); then
echo "________________________Аккаунт_________________________" echo "For watch time zone inter: timedatectl list-timezones"
read -p "Yes or no?: " acc echo "Inter timedatectl set-timezone 'timezone' "
if [[ -n $acc ]]; then
read -p "Введите имя аккаунта: " acc_n
cat >> /etc/sudoers << EOF
$acc_n ALL=(ALL)NOPASSWD:ALL
EOF
chmod 600 /etc/sudoers chmod 600 /etc/sudoers
fi fi
fi
done done