Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is VLAN tag and subinterface number is same or they are different. I want to access a Vlan enabled device with Vlan Id 10, so should I create a subinterface of 10 in eth0?

share|improve this question

1 Answer 1

Adding a vlan tagged interface will create a new interface tagged. So no need of creating a new sub interface for the vlan, as it will be created automatically.

$ ifconfig eth0
eth0      Link encap:Ethernet  Endereço de HW 00:24:8c:55:45:8a  
          UP BROADCAST MULTICAST  MTU:1500  Métrica:1
          pacotes RX:0 erros:0 descartados:0 excesso:0 quadro:0
          Pacotes TX:0 erros:0 descartados:0 excesso:0 portadora:0
          colisões:0 txqueuelen:1000 
          RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
          IRQ:19 Endereço de E/S:0xdead 

$ sudo vconfig add eth0 64
$ sudo ifconfig eth0.64 10.0.0.1 netmask 255.255.255.0
$ ifconfig
eth0      Link encap:Ethernet  Endereço de HW 00:24:8c:55:45:8a  
          UP BROADCAST MULTICAST  MTU:1500  Métrica:1
          pacotes RX:0 erros:0 descartados:0 excesso:0 quadro:0
          Pacotes TX:0 erros:0 descartados:0 excesso:0 portadora:0
          colisões:0 txqueuelen:1000 
          RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
          IRQ:19 Endereço de E/S:0xdead 

eth0.64   Link encap:Ethernet  Endereço de HW 00:24:8c:55:45:8a  
          inet end.: 10.0.0.1  Bcast:10.0.0.255  Masc:255.255.255.0
          endereço inet6: fe80::224:8cff:fe55:458a/64 Escopo:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Métrica:1
          pacotes RX:0 erros:0 descartados:0 excesso:0 quadro:0
          Pacotes TX:0 erros:0 descartados:25 excesso:0 portadora:0
          colisões:0 txqueuelen:0 
          RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.