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

FAQ
It is currently Fri Dec 02, 2022 11:29 am


Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
 
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.
     

Topic review - FreeBSD - Adding VLAN Tagged subinterface using ifconfig
Author Message
Post subject: FreeBSD - Adding VLAN Tagged subinterface using ifconfig  |  Post Posted: Mon Aug 19, 2013 10:44 am
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"
Jump to:  
News 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