From owner-freebsd-net@FreeBSD.ORG Fri Dec 17 21:30:31 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83A631065694 for ; Fri, 17 Dec 2010 21:30:31 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 124D78FC1F for ; Fri, 17 Dec 2010 21:30:30 +0000 (UTC) Received: by wyf19 with SMTP id 19so1055761wyf.13 for ; Fri, 17 Dec 2010 13:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:reply-to:from:to:references :in-reply-to:subject:date:message-id:mime-version:content-type :content-transfer-encoding:x-mailer:content-language:thread-index; bh=zFmCfkkwUQ52N4S/3J5wo7G7YDgdCqSy/z87koC26yQ=; b=X4siV39mfFT61VwHVlGiPjdro9etVinNGOCrcsxcpBiSzWesXTli+mpyPtA/WMwr+C cZi/jVfBHYRyMSHDkFl8URweLbXNYeCjqnGv6AmhYW1DwJZEwn3fWGcPwNfr+VLMsSCJ pFqhAsq+zX/ja2d0WtfJ8a1aViHVqCC9nW+C4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=reply-to:from:to:references:in-reply-to:subject:date:message-id :mime-version:content-type:content-transfer-encoding:x-mailer :content-language:thread-index; b=WisGffq9wckpvPQ4ltWMLGOFuDuIjVDLbwzEJfqT3lLwzO+bCN/P/gBxNWx/kIVyPc /cRaivnw2L7W1x787jaZXAO5aM54FE5VLXT5M6O93rD5FTkUgdhPb69mG47aMqxqyFth h+/0NRkgwuLM/7VqVAheAcE9dscuJGxPtnnKU= Received: by 10.227.199.84 with SMTP id er20mr824001wbb.194.1292621430029; Fri, 17 Dec 2010 13:30:30 -0800 (PST) Received: from rimwks1x64 ([92.124.62.89]) by mx.google.com with ESMTPS id m10sm604712wbc.4.2010.12.17.13.30.27 (version=SSLv3 cipher=RC4-MD5); Fri, 17 Dec 2010 13:30:29 -0800 (PST) From: rozhuk.im@gmail.com To: References: In-Reply-To: Date: Sat, 18 Dec 2010 05:30:26 +0800 Message-ID: <4d0bd675.8a1ce30a.200f.2c4b@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: ru Thread-Index: AcueHCP5bM4FAr90SM2TPsv/6qDlCgAFVgSg Subject: RE: Virtual Network Interface Card X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rozhuk.IM@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 21:30:31 -0000 Hi, Alex! You can make virtual NIC via netgraph. 1. ng_ether automatic attached to every physical NICs on load module. 2. connect ng_bridge to upper and lower hooks on ng_ether 3. create and connect ng_eiface to ng_bridge and you will get new NIC ngethX with its own MAC address and IP addrs too. 4. repeat 3 :) But, do not connect physical NICs to one ng_bridge! Example # 1. loading netgraph modules kldload ng_ether kldload ng_bridge kldload ng_eiface # 2. create and connect bridge to physical NIC ngctl mkpeer em0: bridge lower link0 ngctl connect em0: em0:lower upper link1 # we can set name for bridge, and replace em0:lower -> em0Bridge in ngctl calls ngctl name em0:lower em0Bridge # 3.1 create and connect first virtual NIC ngctl mkpeer em0:lower eiface link3 ether # 3.2 create and connect second virtual NIC ngctl mkpeer em0:lower eiface link4 ether # configure virtual NICs ifconfig ngeth0 link 00:11:22:33:44:01 ifconfig ngeth0 inet 192.168.1.254 netmask 255.255.255.0 ifconfig ngeth1 link 00:11:22:33:44:02 ifconfig ngeth1 inet 192.168.2.254 netmask 255.255.255.0 -- Rozhuk Ivan > -----Original Message----- > From: owner-freebsd-net@freebsd.org [mailto:owner-freebsd- > net@freebsd.org] On Behalf Of Alex Zhang > Sent: Saturday, December 18, 2010 2:30 AM > To: freebsd-net@freebsd.org > Subject: Virtual Network Interface Card > > Hi all, > I just wonder that if there are virtual nic functionalities which > provides MAC address? > I need to run ISC DHCP Server on 4 different IP's within one sever, > however I have only 2 NICs connected to the server. I need different > MAC Address for those IPs in order to run it properly, so bxn0:l > styled cards won't work. Solaris VNIC will just work for me, however > I would like to use FreeBSD, Alex > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"