Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2001 16:35:15 -0500
From:      "Matthew Emmerton" <matt@gsicomp.on.ca>
To:        "'Drew J. Weaver'" <drew.weaver@thenap.com>, "'net@freebsd.org'" <net@FreeBSD.ORG>
Subject:   Re: Adding IP aliases
Message-ID:  <002c01c096ce$04f7c530$1200a8c0@gsicomp.on.ca>
References:  <C99657266DE1D211B8250090274EA782EE7265@cartman.cisp.cc>

next in thread | previous in thread | raw e-mail | index | archive | help
>         Does anyone know of a FAQ or HOWTO for adding IP aliases to a
> FreeBSD box? I can do it under linux and Im just wondering if there are
any
> differences or what-not.

In /etc/rc.conf, add or edit lines like this (I have an 'ed0' network card):

network_interfaces="lo0 ed0"
ifconfig_lo0="inet 127.0.0.1 netmask 255.0.0.0"
ifconfig_ed0="inet 192.168.0.2 netmask 255.255.255.0"
ifconfig_ed0_alias0="inet 192.168.0.10 netmask 255.255.255.255"
ifconfig_ed0_alias1="inet 192.168.0.11 netmask 255.255.255.255"

You need to set the netmask of the aliases to what I have above, otherwise
you won't be able to use the aliased IPs.

If you want to do it from the command line (note that your aliases will be
lost when you reboot unless you do the above), do this:

ifconfig ed0 alias 192.168.0.10 netmask 255.255.255.255

--
Matt Emmerton



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002c01c096ce$04f7c530$1200a8c0>