ONTAP Discussions
ONTAP Discussions
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.
Solved! See The Solution
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.
vfiler add/remove
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.
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 run <vfiler> route delete default
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 filerifconfig <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.