看板FreeBSD
标 题Re: FreeBSD 上面 VLAN 的实作是否需要特殊网卡?
发信站海大计中 BBS (Thu Jan 19 10:47:02 2006)
转信站ptt!ctu-reader!ctu-peer!news.nctu!nctumenews!news.ind.ntou!news.ntou!n
※ 引述《[email protected] (due)》之铭言:
> 请问有人作过 FreeBSD/Linux 上开 VLAN 与 Cisco Switch 界接或自己加
> VLAN 的实作吗?我从网路上看来的需要特定网路卡 patch 。
> 请教一下经验罗,我的网卡有一张是 Intel 82559 和螃蟹卡。
您可以先 man 一下 vlan ...
Intel 82559 这片弟有试用过(目前机器上线中),可支援 VLAN 而且稳定。
小弟是在 kernel 中加入 device vlan
假设网卡是 fxp0 (Intel 82559)
ifconfig fxp0 up
ifconfig vlan0 create
ifconfig vlan0 vlan 123 vlandev fxp0
ifconfig vlan0 192.168.168.168 netmask 255.255.255.0
ifconfig vlan0 up
其中 vlan0 只是一个 interface 的名称,不一定要同於实际 vlan tag。
第三行的 vlan 123 即是设定 vlan0 所要咬的 vlan tag ,依设定是咬在 vlan 123 ,
而 vlandev 後面的 fxp0 即为 vlan0 所要使用的网卡。
您最後用 ifconfig 会看到下列资讯:
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
ether 00:e0:81:21:9c:3e
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
vlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.168.168 netmask 0xffffff00 broadcast 192.168.168.255
ether 00:e0:81:21:9c:3e
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
vlan: 123 parent interface: fxp0
在 Cisco Switch 上可以设定为 trunk mode..
例:Cisco 3500-24
interface GigabitEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
螃蟹卡部份小弟尚未用於 VLAN 中,这部份还请先进们提供经验。
&BTW: 小弟昨晚在使用 Intel 旧款网卡发现,部份 Intel 网卡是不支援 VLAN 的,
虽然在 ifconfig 会看到 options=8<VLAN_MTU> ,但不见得可以使用!
--
┌┼ Or
igin:
国立台湾海洋大学˙海大计中 bbs.ntou.edu.tw
└┘ A
uthor:
uftea 从 61-231-52-23.dynamic.hinet.net 发表