[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian Server Routing OSPF on two links and one loopback address





On Sat, Nov 30, 2024 at 6:46 PM Timothy M Butterworth <timothy.m.butterworth@gmail.com> wrote:
All,

I have been working out how to have my server setup with OSPF routing. I have two network interfaces each configured with a /30 and one dummy loopback configured with a /32. The goal is to have the /32 address advertised in DNS so traffic can use per-session load balancing across both /30's.

Can anyone think of anything I might have missed?

### Create and configure the dummy interface

sudo touch /etc/network/interfaces.d/ospf.cfg
sudo vim /etc/network/interfaces.d/ospf.cfg

auto ospf
iface ospf inet static
  address 10.0.0.1/32
  pre-up ip link add ospf type dummy

 
### Configure Static IP addresses
auto eth0
iface eth0 inet static
  address 10.1.1.2/30

auto eth1
iface eth1 inet static
  address 10.1.1.6/30

 
### Add Default Gateway routes
route add -net default gw 10.1.1.1 metric 1024 dev eth0
route add -net default gw 10.1.1.5 metric 1024 dev eth1

# NOTE: I am not sure if the above commands will be persistent.


Added nmcli commands 
### Create and configure the dummy interface using nmcli
sudo nmcli conn add type dummy ifname ospf ipv4.method manual ipv4.address 10.0.0.1/32
sudo nmcli connection add type ethernet ifname eth0 ipv4.method manual ipv4.address 10.1.1.2/30 ipv4.gateway 10.1.1.1
sudo nmcli connection add type ethernet ifname eth0 ipv4.method manual ipv4.address 10.1.1.6/30 ipv4.gateway 10.1.1.5


 
### Install and Configure frr Free Range Routing
sudo apt install frr

sudo vim /etc/frr/daemons
change no to yes for OSPF

sudo /usr/bin/vtysh

conf t
router ospf
network 10.0.0.1/32 area 0
network 10.1.1.0/30 area 0
network 10.1.1.4/30 area 0

# NOTE: frr configuration is stored in. sudo vim /etc/frr/frr.conf


### Enable IP Forwarding
sudo sysctl -w net.ipv4.ip_forward=1

### sysctl.d config file
sudo touch /etc/sysctl.d/ipforward
sudo vim /etc/sysctl.d/ipforward
net.ipv4.ip_forward = 1

### Firewalld Configuration - Open OSPF
sudo firewall-cmd --add-protocol=ospf --permanent --zone=internal
sudo firewall-cmd --add-protocol=89 --permanent --zone=internal

### DNS Configuration
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns1.home.arpa. root.home.arpa. (
     2 ; Serial
604800 ; Refresh
 86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.home.arpa.
@ IN A 127.0.0.1
@ IN AAAA ::1

ns1        IN      A    127.0.0.1
ns1        IN      AAAA ::1
server-1   IN      A    10.0.0.1


--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/
⠈⠳⣄⠀⠀


--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/
⠈⠳⣄⠀⠀

Reply to: