LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 11-20-2020, 10:28 AM   #1
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch, CentOS
Posts: 360

Rep: Reputation: 21
Question Create Virt. NIC in FreeBSD


I'm new to BSD and have a problem creating a virtual NIC. Trying out OPNSense and that uses FreeBSD so...
The M/B only has one NIC on this miniATX but I need two and no there's no room or PCI outlet so...
There is a PCIe but I ain't got one of those.

Have tried the thing I used in CentOS,
Quote:
ifconfig eth0:0 123.123.22.22
(think it was like that) but that won't work.

Searched a lot but nothing I find seems to work.
Have seen something they call alias but as far as I've seen that is only on the same network but has to be different NetMask or an error shows up as they say.

Anyone knows this?
Another thing, if I can use this Virt-NIC on a different network, is that less secure then to use 2 separate NICs as for a firewall thingy?
If so I need to get a NIC for PCIe or change M/B but I'm trying to get the quickest thing available for now.



//B52
 
Old 11-21-2020, 01:51 PM   #2
jggimi
Member
 
Registered: Jan 2016
Distribution: None. Just OpenBSD.
Posts: 232

Rep: Reputation: 105Reputation: 105
Are you thinking of VLANs? Using VLANs -- the standard is IEEE 802.1Q -- is one way of logically segmenting a physical network, and generally requires a managed switch that supports the standard. FreeBSD supports these. For provisioning, start here: https://www.freebsd.org/doc/handbook/network-vlan.html. For background on VLANs, start here: https://en.wikipedia.org/wiki/Virtual_LAN.
 
Old 11-24-2020, 01:28 PM   #3
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch, CentOS
Posts: 360

Original Poster
Rep: Reputation: 21
Have no clue if VLAN is the same as a Virtual NIC.
With the thing I showed I can add lots of virtual NICs that has unique IP-addresses that don't need to have the same submask, eg. eth0:0, eth0:1, eth0:2, eth0:3, eth0:4

If I can get this to work with VLAN and that works for me as two separate NICs with IPs at different networks, in this case one for LAN and one for WAN it should work.
Also the thing about how secure it is as a firewall with only one NIC if that makes any difference
 
Old 11-24-2020, 02:35 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,807

Rep: Reputation: Disabled
Quote:
Originally Posted by Basher52 View Post
I'm new to BSD and have a problem creating a virtual NIC. Trying out OPNSense and that uses FreeBSD so...
The M/B only has one NIC on this miniATX but I need two and no there's no room or PCI outlet so...
There is a PCIe but I ain't got one of those.

Have tried the thing I used in CentOS,
Code:
ifconfig eth0:0 123.123.22.22
(think it was like that) but that won't work.

Searched a lot but nothing I find seems to work.
Have seen something they call alias but as far as I've seen that is only on the same network but has to be different NetMask or an error shows up as they say.
It's a bit unclear what you're looking to accomplish, but is seems that you want to bind more than one IP address to the same interface.

In Linux, this used to be done using aliases, which were (as you say) a bit like virtual NICs, in that you could assign multiple addresses that would then end up being bound to the same physical interface. This practice has been deprecated for quite some time, and instead multiple addresses are simply added to the same interface.

Under BSD, it seems the alias method is still in use, but the syntax of the ifconfig command differs slightly from Linux. Here's a really old page showing how it's done, and here's a much more recent forum post detailing the exact same procedure.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to create ext4 file system in a partition that was formatted with freeBSD file system(freebsd-ufs) vectrum Slackware 10 08-02-2020 03:24 AM
[SOLVED] installing virt-manager and virt-viewer on desktop for managing remote server yvesjv Slackware 4 04-24-2019 04:00 PM
Virsh/Virt-Manager/Virt-Install broken after upgrade to Xubuntu 17.10 Zabzoo Linux - Desktop 2 02-01-2018 09:05 AM
LXer: Hacking libvirt/virsh/virt-manager/virt-install at Xen 4.0 Dom0 on top of Ubunt LXer Syndicated Linux News 0 05-06-2010 03:50 PM
LXer: Virt-install&Virt-manager at Xen 4.0-rc8 (2.6.32.10 pvops) Dom0 on top Ubuntu K LXer Syndicated Linux News 0 03-26-2010 10:41 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 11:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration