Discussion:
[Shorewall-users] SHELL and masq
Vieri Di Paola
2016-10-10 16:57:37 UTC
Permalink
Hi,

I'm getting the folloowing error when I 'shorewall check':
ERROR: Invalid IPSEC Option (192.168.151.48) SHELL@/etc/shorewall/masq

My offending line in /etc/shorewall/masq:
?SHELL echo "\$OVPN_MASQ"

/etc/shorewall/params:
OVPN_STATIC_IP[client1]=192.168.151.48
OVPN_MASQ_IP[client1]=10.215.144.48
OVPN_STATIC_IP[client2]=192.168.151.45
OVPN_CLIENT_LIST=( client1 client2 )

[...]
for OVPN_CLIENT in ${OVPN_CLIENT_LIST[@]}; do
OVPN_MASQ="${OVPN_MASQ}
$IF1 ${OVPN_STATIC_IP[$OVPN_CLIENT]} ${OVPN_MASQ_IP[$OVPN_CLIENT]}
$IF2 ${OVPN_STATIC_IP[$OVPN_CLIENT]} ${OVPN_MASQ_IP[$OVPN_CLIENT]}
$IF3 ${OVPN_STATIC_IP[$OVPN_CLIENT]} ${OVPN_MASQ_IP[$OVPN_CLIENT]}"
fi
done
echo "${OVPN_MASQ}" > /tmp/OVPN_MASQ

-----

If I comment out the offending line in masq file and restart shorewall:
# cat /tmp/OVPN_MASQ

enp0s8 192.168.151.48 10.215.144.48
enp2s0f0 192.168.151.48 10.215.144.48
enp2s0f1 192.168.151.48 10.215.144.48

I'm not sure what my mistake is.

Vieri
Tom Eastep
2016-10-10 18:14:05 UTC
Permalink
Hi,
My offending line in /etc/shorewall/masq: ?SHELL echo
"\$OVPN_MASQ"
/etc/shorewall/params: OVPN_STATIC_IP[client1]=192.168.151.48
OVPN_MASQ_IP[client1]=10.215.144.48
OVPN_STATIC_IP[client2]=192.168.151.45 OVPN_CLIENT_LIST=( client1
client2 )
OVPN_MASQ="${OVPN_MASQ} $IF1 ${OVPN_STATIC_IP[$OVPN_CLIENT]}
${OVPN_MASQ_IP[$OVPN_CLIENT]} $IF2
${OVPN_STATIC_IP[$OVPN_CLIENT]} ${OVPN_MASQ_IP[$OVPN_CLIENT]} $IF3
${OVPN_STATIC_IP[$OVPN_CLIENT]} ${OVPN_MASQ_IP[$OVPN_CLIENT]}" fi
done echo "${OVPN_MASQ}" > /tmp/OVPN_MASQ
-----
If I comment out the offending line in masq file and restart
shorewall: # cat /tmp/OVPN_MASQ
enp0s8 192.168.151.48 10.215.144.48 enp2s0f0
192.168.151.48 10.215.144.48 enp2s0f1 192.168.151.48
10.215.144.48
I'm not sure what my mistake is.
This works:

?begin perl shorewall "$ENV{OVPN_MASQ}"

- -Tom
- --
Tom Eastep \ When I die, I want to go like my Grandfather who
Shoreline, \ died peacefully in his sleep. Not screaming like
Washington, USA \ all of the passengers in his car
http://shorewall.net \________________________________________________
Vieri Di Paola
2016-10-10 18:32:31 UTC
Permalink
----- Original Message -----
Post by Tom Eastep
?begin perl shorewall "$ENV{OVPN_MASQ}"
If I copy your line verbatim I get:
ERROR: Invalid BEGIN PERL directive

If I use this line:
?PERL shorewall "$ENV{OVPN_MASQ}"
I get:
Use of uninitialized value $ENV{"OVPN_MASQ"} in string at /etc/shorewall/masq

# shorewall version
5.0.6.2
Tom Eastep
2016-10-10 18:45:03 UTC
Permalink
Post by Vieri Di Paola
----- Original Message -----
Post by Tom Eastep
shorewall "$ENV{OVPN_MASQ}"
If I copy your line verbatim I get: ERROR: Invalid BEGIN PERL
directive
If I use this line: ?PERL shorewall "$ENV{OVPN_MASQ}" I get: Use of
uninitialized value $ENV{"OVPN_MASQ"} in string at
/etc/shorewall/masq
Again, export in params and not in init

- -Tom
- --
Tom Eastep \ When I die, I want to go like my Grandfather who
Shoreline, \ died peacefully in his sleep. Not screaming like
Washington, USA \ all of the passengers in his car
http://shorewall.net \________________________________________________
Vieri Di Paola
2016-10-21 10:37:20 UTC
Permalink
Thanks, works great.

Loading...