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; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
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";
zone "au-team.irpo" {
@ -37,10 +43,10 @@ type master;
file "master/4.168.192.in-addr.arpa";
};
zone "4.16.172.in-addr.arpa" {
type master;
file "4.16.172.in-addr.arpa";
};
#zone "4.16.172.in-addr.arpa" {
#type master;
#file "4.16.172.in-addr.arpa";
#};
EOF

21
int
View file

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