Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Dec 2003 04:32:57 -0800 (PST)
From:      Dirk-Willem van Gulik <dirkx@webweaving.org>
To:        flux <flux@hotbox.ru>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: 2 ip-addr for 1 netcard...
Message-ID:  <20031215042954.I83150@skutsje.san.webweaving.org>
In-Reply-To: <1903868068.20031215151634@hotbox.ru>
References:  <1903868068.20031215151634@hotbox.ru>

next in thread | previous in thread | raw e-mail | index | archive | help


On Mon, 15 Dec 2003, flux wrote:

> How do I assign two IP addresses for one netcard?

Just use the command 'man ifconfig' and check out the section
on 'alias'. In general it is somethign like


	vi /etc/rc.conf

and near

	ifconfig_rl0="10.11.0.2/24"

add things like

	ifconfig_rl0_alias0="10.11.0.66/32"
	ifconfig_rl0_alias1="10.11.0.67/32"
	ifconfig_rl0_alias2="10.11.10.1/24"

The manual equivalent is:

	ifconfig fxp0 alias 1.2.3.4 netmask 255.255.255.255

to add an extra IP to the intel fxp0 card with IP address 1.2.3.4 which
must be inside the currently assigned netmask for that interface or

	ifconfig fxp0 alias 1.2.5.4 netmask 255.255.255.0

to assign a second IP and submask.

Dw



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031215042954.I83150>