how create virtual interface (as Cisco vlan)

Hi, please help me. I want create virtual interface, but vlan is tagged! How create virtual interface and tie to real interface (physical) as on Cisco vlan access port?
 
See vlan(4). In short:
Code:
cloned_interfaces="vlan10"
ifconfig_em0="up"
ifconfig_vlan10="inet 10.10.10.1 netmask 255.255.255.0 vlan 10 vlandev em0"
 
Thank you. But you example is create tagged vlan10 on the interface em0. Please help, how create not tagged vlan10 on the interface em0?
 
"Not tagged VLAN", what you mean by that? A VLAN is tagged on the wire by definition and other types of VLANs don't exist. Please give us more information of what you're trying to do.
 
upload_2016-5-17_16-4-56.png

if_bge1 - is physical interface (192.168.0.1/24)
alias0 - is alias on physical interface (192.168.0.10/24)
if_bge1 connected (cable) to switch untagged port 18.
So, I want create two virtual interfaces on physical interface.
example:
vlan1 (not tagged) address is 192.168.0.1/24 --------->if_bge1
vlan 2(not tagged) address is 192.168.0.10/24--------->if_bge1
 
Code:
cloned_interfaces="vlan1 vlan2"
ifconfig_bge1="up"
ifconfig_vlan1="inet 192.168.0.1 netmask 255.255.255.0 vlan 1 vlandev bge1"
ifconfig_vlan2="inet 192.168.0.10 netmask 255.255.255.0 vlan 2 vlandev bge1"
 
me give (I have) only untagged port 18 on switch (look on picture). I can`t port 18 change mode to tag.
 
Good day.
Please help me.
How create virtual network interface card and tie to physical network card?
 
For example in Cisco:
physical interface have vlan mode (trank or access port). How create virtual interfaces in the FreeBSD?
 
divert and dumynet - is are packet tracker (firewalls). me necessary virtual nic as physical interface
example:
Code:
 ifconfig vlan0 create
ifconfig vlan1 create
vlan0: flags=8002<BROADCAST,MULTICAST> metric 0 mtu 1500
  ether 00:00:00:00:00:00
  vlan: 0 parent interface: <none>
vlan1: flags=8002<BROADCAST,MULTICAST> metric 0 mtu 1500
  ether 00:00:00:00:00:00
  vlan: 0 parent interface: <none>
 
I appreciate English isn't your first language, but the configuration you're trying to use makes very little sense. You can't turn one interface into two without some sort of encapsulation or tagging.

vlan1 (not tagged) address is 192.168.0.1/24 --------->if_bge1
vlan 2(not tagged) address is 192.168.0.10/24--------->if_bge1

For a start Cisco docs heavily discourage have two vlans using the same IP range, although it technically works.

Secondly, how can the FreeBSD machine receive traffic for two independent vlans, which are technically separate networks, if all the packets for both are coming into one interface untagged? At least one of the vlans is going to have to be tagged.

me give (I have) only untagged port 18 on switch (look on picture).

In that really confusing picture you have two separate lines coming into bge1. How is this actually connected up physically?
 
Maybe me necessary create virtual switch at the physical interface and connect two vlans to virtual switch?
 
Back
Top