I'm trying to use two VLANs (VLAN 43 & VLAN 44) in same eth
card in linux Centos 7 and Cisco switch trunk for the eth
port.
My configuration is:
[root@rdo1 network-scripts]# cat ifcfg-eth2
TYPE=Ethernet
DEFROUTE=no
NAME=eth2
DEVICE=eth2
ONBOOT=yes
IPV6INIT=no
NM_CONTROLLED=no
[root@rdo1 network-scripts]# cat ifcfg-eth2.43
VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
PHYSDEV=eth2
DEVICE=eth2.43
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.13.43.24
NETMASK=255.255.255.0
[root@rdo1 network-scripts]# cat ifcfg-eth2.44
VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
PHYSDEV=eth2
DEVICE=eth2.44
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.13.44.24
NETMASK=255.255.255.0
Cisco configuration:
vlan 43-44
!
int gi3/1
no ip address
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 43,44
switchport mode trunk
no mdix auto
storm-control broadcast level 10.00
spanning-tree bpdufilter enable
no cdp enable
!
end
My network configuration according to ifconfig
is:
[root@rdo1 network-scripts]# ifconfig
eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::29c:2ff:fea1:35a4 prefixlen 64 scopeid 0x20<link>
ether 00:9c:02:a1:35:a4 txqueuelen 1000 (Ethernet)
RX packets 164 bytes 17921 (17.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 29 bytes 2424 (2.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth2.43: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.13.43.24 netmask 255.255.255.0 broadcast 10.13.43.255
inet6 fe80::29c:2ff:fea1:35a4 prefixlen 64 scopeid 0x20<link>
ether 00:9c:02:a1:35:a4 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9 bytes 690 (690.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth2.44: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.13.44.24 netmask 255.255.255.0 broadcast 10.13.44.255
inet6 fe80::29c:2ff:fea1:35a4 prefixlen 64 scopeid 0x20<link>
ether 00:9c:02:a1:35:a4 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 816 (816.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I want to know how to add gateway for every VLAN. I tried routing tables and they didn't work for me.
Does anyone know how to do this?