Skip to content

Commit 23f6f97

Browse files
committed
vnet-start: load pf.conf if not loaded
1 parent 2361d0a commit 23f6f97

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## [Unreleased]
88
### Fixed
99
- init: make pf.conf more robust
10+
- vnet-start: make pf start more robust, in case pf as service is not up
1011

1112
## [0.6.0] 2019-06-23
1213
### Added

share/pot/vnet-start.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ pot-vnet-start()
7373

7474
# load pf module
7575
kldload -n pf
76+
# check anchors
77+
if [ -z "$( pfctl -s Anchors | grep -F '^[ \t]*pot-nat$' )" ] ||
78+
[ -z "$( pfctl -s Anchors | grep -F '^[ \t]*pot-rdr$' )" ]; then
79+
_debug "Pot anchors are missing - load pf.conf"
80+
pfctl -f pf.conf
81+
fi
7682
_nat_rules="/tmp/pot_pf_nat_rules"
7783
if [ -w "$_nat_rules" ]; then
7884
rm -f "$_nat_rules"

0 commit comments

Comments
 (0)