Sns-En-Basic Cli Configuration Technical Note
Sns-En-Basic Cli Configuration Technical Note
Table of contents
Getting started 4
Using the command line interface 4
Firewall administration 5
Displaying help for commands and arguments 5
Getting write access 5
Resetting factory settings 5
Importing a license 5
Console syntax 5
Script syntax 5
Backing up the whole configuration 5
Console syntax 5
Script syntax 5
Restoring the whole configuration 5
Console syntax 5
Script syntax 6
Updating the firmware 6
Console syntax 6
Script syntax 6
Enabling SSH access using a password 6
Disabling SSH access 6
Allowing a public IP address to access the web interface 6
Managing Network objects 7
Host object 7
Creating a Host object 7
Removing a Host object 7
Network object 7
Creating a Host object 7
Removing a Host object 7
IP address range object 8
Creating an IP address range object 8
Removing an IP address range object 8
Port object 8
Creating a Port object 8
Removing a Port object 8
Port range object 8
Creating a port range object 8
Removing a port range object 9
Router Object 9
Creating a Router object 9
Removing a Router object 9
Group object 10
Creating a Group object 10
Adding an object to the group 10
Removing a Group object 10
IP protocol object 10
Creating an IP protocol object 10
Removing an IP protocol object 10
Port group object 10
Getting started
Stormshield Network Security Firewalls provide a command line interface (CLI), composed of a
proprietary set of commands. The commands are available via a shell and allows configuring
and monitoring all firewall features.
This document describes the CLI commands required to configure the basic firewall features.
For details about all commands and their arguments, refer to Stormshield Network Security - CLI
Serverd commands reference guide.
You can write several CLI commands in a text file to create a CLI script that will then be run
either locally or remotely.
NOTE
For details on how to access the CLI shell and how to write and run scripts, refer to the E-learning
module CLI ACCESS & SCRIPTS.
Firewall administration
Displaying help for commands and arguments
HELP
Use HELP as an argument for another command to display help about all its arguments.
This command does not reset the password of the admin user.
Importing a license
Console syntax
SYSTEM LICENCE UPLOAD < U70SXA02J2681A7.licence
Script syntax
SYSTEM LICENCE UPLOAD $FROM_DATA_FILE ("U70SXA02J2681A7.licence")
Console syntax
CONFIG BACKUP list=all [password=mot_de_passe]> mybackup.na
Script syntax
CONFIG BACKUP list=all [password=mot_de_passe] $SAVE_TO_DATA_FILE
("mybackup.na")
Console syntax
CONFIG RESTORE list=all [password=mot_de_passe]< mybackup.na
Script syntax
CONFIG RESTORE list=all [password=mot_de_passe] $FROM_DATA_FILE
("mybackup.na")
Console syntax
SYSTEM UPDATE UPLOAD < fwupd-2.2.0-NETASQ-amd64-M-VM-NETASQ.maj
SYSTEM UPDATE ACTIVATE
Script syntax
SYSTEM UPDATE UPLOAD $FROM_DATA_FILE("fwupd-2.2.0-NETASQ-amd64-M-VM-
NETASQ.maj")
SYSTEM UPDATE ACTIVATE
PUBLIC_IP is a Host object, but it can also be a Network object, an IP address range, or the any
object.
Host object
Network object
Port object
Router Object
Main gateway 1:
l Host object: MAIN_GW1
l Weight: 1
Main gateway 2:
l Host object: MAIN_GW2
l Weight: 1
Backup gateway:
l Host object: BACKUP_GW
l Weight: 1
Group object
IP protocol object
Time object
Network configuration
Configuring an Ethernet interface
The names of the interfaces are:
l Ethernet0: out
l Ethernet1: in
l Ethernet2: dmz1
l Ethernet3: dmz2
Static IP address
l Configure the in interface with static IP address 192.168.1.254/24.
CONFIG NETWORK INTERFACE ADDRESS ADD ifname=ethernet1
address=192.168.1.254 mask=24 addressComment=
CONFIG NETWORK INTERFACE ACTIVATE
Dynamic IP address
l Configure the out interface via DHCP.
CONFIG NETWORK INTERFACE ADDRESS ADD ifname=ethernet0 address=DHCP
dhcpLeaseTime=0 requestDns=1
CONFIG NETWORK INTERFACE ACTIVATE
Creating a bridge
Static IP address
l Create a BRIDGE_LAN bridge containing the in and dmz1 interfaces, and configured with the
static IP address 192.168.5.254/24.
CONFIG NETWORK INTERFACE CREATE mtu=1500 name=BRIGE_LAN
interfaces=ethernet2,ethernet1 ifname=bridge1 address=192.168.5.254
mask=255.255.255.0 addressComment=
CONFIG NETWORK INTERFACE ACTIVATE
Dynamic IP address
l Create a BRIDGE_LAN bridge containing the in and dmz1 interfaces, and configured via DHCP.
CONFIG NETWORK INTERFACE CREATE mtu=1500 name=BRIDGE_LAN
interfaces=ethernet1,ethernet2 ifname=bridge1 address=DHCP
dhcpLeaseTime=3600 dhcpHostname=
CONFIG NETWORK INTERFACE ACTIVATE
Modifying a bridge
CONFIG NETWORK INTERFACE ADDRESS UPDATE ifname=bridge1
address=192.168.5.250 mask=255.255.255.0 addrnb=0 addressComment=
Removing a bridge
l Before removing a bridge, you must first remove the interfaces belonging to the bridge.
CONFIG NETWORK INTERFACE ADDRESS ADD ifname=ethernet1 address=DHCP
dhcpLeaseTime=0 requestDns=0
Filter rules
Enable a filter or NAT policy
l Enable the filter or NAT policy #5.
CONFIG SLOT ACTIVATE type=filter slot=5
Translation rules
Adding a translation rule
Dynamic translation
l Create the following dynamic translation rule:
Static translation
l Add the two following static translation rules:
Creating a user
l Create the Jean Doe user with the adminadmin password in the directory.
USER CREATE uid=jdoe name=doe gname=jean
Removing a user
USER REMOVE "cn=jean doe,ou=users,o=institute,dc=madrid.institute.com"
Further reading
Stormshield Knowledge Base
Additional information and responses to questions you may have are available in the
Stormshield knowledge base (authentication required).
documentation@stormshield.eu
All images in this document are for representational purposes only, actual products may differ.
Copyright © Stormshield 2023. All rights reserved. All other company and product names
contained in this document are trademarks or registered trademarks of their respective
companies.