ONTAP Discussions

vFiler IP change via CLI

fidelityggn
16,062 Views

How to change the IP of a vfiler through CLI?

I want to do it through shell script but "vfiler run" doesn't support anything on vfiler modification. vfiler0 ifconfig helps only defining alias but not ip change for a particular vfiler. Only possible way i know for it is through filerview but I want to use CLI.

1 ACCEPTED SOLUTION

scottgelb
16,062 Views

Exactly... add then remove.  If a single IP it looks like ...then a short outage to the vFiler.  Some more specifics..

vfiler add vfilername -i newIP        # add the new first since you can't have a vfiler with no ip

vfiler remove vfilername -i oldIP    # remove the old IP and unbind it

You will then need to ifconfig the interface with the IP you added... running ifconfig using the IP will bind that interface (single port, vif, vlan, alias, etc.) to the vFiler since the IP matches.  Add the ifconfig to the /etc/rc file in vfiler0 as well as the "vfiler run vfilername route add default" if needed.

You can also run "vfiler run vfilername setup -e interface:ip:subnet" after the vfiler add, but setup will wack several files (hosts, hosts.equiv, exports, etc.) inside the vFiler, so I recommend to just run the ifconfig to create the binding and edit /etc/rc of vfiler0.

View solution in original post

3 REPLIES 3

thomas_glodde
16,062 Views

vfiler add/remove

scottgelb
16,063 Views

Exactly... add then remove.  If a single IP it looks like ...then a short outage to the vFiler.  Some more specifics..

vfiler add vfilername -i newIP        # add the new first since you can't have a vfiler with no ip

vfiler remove vfilername -i oldIP    # remove the old IP and unbind it

You will then need to ifconfig the interface with the IP you added... running ifconfig using the IP will bind that interface (single port, vif, vlan, alias, etc.) to the vFiler since the IP matches.  Add the ifconfig to the /etc/rc file in vfiler0 as well as the "vfiler run vfilername route add default" if needed.

You can also run "vfiler run vfilername setup -e interface:ip:subnet" after the vfiler add, but setup will wack several files (hosts, hosts.equiv, exports, etc.) inside the vFiler, so I recommend to just run the ifconfig to create the binding and edit /etc/rc of vfiler0.

CHRIS_ZURICH
16,062 Views

Since I just ran through doing this I thought I'd update this post with the exact steps for updating a vfiler which is running in it's own ipspace with a separate default gateway.

Before executing these steps you'll want to add the new IP to all DNS addresses associated with each respective filer.

1. Add ip address to vfiler

vfiler add <vfiler> -i <ip>
2. Remove default gateway

vfiler run <vfiler> route delete default

3. Add new default gateway

vfiler run <vfiler> route add default <gateway ip> 1

vfiler run <vfiler> route -s (confirm that the new route is active)

4.  Update the active ip associated with the vfiler from the source/physical filer

ifconfig <interface> <ip> netmask <netmask> partner <interface>

5. Update /etc/rc & /etc/hosts file with new IP for interface and default gateway

Forgetting to do step 5 will cause you to lose your configuration settings if either the filer reboots or fails over.

Public