Recognize when and how to set or remove an interface alias

Author: name contact BSD flavour

Reviewer: name contact BSD flavour

Reviewer: 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)