AppNeta - How do I configure network settings over console, or by command line?
search cancel

AppNeta - How do I configure network settings over console, or by command line?

book

Article ID: 254904

calendar_today

Updated On:

Products

AppNeta

Issue/Introduction

You may find a situation where you need to factory reset your appliance causing you to lose your IP settings. 

In some circumstances you may need to resort to using the monitoring points console settings or command line (CLI). 
Commands can be issued using curl in the format.

Environment

AppNeta Monitoring points:

Most models (M35, M50, M70, R90, R1000) use the following serial ports settings:  115200-8-N-1
Speed = 115200 Data bits = 8 Stop bits = 1 Parity = None Flow control = XON/XOFF

Some legacy appliance (M30, R45) use:  19200-8-N-1

Resolution

Factory default settings on AppNeta monitoring points will set the the Primary Network Connection interface (typically Eth0) to use DHCP. 
After a factory reset, for software versions 13.11.0 and older the admin password for the monitoring point is:

appneta.admin

For 13.12.0 and newer, the password will be the MAC address - Uppercase and no colons - so for example, if the MAC was: 00:00:12:34:56:7B  -> the password would be 00001234567B

More details on the password in 13.12.0 can be found here:  https://knowledge.broadcom.com/external/article/256645 

In circumstances where you may need to set Static IP's on various interfaces, the commands to set the interfaces are found below.

In our example, we'll use the following:

Interface: Eth0
IP: 10.0.0.100
Mask: 255.255.255.0
Default Gateway:  10.0.0.1


1.  Add the static IP on eth0:

curl -k -u admin -X POST -H "Content-Type: application/json" -d '{"name": "eth0", "family": "inet", "method": "static", "address":"10.0.0.100", "netmask":"255.255.255.0", "gateway":"10.0.0.1"}' 'https://127.0.0.1/api/v1/interface/'

You should be prompted for the admin password for the appliance.

2.  Changes to interfaces need to be followed by a Network Restart:

curl -k -u admin -X PUT -H 'Content-Type: application/json' -d {} 'https://127.0.0.1/api/v1/service/networking/?action=restart'

or

sudo systemctl restart networking

 

3.  Similarly you can change an interface to use DHCP.
Change eth0 to use DHCP:

curl -ku admin -X POST -H "Content-Type: application/json" -d '{"name": "eth0", "family": "inet", "method": "dhcp"}' 'https://127.0.0.1/api/v1/interface/'


4.  Interfaces can also be deleted using the following command, which is removing the eth1 interface:

curl -k -u admin -X DELETE -H 'Accept: application/json' 'https://127.0.0.1/api/v1/interface/eth1/?family=inet'

5.  If you configured a second interface, you may need to set that interface to be the Default Interface:

curl -ku admin -X PUT "https://127.0.0.1/api/v1/interface/eth0.2/?action=setdefault" -H "accept: application/json" -H "Content-Type: application/json" -d "{}"

6.  If you need to add proxy settings to your configuration, use the follow commands:

curl -ku admin 'POST'   'https://127.0.0.1/api/v1/proxy/?restart_services=true'   -H 'accept: application/json'   -H 'Content-Type: application/json'   -d '{
  "address": "domain.com",
  "port": 80,
  "username": "myusername",
  "password": "mypassword"
}'

If your not using user/pass in the proxy, them just leave that section removed, which should configure null for those settings.

curl -ku admin 'POST'   'https://127.0.0.1/api/v1/proxy/?restart_services=true'   -H 'accept: application/json'   -H 'Content-Type: application/json'   -d '{
  "address": "domain.com",
  "port": 80
}'

Additional Information


-  Remember to restart networking after any change; you need to apply settings
-  All commands can be changed to reflect other interfaces, such as the command below to set 192.168.1.101 to eth1.  Please also note in this example that we are sending the curl command to 'localhost' in place of 127.0.0.1

curl -k -u admin -X POST -H "Content-Type: application/json" -d '{"name": "eth1", "family": "inet", "method": "static", "address":"192.168.1.101", "netmask":"255.255.255.0", "gateway":"192.168.1.1"}' 'https://localhost/api/v1/interface/'

*VLAN interfaces can also be created using the same methods

Once you have configure the IP, you can use command line to perform ping tests, and ultimately log into the monitoring point's WebUI through its configured IP:
Example:  http://10.0.0.100/