Cisco Cisco ios Cisco tips and tricks linux linux tips and tricks Networking networking tips and tricks switch switching tips and tricks Trunk in cisco,
Configuring a trunk link between a cisco switch and linux
Posted by Anbu
Published on Sunday, February 17, 2013
Problem:
How to configure a trunk link between a cisco switch and linux
Solution:
Sometimes you want to test configuration settings, and linux is a good environment to do these kinds of tests in
To configure a trunk between a cisco switch and a linux machine you first have to do the trunk configuration on the cisco switch:
switch(config)# int Gi 1/0/1
switch(config-if)#switchport trunk encapsulation dot1q
switch(config-if)# switchport mode trunk
switch(config-if)# int vlan 200
switch(config-if)# ip address 10.0.0.1 255.255.255.0
switch(config-if)# no shutdown
switch(config-if)# exit
switch(config)#
Then the linux configuration for an interface eth0:
linux# /sbin/modprobe 8021q
linux# /sbin/vconfig add eth0 200
linux#/sbin/ifconfig eth0.200 10.0.0.2 netmask 255.255.255.0 up
linux# ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=1.17 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.698 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.716 ms
How to configure a trunk link between a cisco switch and linux
Solution:
Sometimes you want to test configuration settings, and linux is a good environment to do these kinds of tests in
To configure a trunk between a cisco switch and a linux machine you first have to do the trunk configuration on the cisco switch:
switch(config)# int Gi 1/0/1
switch(config-if)#switchport trunk encapsulation dot1q
switch(config-if)# switchport mode trunk
switch(config-if)# int vlan 200
switch(config-if)# ip address 10.0.0.1 255.255.255.0
switch(config-if)# no shutdown
switch(config-if)# exit
switch(config)#
Then the linux configuration for an interface eth0:
linux# /sbin/modprobe 8021q
linux# /sbin/vconfig add eth0 200
linux#/sbin/ifconfig eth0.200 10.0.0.2 netmask 255.255.255.0 up
linux# ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=1.17 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.698 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.716 ms
0 comments
Readers Comments