Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Mar 2013 11:28:21 +1030
From:      Benjamin Close <Benjamin.Close@clearchain.com>
To:        Ian FREISLICH <ianf@clue.co.za>
Cc:        Tom Evans <tevans.uk@googlemail.com>, Yasir hussan <kolyasir@gmail.com>, Current <freebsd-current@freebsd.org>
Subject:   Re: using multiple interfaces for same Network Card
Message-ID:  <513FCF2D.1000006@clearchain.com>
In-Reply-To: <E1UFNyS-000H0R-TC@clue.co.za>
References:  <CAMwCe3SyJJVLDciEYjt2urQ9Z2HwPWA1c1pLQC1Y8qJ8p-0f3g@mail.gmail.com> <CAMwCe3SeCroZW1EuZ1FouZcu9S6==o%2BCDoukZt_o2UQjTvcV9Q@mail.gmail.com> <CAFHbX1LDeWRZ=KTJTYy=0QOsoSuRCTp0odiGngq=pWD4Qjpm4Q@mail.gmail.com> <E1UFNyS-000H0R-TC@clue.co.za>

next in thread | previous in thread | raw e-mail | index | archive | help
On 12/03/2013 22:36, Ian FREISLICH wrote:
> Yasir hussan wrote:
>> Thanks for notic but all the elebration was for make alias on one
>> interface but i want to have multiple interface, i can no where that
>> some one would have tring to creating new interfaces and using them,
>> or may be i am missing something, just send its solution if have,
>> solution should be for
> I still think you're confusing Linux semantics with FreeBSD semantics.
>
> On linux you would have:
> eth0      Link encap:Ethernet  HWaddr 00:1E:C9:53:0B:61
>            inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
>            inet6 addr: fe80::21e:c9ff:fe53:b61/64 Scope:Link
>            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>            RX packets:211328068 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:368394006 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0 txqueuelen:1000
>            RX bytes:34065846811 (31.7 GiB)  TX bytes:476377525764 (443.6 GiB)
>            Interrupt:169 Memory:e6000000-e6011100
>
> eth0:1    Link encap:Ethernet  HWaddr 00:1E:C9:53:0B:61
>            inet addr:10.0.1.1  Bcast:10.0.1.255  Mask:255.255.255.0
>            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>            Interrupt:169 Memory:e6000000-e6011100
>
>
> On FreeBSD you would have:
>
> re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>          options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
>          ether 54:04:a6:96:0c:1e
>          inet 10.0.0.1 netmask 0xffffff00 broadcast 10.0.0.255
>          inet 10.0.1.1 netmask 0xffffff00 broadcast 10.0.1.255
>          media: Ethernet autoselect (1000baseT <full-duplex>)
>          status: active
>
> These are both the same thing.  Is there any particular reason that
> you want multiple interfaces?  I can't see a use for it beyond "it's
> what I'm used to seeing" unless they're VLAN interfaces.
>
> Ian
>

Just a comment on the aliases vs virtual interfaces. Having used both 
aliases and virtual interfaces,  there is use cases which have always 
been easier under Linux than FreeBSD due to the virtual interface.

Once case is firewall rules that follow the device.
Let me explain.

Lets say under freebsd I setup two lans on the same card using aliases 
and a switch that is NOT vlan capable (ie home adsl modem, some other 
unmanaged switch).
ifconfig re0 172.16.1.1
ifconfig re0 alias 192.168.1.1

The firewall rules require the net to be used rather than an interface 
since the interface handles more than one lan.
ie (pf style):

pass in quick on re0 from 192.168.1.1/24 to any

Linux makes this easier:

ifconfig eth0 172.16.1.1
ifconfig eth0:1 192.168.1.1

pass in quick on eth0:1 from any to any

Whilst it's a minor difference, I can shift the device IP and my 
firewall rules automatically follow. This is just one case where having 
a virtual device make things easier vs aliases.

Cheers,
      Benjamin





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