diff --git a/dhcp b/dhcp index 6ac33d0..20e5835 100755 --- a/dhcp +++ b/dhcp @@ -5,7 +5,7 @@ read -p "Введите подсеть(192.168.4.0): " Q read -p "Введите маску(29): " E read -p "Введите dns сервер(192.168.3.2): " R read -p "Введите шлюз(192.168.4.1): " T -read -p "Введите ip-адрес br-srv(192.168.2.2): " B +read -p "Введите ip-адрес BR-SRV: " B if (( $E == 2 )); then E=192.0.0.0 elif (( $E == 3 )); then @@ -77,6 +77,7 @@ authoritative; subnet $Q netmask $E { range $S $K; option domain-name-servers $R, $B; + option domain-name "au-team.irpo"; option subnet-mask $E; option routers $T; } diff --git a/ospf_brr b/ospf_brr index a899a53..8214817 100755 --- a/ospf_brr +++ b/ospf_brr @@ -1,6 +1,6 @@ #!bin/bash -read -p "Введите id роутера(1.1.1.1): " r_id +read -p "Введите id роутера(2.2.2.2): " r_id read -p "Введите подсеть для enp0s3 (172.16.5.0/28): " ip_s3 read -p "Введите подсеть для enp0s8(192.168.2.0/27): " ip_s8 read -p "Введите подсеть для туннеля(192.168.9.0/30): " ip_tun @@ -54,7 +54,7 @@ interface enp0s8 ip ospf authentication message-digest ip ospf message-digest-key 1 md5 1 ! -line vty +line vtysh ! EOF diff --git a/ospf_hqr b/ospf_hqr index cc97b74..2dc5ca9 100755 --- a/ospf_hqr +++ b/ospf_hqr @@ -2,9 +2,10 @@ read -p "Введите имя(HQ-RTR): " name read -p "Input name for tunnel(gre1): " tun -read -p "Введите id роутера(2.2.2.2): " r_id +read -p "Введите id роутера(1.1.1.1): " r_id read -p "Введите подсеть для enp0s3(172.16.4.0/28): " ip_s3 -read -p "Введите подсеть для enp0s8(192.168.3.0/26): " ip_s8 +read -p "Введите подсеть для HQ-SRV(192.168.3.0/26): " ip_s8 +read -p "Введите подсеть для HQ-CLI(192.168.4.0/29): " ip_s9 read -p "Введите подсеть туннеля(192.168.9.0/30): " ip_tun cat > /etc/frr/daemons << EOF bgpd=no @@ -42,6 +43,7 @@ router ospf passive-interface default network $ip_s3 area 0 network $ip_s8 area 0 + network $ip_s9 area 0 network $ip_tun area 0 exit ! diff --git a/tunel b/tunel index c84393d..de9d9cb 100755 --- a/tunel +++ b/tunel @@ -10,5 +10,5 @@ ip tunnel add $name mode gre local $l_ip remote $r_ip ttl 64 dev enp0s3 ip addr add $t_ip dev $name ip link set $name up -echo "Введите nmcli connection modify "$name" ip-tunnel.ttl 64" +nmcli connection modify "gre1" connection.autoconnect yes systemctl restart NetworkManager diff --git a/vm b/vm new file mode 100755 index 0000000..6b66242 --- /dev/null +++ b/vm @@ -0,0 +1,32 @@ +#!/bin/bash +if [ -z "$1" ]; then + VBoxManage clonevm "ORI" --name "ISP" --register + VBoxManage clonevm "ORI" --name "HQ-RTR" --register + VBoxManage modifyvm "HQ-RTR" --nic1 intnet --intnet1 "intnet" + VBoxManage clonevm "ORI" --name "BR-RTR" --register + VBoxManage modifyvm "BR-RTR" --nic1 intnet --intnet1 "intnet" + VBoxManage modifyvm "BR-RTR" --nic3 none --nic4 none + VBoxManage clonevm "ORI" --name "HQ-SRV" --register + VBoxManage modifyvm "HQ-SRV" --nic1 intnet --intnet1 "intnet" + VBoxManage modifyvm "HQ-SRV" --nic2 none --nic3 none --nic4 none + VBoxManage clonevm "ORI" --name "HQ-CLI" --register + VBoxManage modifyvm "HQ-CLI" --nic1 intnet --intnet1 "intnet" + VBoxManage modifyvm "HQ-CLI" --nic2 none --nic3 none --nic4 none + VBoxManage clonevm "ORI" --name "BR-SRV" --register + 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" poweroff + VBoxManage unregistervm "ISP" --delete + VBoxManage controlvm "HQ-RTR" poweroff + VBoxManage unregistervm "HQ-RTR" --delete + VBoxManage controlvm "BR-RTR" poweroff + VBoxManage unregistervm "BR-RTR" --delete + VBoxManage controlvm "BR-SRV" poweroff + VBoxManage unregistervm "BR-SRV" --delete + VBoxManage controlvm "HQ-SRV" poweroff + VBoxManage unregistervm "HQ-SRV" --delete + VBoxManage controlvm "HQ-CLI" poweroff + VBoxManage unregistervm "HQ-CLI" --delete +fi