Chinaunix

标题: Question about "brctl hairpin br0 eth4 on [打印本页]

作者: cygnusnow    时间: 2015-01-30 10:30
标题: Question about "brctl hairpin br0 eth4 on
本帖最后由 cygnusnow 于 2015-01-30 10:31 编辑

大家好,我想家配置一个从eth4收到包后再从eth4发送出去。  查了最新的brctl有支持 haipin 功能。

原命令说明如下:
Usage: brctl [commands]
commands:
        addbr           <bridge>                add bridge
        delbr           <bridge>                delete bridge
        addif           <bridge> <device>       add interface to bridge
        delif           <bridge> <device>       delete interface from bridge
        hairpin         <bridge> <port> {on|off}        turn hairpin on/off
        setageing       <bridge> <time>         set ageing time
        setbridgeprio   <bridge> <prio>         set bridge priority
        setfd           <bridge> <time>         set bridge forward delay
        sethello        <bridge> <time>         set hello time
        setmaxage       <bridge> <time>         set max message age
        setpathcost     <bridge> <port> <cost>  set path cost
        setportprio     <bridge> <port> <prio>  set port priority
        show            [ <bridge> ]            show a list of bridges
        showmacs        <bridge>                show a list of mac addrs
        showstp         <bridge>                show bridge stp info
        stp             <bridge> {on|off}       turn stp on/off

我没有成功配置 hairpin.  我的命令如下。  求大家帮助:
brctl addbr br0
brctl addif br0 eth4
brctl hairpin br0 eth4 on

ifconfig br0 10.10.0.12 netmask 255.255.255.0 up
ifconfig br0:1 53.53.0.12 netmask 255.255.240.0 up
ifconfig eth4 up


cat  /etc/sysconfig/network-scripts/ifcfg-eth4
DEVICE=eth4
BOOTPROTO=none
ONBOOT=yes
PROMISC=yes
BRIDGE=br0

cat  /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=none
IPADDR=10.10.0.12
BROADCAST=10.10.0.255
NETMASK=255.255.255.0

cat  /etc/sysconfig/network-scripts/ifcfg-br0:1
DEVICE=br0:1
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=none
IPADDR=53.53.0.12
NETMASK=255.255.240.0

作者: cygnusnow    时间: 2015-01-30 13:54
Sorry.  这个功能在rhel 7支持。  之前我装在rhel6.1上了。    命令本身是对的。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2