Setting Static IP on interface through console, command line
search cancel

Setting Static IP on interface through console, command line

book

Article ID: 256129

calendar_today

Updated On:

Products

AppNeta DX NetOps

Issue/Introduction

Requirement to setup static IP on interface through console.

Default setting for delivery interfaces is DHCP

Environment

Reference below settings on connecting to device through console. These settings may change based on your model of monitoring point:

Appneta m35: Console (Speed = 115200 // Data bits = 8 // Stop bits = 1 // Parity = None // Flow control = XON/XOFF)

Appneta m50: Console (Speed = 115200 // Data bits = 8 // Stop bits = 1 // Parity = None // Flow control = XON/XOFF)

Appneta m70: Console (Speed = 115200 // Data bits = 8 // Stop bits = 1 // Parity = None // Flow control = XON/XOFF)

Appneta r45: Console (Speed = 19200 // Data bits = 8 // Stop bits = 1 // Parity = None // Flow control = XON/XOFF)

Appneta r90: Console (Speed = 115200 // Data bits = 8 // Stop bits = 1 // Parity = None // Flow control = XON/XOFF)

Appneta r1000: Console (Speed = 115200 // Data bits = 8 // Stop bits = 1 // Parity = None // Flow control = XON/XOFF)

 

You will require the configured monitoring password to access the device through console. This is provided by the customer at initial setup.

Default username: admin
Default password: Hardware (MAC) address of the Primary network connection port (0) - upper case and no colons (for example, 525400E09F76)

Resolution

Issue the following curl commands to set the example parameters below:

Interface: eth0

IP Address: 10.0.0.100

Subnet Mask: 255.255.255.0

Default Gateway: 10.0.0.1
DNS: 8.8.4.4

Setup Static IP on Eth0:

curl -ku 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/'

Setup Static DNS:

curl -ku admin -X POST "https://127.0.0.1/api/v1/interface/eth0/dns_nameserver/" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"family\": \"inet\", \"dns_nameservers\": [ \"8.8.4.4\" ]}"

Restart Networking Service (Required for changes to take effect):

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

Additional Information

Reference Article below for additional console commands:

https://knowledge.broadcom.com/external/article/254904