Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Policyrouting: add list for Interfaces to ignore #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/package/freifunk-policyrouting/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=freifunk-policyrouting
PKG_RELEASE:=7
PKG_RELEASE:=8

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ config 'settings' 'pr'
option 'strict' '1'
option 'fallback' '1'
option 'zones' ''
list 'ignore_interface' 'loopback'
list 'ignore_interface' 'wan'
list 'ignore_interface' 'wan6'

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
. /lib/functions.sh
. /lib/functions/network.sh

IGNORE_INTERFACES=$(uci get freifunk-policyrouting.pr.ignore_interface)
list_contains IGNORE_INTERFACES $INTERFACE && exit

proto="4"
[ -f /proc/net/ipv6_route ] && proto="4 6"

Expand All @@ -19,7 +22,7 @@ if [ "$ACTION" = "ifup" ] && [ "$enable" = "1" ]; then

if [ "$net" != "" -a -n "$dev" ]; then
eval $(/bin/ipcalc.sh $net)
if [ "$PREFIX" != "0" -a "$NETWORK" != "127.0.0.0" ]; then
if [ "$PREFIX" != "0" ]; then
if [ ! "$(ip r s t localnets |grep "$NETWORK/$PREFIX dev")" ]; then
cmd="ip r a $NETWORK/$PREFIX dev $dev table localnets"
$cmd
Expand Down