Disable DHCP and assign static IP address for vlan 1, default gateway and name server

Example how to configure quickly a manual IP address the default gateway and a name server to reach cloud services via the CLI on a cnMatrix switch. Important step here is to disable first automatic DHCP address allocation with command: no ip address

Full example command list (Commands in bold):

EX2028-EBF781# show ip interface

mgmt0 is up, line protocol is down
Internet Address is 192.168.0.1/24
Broadcast Address 192.168.0.255

vlan1 is up, line protocol is up
Internet Address is 172.16.100.124/24
Broadcast Address 172.16.100.255
IP address allocation method is dynamic
IP address allocation protocol is dhcp
Nameservers:
8.8.8.8
EX2028-EBF781# config ter
EX2028-EBF781(config)# interface vlan 1
EX2028-EBF781(config-if)# no ip address
EX2028-EBF781(config-if)# ip address 172.16.100.11 255.255.255.0
EX2028-EBF781(config-if)# end
EX2028-EBF781# show ip interface

mgmt0 is up, line protocol is down
Internet Address is 192.168.0.1/24
Broadcast Address 192.168.0.255

vlan1 is up, line protocol is up
Internet Address is 172.16.100.11/24
Broadcast Address 172.16.100.255
EX2028-EBF781# ping 172.16.100.1
Reply Received From :172.16.100.1, TimeTaken : 4 msecs
Reply Received From :172.16.100.1, TimeTaken : 2 msecs
Reply Received From :172.16.100.1, TimeTaken : 2 msecs

--- 172.16.100.1 Ping Statistics ---
3 Packets Transmitted, 3 Packets Received, 0% Packets Loss
EX2028-EBF781# ping 8.8.8.8
Reply Not Received From : 8.8.8.8, Timeout : 1 secs
Reply Not Received From : 8.8.8.8, Timeout : 1 secs
Reply Not Received From : 8.8.8.8, Timeout : 1 secs

--- 8.8.8.8 Ping Statistics ---
3 Packets Transmitted, 0 Packets Received, 100% Packets Loss
EX2028-EBF781# conf terminal
EX2028-EBF781(config)# ip route ?

<ip_addr> Destination IP address

EX2028-EBF781(config)# ip route 0.0.0.0 0.0.0.0 172.16.100.1
EX2028-EBF781(config)# exit
EX2028-EBF781# ping 8.8.8.8
Reply Received From :8.8.8.8, TimeTaken : 10 msecs
Reply Received From :8.8.8.8, TimeTaken : 18 msecs
Reply Received From :8.8.8.8, TimeTaken : 11 msecs

--- 8.8.8.8 Ping Statistics ---
3 Packets Transmitted, 3 Packets Received, 0% Packets Loss
EX2028-EBF781# ping www.cambiumnetworks.com
% Cannot resolve the host name
EX2028-EBF781# config ter
EX2028-EBF781(config)# ip name-server ?

ipv4 IPv4 related configuration
ipv6 IPv6 related configuration

EX2028-EBF781(config)# ip name-server ipv4 ?

ucast_addr Name server IP address

EX2028-EBF781(config)# ip name-server ipv4 8.8.8.8
EX2028-EBF781(config)# end
EX2028-EBF781# ping www.cambiumnetworks.com
Reply Received From :18.188.5.196, TimeTaken : 115 msecs
Reply Received From :18.188.5.196, TimeTaken : 119 msecs
Reply Received From :18.188.5.196, TimeTaken : 115 msecs

--- 18.188.5.196 Ping Statistics ---
3 Packets Transmitted, 3 Packets Received, 0% Packets Loss
EX2028-EBF781# copy running-config startup-config
Building configuration ...
[OK]
EX2028-EBF781#

5 Likes

Thank you for this.