Switch Code (up to FI 9.x)

<aside> 🚨 Configuring the IP parameters is a two step process. First you will set up the IP address, then the default gateway. If you’re doing this over SSH, connect to the switch using a terminal on the same L2 network.

</aside>

  1. Connect to the Switch via SSH
  2. Use the commands:
Switch> **enable**
Switch# **conf t**
Switch(config)# **ip address [IP] [Subnet Mask]**

The switch will immediately start using this static IP and turn off DHCP.

Right now, there is no Default Gateway configured, so if you did this from a remote terminal you will not be able to reach it unless you NAT traffic to the ICX’s LAN.

To add a Default Gateway:

  1. Switch to the Management VLAN
Switch> **enable**
Switch# **conf t**
Switch(config)# **vlan 10**
Switch(config-vlan-10)# **default gateway [gateway-address] 1**

Router Code (any version)

<aside> 🚨 With Router code this cannot be done simply via SSH commands because the two-step process involves disabling the DHCP Client first, then configuring the static IP. As soon as you disable the DHCP Client, the switch loses its IP address so you will lose connectivity. The only way to recover from this is to connect locally via console!

</aside>

<aside> 💡 You will need a TFTP Server reachable by the switch.

</aside>

To do this remotely, you will need to use a config file which is then copied to the Running Config.

  1. Create a txt file containing the commands you want to run
ip dhcp-client disable
no ip dhcp-client ve **[Management VLAN ID]**
int ve **[Management VLAN ID]**
ip address **[IP]** **[Subnet Mask]** ospf-ignore
  1. Copy this text file to your TFTP Server
  2. Run the following commands on the switch:
en
copy tftp run **[TFTP Server IP] [Filename.txt]**

This will download the text file and apply the commands immediately, disable the DHCP-Client and setting the IP address, therefore make sure the commands are valid for your network.