在linux中虚拟网卡,可以在/etc/network/interface里加,但是不能改MAC地址。在网上搜到了下面的文章,需要装一下vlan,挺好用的。
-------------------------------------------------------------------------------------
eth0.2
- Implements 802.1Q VLAN spec.
- Can support up to 4094 VLANs per ethernet interface.
- Scales well in critical paths: O(n), where n is the number of PHYSICAL ethernet interfaces, and that is only on ingress. O(1) in every other critical path, as far as I know.
- Supports MULTICAST
- Can change MAC address of VLAN.
- Multiple naming conventions supported, and adjustable at runtime.
- Optional header-reordering, to make the VLAN interface look
JUST LIKE an Ethernet interface. This fixes some problems with DHCPd and anything else that uses a SOCK_PACKET socket. Default setting is off, which works for every other protocol I know about, and is slightly faster.