def do_ip(self, *args):
        if "address".startswith(args[0]):
            new_ip = IPNetwork(args[1])
            ip_owner, existing_ip = self.switch_configuration.get_port_and_ip_by_ip(new_ip.ip)
            if not ip_owner:
                self.port.add_ip(new_ip)
            else:
                if ip_owner == self.port:
                    for ip in self.port.ips:
                        if new_ip.ip == ip.ip:
                            self.write_line("IP/Port: Errno(6) Duplicate ip address")
                            break
                        else:
                            if new_ip.ip in ip:
                                if len(args) > 2 and "secondary".startswith(args[2]):
                                    if not next((ip for ip in self.port.secondary_ips if ip.ip == new_ip.ip), False):
                                        self.port.add_secondary_ip(new_ip)
                                    else:
                                        self.write_line("IP/Port: Errno(6) Duplicate ip address")
                                        break
                                else:
                                    self.write_line(
                                        "IP/Port: Errno(15) Can only assign one primary ip address per subnet")
                                    break
                else:
                    self.write_line("IP/Port: Errno(11) ip subnet overlap with another interface")

        if "access-group".startswith(args[0]):
            if "in".startswith(args[2]):
                self.port.access_group_in = args[1]
            elif "out".startswith(args[2]):
                self.port.access_group_out = args[1]
            self.write_line("Warning: An undefined or zero length ACL has been applied. "
                            "Filtering will not occur for the specified interface VE {} (outbound)."
                            .format(self.port.vlan_id))

        if "vrrp-extended".startswith(args[0]):
            if "vrid".startswith(args[1]):
                group = args[2]
                vrrp = self.port.get_vrrp_group(group)
                if vrrp is None:
                    vrrp = self.switch_configuration.new("VRRP", group)
                    self.port.vrrps.append(vrrp)
                self.move_to(ConfigVirtualInterfaceVrrpCommandProcessor, self.port, vrrp)

            if "auth-type".startswith(args[1]):
                if "simple-text-auth".startswith(args[2]):
                    self.port.vrrp_common_authentication = args[3]
                elif "no-auth".startswith(args[2]):
                    self.port.vrrp_common_authentication = None

        if "helper-address".startswith(args[0]):
            if len(args) == 1:
                self.write_line("Incomplete command.")
            elif len(args) > 2:
                self.write_line("Invalid input -> {}".format(" ".join(args[2:])))
                self.write_line("Type ? for a list")
            else:
                ip_address = IPAddress(args[1])
                if ip_address not in self.port.ip_helpers:
                    self.port.ip_helpers.append(ip_address)
                else:
                    self.write_line("UDP: Errno(7) Duplicate helper address")

        if "redirect".startswith(args[0]):
            self.port.ip_redirect = True
dataset/ETHPy150Open internap/fake-switches/fake_switches/brocade/command_processor/config_virtual_interface.py/ConfigVirtualInterfaceCommandProcessor.do_ip/original