BSD Newsletter.com
   Front | Info | Lists | Newsfeeds | Study Guide | What is BSD?
Advertisement: The OpenBSD PF Packet Filter Book: PF for NetBSD, FreeBSD, DragonFly and OpenBSD

BSD Links
·New Links
·Advocacy
·Drivers
·Events
·Flavours
·FAQs
·Guides
·Programming
·Security
·Software
·User Groups

This is the BSDA Study Guide Book written via a wiki collaboration. This is a work in progress. You may contribute to or discuss this specific page at http://bsdwiki.reedmedia.net/wiki/Recognize_when_and_how_to_set_or_remove_an_interface_alias.html.

Recognize when and how to set or remove an interface alias

Concept

Recognize when it is appropriate to set or remove an interface alias 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.)

Interface aliases are useful for doing 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)



Front | Information | Lists | Newsfeeds