Multiple VLANs on Single NIC

Jan 19, 2006 6 Replies

Hi, I am using Cisco 3570 Ethernet switch and Linex machine Red Hat



3.4.2-6.fc3. My switch is having VLAN and routing feature.It supports
802.1Q. I have a situation where Linux PC participates in two VLANs,but its having only one NIC and cable connecting to switch. How does it possible in Linux. Can one NIC have more than VLANs? I am having differnet IP ranges (subnets).

What i have tried is like this: I assigned trunking to the switch port which is connneced to Linux PC. Than i have assigned two Different IP adderss(differnet subnets) on NIC with the help of Device aliase feature. First IP adderss is



192.168.100.5 (default gateway: 192.158.100.1) and second IP adderss is
192.168.101.6 (default gateway: 192.158.101.1). Than i am tring to Ping both the addresses. IP 192.168.100.5 is pinging but the aliase IP
192.168.101.6 is not pinging. With this my exprimet to assign two IP address to one NIC failed

I would appriciate any input on this and feel lucky if it comes soon as i need this information very urgently. Best Regards. Yash.



Hello,

rather than 802.1Q trunking, you could configure the port on the switch as a routed port, and then assign a secondary address for the second subnet. The configuration of the switchport would look like this:

interface FastEthernet0/1 no switchport ip address 192.158.100.1 255.255.255.0 ip address 192.158.101.1 255.255.255.0 secondary

This way, both IP addresses configured on your LINUX machine could communicate with each other.

Regards,

snipped-for-privacy@solutionfinders.nl

formatting link
We've got answers !

"yash" skrev i en meddelelse news: snipped-for-privacy@f14g2000cwb.googlegroups.com...

sure it will fail - you need to be able to "read" and understand tagged frames on your NIC. So if you have set the encapsulation to dot1q on your trunkport of the switch, then the NIC driver must be able to understand this. otherwise the native VLAN will work, as packets are not tagged on native VLAN.

HTH Martin Bilgrav

Hi,

Thanks for your input. But what you have suggested is might be not what I asked. My Linux machine wants to have two IP address, of two different subnet (i.e. two different VLANs). So that, it can talk to two different VLAN (i.e. Linux machines residing on that). Also I am having two Cisco switch for this test setup. Cisco 2950 is having all the VLANs and Inter VLAN routing is through Cisco 3750 switch.

I hope know you are in better position to solve my problem.

Regards Yash

Hi Martin,

Thanks for replying.

Would you like to tell me how it can be done? My one Linux machine is having Dlink's DGE-550T gigabit Ethernet card and other one is having Realtek's RTL-8169. Both are 802.1q capable. But I don't know how to use 802.1q capability or modify its driver (if necessary).

Regards Yash

Look at

formatting link
Regards,

Marco.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required