* [ISSUE #4208] Fix bug when configuring multiple ips. * [ISSUE #4208] Fix bug when configuring multiple ips. * Format the code. * Add unit test.