Novell Access Manager SSLVPN NAT Script

Novell Access Manager SSLVPN NAT Script

The script below can be added to init for adding and removing the necessary iptables entry to route traffic from the SSLVPN subnet to the server's interface.

Create the script as something like /root/sslvpn-nat.sh then permanently link it to the init.d directory with ln -s /root/sslvpn-nat.sh /etc/init.d/sslvpn-nat

Then use yast2 runlevel to enable it during boot.

The only values that need to be changed are SSLVPN_NAT and SSLVPN_INT near the top of the script. These should reflect your environment.

#!/bin/sh
#
### BEGIN INIT INFO
# Provides: sslvpn-nat
# Required-Start: $local_fs $remote_fs $novell-sslvpn
# X-UnitedLinux-Should-Start: $named $syslog $time
# Required-Stop: $local_fs $remote_fs
# X-UnitedLinux-Should-Stop: $named $syslog $time
# Default-Start: 3 5
# Default-Stop:  0 1 2 6
# Short-Description: SSL VPN NAT Entry
# Description: Provides routing from SSL VPN subnet to eth0 Interface
### END INIT INFO

# Set the SSLVPN Network (SSLVPN_NET)
# and the SSLVPN Interface (SSLVPN_INT)
SSLVPN_NET=12.8.0.0/16
SSLVPN_INT=192.168.1.1

# Shell functions sourced from /etc/rc.status:
#	rc_check	check and set local and overall rc status
#	rc_status	check and set local and overall rc status
#	rc_status -v	ditto but be verbose in local rc status
#	rc_status -v -r	ditto and clear the local rc status
#	rc_failed	set local and overall rc status to failed
#	rc_failed 	set local and overall rc status to 
#	rc_reset	clear local rc stats (overall remains)
#	rc_exit		exit appropriate to overall rc status
. /etc/rc.status

# First reset status of this service
rc_reset

# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restart a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.

case "$1" in
    start)
	echo -n "Adding SSLVPN NAT entry"
	iptables -t nat -A POSTROUTING -s $SSLVPN_NET -j SNAT --to $SSLVPN_INT
	rc_failed 0
	rc_status -v
	/etc/init.d/novell-sslvpn restart
	;;
    stop)
	echo -n "Removing SSLVPN NAT entry"
	iptables -t nat -D POSTROUTING -s $SSLVPN_NET -j SNAT --to $SSLVPN_INT
	rc_failed 0
	rc_status -v
	/etc/init.d/novell-sslvpn restart
	;;
    restart)
	$0 stop
	$0 start
	rc_status
	;;
    status)
	iptables -t nat -L POSTROUTING
	sslvpnc --status
	;;
    *)
	echo "Usage: $0 {start|stop|restart|status}"
	exit 1
	;;
esac
rc_exit
Labels (2)
Tags (1)

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Comments
With the recent SSLVPN module (3.1.1.265), this configuration is managed through the Administration Console under "Advanced Configuration" for SSLVPN.
Top Contributors
Version history
Revision #:
5 of 5
Last update:
‎2020-01-31 11:41
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.