OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Profile of thomas_4fdua8 »
  • Show Posts »
  • Messages
  • Profile Info
    • Summary
    • Show Stats
    • Show Posts...
      • Messages
      • Topics
      • Attachments

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

  • Messages
  • Topics
  • Attachments

Messages - thomas_4fdua8

Pages: [1]
1
German - Deutsch / Re: IPv6-Probleme nach Verbindungsabruch
« on: February 28, 2021, 10:24:27 am »
Hallo zusammen,

hier habe ein ähnliches Problem beobachtet (und gelöst): Ich betreibe OPNsense hinter einer FritzBox. Jedes mal, wenn sich die FritzBox nach der Zwangstrennung neu verbindet, bekommt sie einen neuen IPv6 Addressbereich, von dem OPNsense leider nichts mitbekommt.

Meine Lösung ist, die Gateways mit einem Cron-Script zu beobachten. Sobald WAN IPv4 up und WAN IPv6 down ist, wir einfach das WAN interface neu gestartet:

Code: [Select]
#!/bin/sh

##################################################
# This script checks if the WAN4 interface is up #
# and the WAN6 interface is down.                #
# In this case the WAN interface is restartet.   #
##################################################

# Put script in /usr/local/sbin/check_gatewayv6.sh
# Add action in /usr/local/opnsense/service/conf/actions.d/actions_check_gatewayv6.conf
# Add cron job under System -> Settings -> Cron

# Current time
curtime=$(date +%s)
# Bootime in seconds
uptime=$(sysctl kern.boottime | awk -F'sec = ' '{print $2}' | awk -F',' '{print $1}')
# Uptime in seconds
uptime=$(($curtime - $uptime))
# If uptime > 120 seconds:
if [ $uptime -gt 120 ]; then

        wan4status=$(pluginctl -r return_gateways_status | python3 -c 'import json, sys; print(json.loads(sys.stdin.read())["dpinger"]["WAN_DHCP"]["status"]);')
        #echo "WAN4 Status is: $wan4status"
        if [ "$wan4status" != "down" ]; then
                #echo "WAN4 is not down"
               
                wan6status=$(pluginctl -r return_gateways_status | python3 -c 'import json, sys; print(json.loads(sys.stdin.read())["dpinger"]["WAN_DHCP6"]["status"]);')
                #echo "WAN6 Status is: $wan6status"
                if [ "$wan6status" == "down" ]; then
                        #echo "WAN6 is down"
                       
                        /usr/local/etc/rc.configure_interface wan
                        sleep 2
                        /usr/local/sbin/pluginctl -s dpinger restart
                fi
        fi
fi

Bisher scheint alles wie gewünscht zu funktionieren.

Pages: [1]
OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2