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

FAQ
It is currently Wed Aug 23, 2017 8:58 am


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

Author Message
mandrei99
Post  Post subject: Linux adding and removing vlan tagged interfaces  |  Posted: Wed Aug 28, 2013 8:19 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
 

Linux adding and removing vlan tagged interfaces

In order to arrange vlan interfaces in Linux, some distros (base CentOS) need the vconfig utility:
Code:
# rpm -qa | grep vconfig
vconfig-1.9-3



Adding vlan interface in Linux:
Code:
# vconfig add eth1 10
Added VLAN with VID == 10 to IF -:eth1:-
# ip a l eth1.10
14: eth1.10@eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop
    link/ether 00:0c:29:5a:13:77 brd ff:ff:ff:ff:ff:ff

Code:
# ip a add 192.168.10.2/24 dev eth1.10
# ifconfig eth1.10 up
## ip a l eth1.10
14: eth1.10@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
    link/ether 00:0c:29:5a:13:77 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.2/24 scope global eth1.10
    inet6 fe80::20c:29ff:fe5a:1377/64 scope link
       valid_lft forever preferred_lft forever


To verify the eth1.10 vlan interface (tag 10), I'll do a ping in the 192.168.10.0/24 subnet and a tcpdump on the other window on the physical interface:
Code:
# ping 192.168.10.10
PING 192.168.10.10 (192.168.10.10) 56(84) bytes of data.
From 192.168.10.2 icmp_seq=2 Destination Host Unreachable
From 192.168.10.2 icmp_seq=3 Destination Host Unreachable

# tcpdump -nni eth1 -e vlan
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
14:23:26.335853 00:0c:29:5a:13:77 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, arp who-has 192.168.10.10 tell 192.168.10.2
14:23:27.350607 00:0c:29:5a:13:77 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, arp who-has 192.168.10.10 tell 192.168.10.2
14:23:28.361366 00:0c:29:5a:13:77 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, arp who-has 192.168.10.10 tell 192.168.10.2


Removing vlan interface in Linux:
Code:
# vconfig rem eth1.10
Removed VLAN -:eth1.10:-
# ip a l eth1.10
Device "eth1.10" does not exist.





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

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

admin

0

7258

Mon Aug 19, 2013 10:44 am

admin 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

688

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

951

Tue May 12, 2015 6:07 am

admin View the latest post

There are no new unread posts for this topic. How to add IP alias in Debian Linux to last after reboot

debuser

3

1448

Sat Jul 21, 2012 6:03 am

Harespok View the latest post

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

mandrei99

0

706

Thu Oct 09, 2014 3:11 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to add (persistent) static ARP entries in Linux

mandrei99

0

10675

Mon Sep 29, 2014 5:17 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux How to change hardware MAC address of an interface

debuser

1

892

Tue Dec 06, 2011 6:26 am

Zettie49 View the latest post

There are no new unread posts for this topic. DNS reverse lookup in Windows 7 and Linux using - nslookup

mandrei99

0

2592

Tue Jan 13, 2015 8:31 pm

mandrei99 View the latest post

There are no new unread posts for this topic. How to dump kernel route cache in Linux

mandrei99

0

1588

Mon Jan 12, 2015 11:26 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

15230

Tue Jan 20, 2015 5:01 pm

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:  
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