Unable to add static ARP entry

Started by Berzerker, March 20, 2023, 03:18:47 PM

Previous topic - Next topic
Quote from: wbk on March 22, 2023, 11:08:27 PM
Hi Berserker, thanks for being patient with my not so helpful suggestions, glad you got it solved! Would you consider adding 'Solved' or any indicator to your topic title, to help others?

Done thanks.

Gonna open this back up. I was successfully able to add the static ARP entry, but it disappears after a few, maybe 10-20 minutes. I do see the entry says "permanent" but something is removing it, not sure what.

What's the correct way to add a permanent static ARP entry besides running "arp -s"?

QuoteWhat's the correct way to add a permanent static ARP entry besides running "arp -s"?
static_arp_pairs ?
https://man.freebsd.org/cgi/man.cgi?rc.conf(5)

Quote from: Fright on March 24, 2023, 07:00:16 AM
QuoteWhat's the correct way to add a permanent static ARP entry besides running "arp -s"?
static_arp_pairs ?
https://man.freebsd.org/cgi/man.cgi?rc.conf(5)

I have that added in /etc/rc.conf but it does not work. Is it in the wrong file?

@Berzerker
sorry for delay
i see three possible ways:
(1) Try to use syshook (https://docs.opnsense.org/development/backend/autorun.html):
add 'static_arp' file to /etc/rc.d.conf with:

static_arp_pairs="gw"
static_arp_gw="xxx.xxx.xxx.x 11:22:33:44:55:66"

and (for example) 30-static_arp file (dont forget permissions) to /usr/local/etc/rc.syshook.d/start with:

#!/bin/sh

# need my ONT staic arp somehow
/etc/rc.d/static_arp start

and reboot to test
BUT i dont think it survives a link cycle. may be /usr/local/etc/rc.syshook.d/config/ will work better?

(2) just use cron to "arp -S" every X min?
(3) dhcpd trick:
try to add a static lease do DHCP [WAN] (don't need to enable DHCP server though  ;) ) with ONT MAC and IP and enable "ARP Table Static Entry" for this entry. this should force interfaces_staticarp_configure() function to add this arp record when needed. then reboot or "configctl interface reconfigure wan" to test