sad
This commit is contained in:
parent
748bede324
commit
45d8332c45
3
dhcp
3
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;
|
||||
}
|
||||
|
|
|
|||
4
ospf_brr
4
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
|
||||
|
||||
|
|
|
|||
6
ospf_hqr
6
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
|
||||
!
|
||||
|
|
|
|||
2
tunel
2
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
|
||||
|
|
|
|||
32
vm
Executable file
32
vm
Executable file
|
|
@ -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
|
||||
Loading…
Reference in a new issue