net/ospf_hqr
2026-03-23 15:42:06 +03:00

82 lines
1.6 KiB
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!bin/bash
read -p "Введите имя(HQ-RTR): " name
read -p "Input name for tunnel(gre1): " tun
read -p "Введите id роутера(2.2.2.2): " r_id
read -p "Введите подсеть для enp0s3(172.16.4.0/28): " ip_s3
read -p "Введите подсеть для enp0s8(192.168.3.0/26): " ip_s8
read -p "Введите подсеть туннеля(192.168.9.0/30): " ip_tun
cat > /etc/frr/daemons << EOF
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no
pimd=no
pim6d=no
nhrpd=no
eigrpd=no
babeld=no
sharpd=no
pbrd=no
bfdd=no
fabricd=no
vrrpd=no
pathd=no
EOF
cat > /etc/frr/frr.conf << EOF
frr version 10.1.2
frr defaults traditional
hostname $name
no ipv6 forwarding
!
interface $tun
no ip ospf passive
exit
!
router ospf
ospf router-id $r_id
area 0 authentication message-digest
passive-interface default
network $ip_s3 area 0
network $ip_s8 area 0
network $ip_tun area 0
exit
!
interface gre1
ip ospf network point-to-point
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 1
!
interface enp0s8
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 1
!
interface enp0s9
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 1
!
interface enp0s10
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 1
!
line vty
!
EOF
chmod 600 /etc/frr/frr.conf
echo ""
echo "__________________________Старт и перезагрузка frr_____________________________"
systemctl restart frr
systemctl enable frr
systemctl start frr
echo ""
echo "_______________________________Проверка_______________________________"
systemctl status frr
ip route show