## Recognize when and how to set or remove an interface alias ##

[Author](authors.html): _name_ _[[contact]]_ _[[BSD_flavour]]_

[Reviewer](technical_reviewers.html): _name_ _[[contact]]_ _[[BSD_flavour]]_

[Reviewer](technical_reviewers.html): _name_ _[[contact]]_ _[[BSD_flavour]]_

----



### Concept ###

Recognize when it is appropriate to set
or remove an interface alias(((alias, interface))) and the available
commands on each of the BSDs.


### Introduction ###

Multiple IP addresses can be assigned to a network interface using the `ifconfig` tool using the "alias" parameter.
(An introduction to ifconfig is in sections [[Determine_the_current_TCP--IP_settings_on_a_system]] and
[[Set_a_system's_TCP--IP_settings]].) (((ifconfig)))

Interface aliases are useful for doing virtual hosting (((virtual hosting))), changing network addresses,
or for accepting packets for old interfaces.

TODO: Note: do not use "down" for an alias as it takes the entire interface down.

TODO: mention setting up route? examples? what systems need that route done also?

### Examples ###

Set an interface alias:

""ifconfig *ifname* inet *x.x.x.x* netmask 0xffffffff add

OR

""ifconfig *ifname* inet *x.x.x.x* netmask 0xffffffff alias

Add to /etc/rc.conf (FreeBSD):

""ifconfig\_ed0\_alias0="inet 127.0.0.253 netmask 0xffffffff"

Remove an interface alias:

""ifconfig *ifname* inet *x.x.x.x* -alias

Remove the line from rc.conf

### Practice Exercises ###


### More information ###

ifconfig(8), rc.conf(5), ifaliases(5), hostname.if(5)


