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 Network Observability

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://localhost/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://localhost/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://localhost/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://localhost/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://localhost/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://localhost/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://localhost/api/v1/proxy/?restart_services=true'   -H 'accept: application/json'   -H 'Content-Type: application/json'   -d '{
  "address": "domain.com",
  "port": 80
}'

 

7.  To perform a remote reflash, you can use the follow command:

curl -ku admin -X PUT "https://127.0.0.1/api/v1/appliance/reflash/" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"build\": \"local\", \"reset\": false}"

This command will reload the current software into the monitoring point, so the firmware version will remain the same.

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/

~~~~

In exceptional scenarios, we may need to rely on Linux commands in order to make the required settings changes.  If you require performing these changes, we encourage you to work with Broadcom Support Team.

Add a new interface (STATIC) WIRED - Nano config file:


sudo nano /etc/network/interfaces.d/eth0

In the file editor, write the following many any required changes for your IPs and network:


auto eth0 iface eth0 inet manual metric 257
iface eth0 net static address 10.0.0.100 netmask 255.255.255.0 static-gateway 10.0.0.1 metric 257 dns-nameserver 10.0.0.1

Save the file, restart networking.

*Note, once you've restarted networking please log into the AppNeta monitoring point WebUI and review the changes created.