Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Thu Dec 07, 2023 8:51 am


Internet Protocol, Transport Control Protocol, Network protocols, Routing, Routers, IP aliases, Routes, Ethernet

Author Message
admin
Post  Post subject: FreeBSD - Adding VLAN Tagged subinterface using ifconfig  |  Posted: Mon Aug 19, 2013 10:44 am
Site Admin

Joined: Mon Aug 03, 2009 8:43 am
Posts: 104

Offline
 

FreeBSD - Adding VLAN Tagged subinterface using ifconfig

Here's how to add a tagged vlan interface in FreeBSD all versions.

Step 1: create the vlan subinterface:
Code:
# ifconfig vlan122 create


Step 2: assign it a vlan ID and vlan device:
Code:
# ifconfig vlan122 vlan 122 vlandev em0


Step 3: check the vlan subinterface:
Code:
# ifconfig vlan122
vlan122: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:07:e9:a5:9b:fa
        media: Ethernet autoselect (1000baseTX <full-duplex>)
        status: active
        vlan: 122 parent interface: em0

You will notice that interface status is not UP. This has to be changed once it is used.

Step 4: assign ip address:
Code:
# ifconfig vlan122 10.1.122.1/24
# ifconfig vlan122 up
# ifconfig vlan122
vlan122: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:07:e9:a5:9b:fa
        inet 10.1.122.1 netmask 0xffffff00 broadcast 10.1.122.255
        media: Ethernet autoselect (1000baseTX <full-duplex>)
        status: active
        vlan: 122 parent interface: em0


This subinterface will be equivalent of a tagged logical interface in different vendors (Juniper for example).

To make this vlan tagged interface configuration persistent after reboot, edit /etc/rc.conf file and add the following line / alter cloned_interfaces in the networking section:
Code:
cloned_interfaces="... vlan122"
ifconfig_vlan122="inet 10.1.122.1/24 vlan 122 vlandev em0"

_________________
VPSie - SSD VPS servers in AMS-IX, LINX, DE-CIX
https://vpsie.com





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "FreeBSD - Adding VLAN Tagged subinterface using ifconfig"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. Linux adding and removing vlan tagged interfaces

mandrei99

0

35574

Wed Aug 28, 2013 8:19 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD em driver overwrites incoming vlan tagged frames 802.1p priority field

debuser

0

4535

Wed Nov 21, 2012 10:59 am

debuser View the latest post

There are no new unread posts for this topic. ERROR: trying to remove VLAN -:791:- error: Invalid argument

admin

0

3511

Tue May 12, 2015 6:07 am

admin View the latest post

There are no new unread posts for this topic. FreeBSD PF supported icmp types

admin

0

3221

Fri Jan 28, 2011 9:15 am

admin View the latest post

There are no new unread posts for this topic. FreeBSD - multiple routing tables

mandrei99

0

10466

Wed Aug 28, 2013 8:40 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD: How to list IPv6 neighbors

mandrei99

0

6069

Mon Oct 06, 2014 10:00 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD show network interface statistics

mandrei99

0

5693

Wed Sep 25, 2013 9:30 am

mandrei99 View the latest post

There are no new unread posts for this topic. Set up FTP PROXY via command line in Linux/FreeBSD

mandrei99

0

22859

Tue Jan 20, 2015 5:01 pm

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD tcpdump on enc0 doesn't show any traffic

mandrei99

0

3762

Fri Jun 21, 2013 8:54 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD list interface multicast group membership

mandrei99

0

4655

Tue Dec 03, 2013 9:02 am

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO