分页: 1 / 1

[转贴]如何做端口汇聚

发表于 : 2011-06-12 12:09
hyaska
出自:http://jreypo.wordpress.com/2010/08/11/ ... -trunking/

关键字:Failover Loadbalance LACP
1、做trunk0接口

代码: 全选

[obsd47]/# ifconfig em1 up
[obsd47]/# ifconfig em2 up
[obsd47]/# ifconfig trunk0 trunkport em1
[obsd47]/# ifconfig trunk0 trunkport em2
[obsd47]/# ifconfig trunk0
trunk0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:0c:29:24:b7:c6
        priority: 0
        trunk: trunkproto roundrobin
                trunkport em2 active
                trunkport em1 master,active
        groups: trunk
        media: Ethernet autoselect
        status: active
2、设置IP

代码: 全选

[obsd47]/# ifconfig trunk0 trunkproto failover 192.168.126.5 netmask 255.255.255.0 up
[obsd47]/# ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33200
        priority: 0
        groups: lo
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:0c:29:24:b7:bc
        priority: 0
        media: Ethernet autoselect (1000baseT full-duplex,master)
        status: active
        inet 192.168.126.4 netmask 0xffffff00 broadcast 192.168.126.255
        inet6 fe80::20c:29ff:fe24:b7bc%em0 prefixlen 64 scopeid 0x1
em1: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:0c:29:24:b7:c6
        priority: 0
        trunk: trunkdev trunk0
        media: Ethernet autoselect (1000baseT full-duplex,master)
        status: active
        inet6 fe80::20c:29ff:fe24:b7c6%em1 prefixlen 64 scopeid 0x2
em2: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:0c:29:24:b7:c6
        priority: 0
        trunk: trunkdev trunk0
        media: Ethernet autoselect (1000baseT full-duplex,master)
        status: active
        inet6 fe80::20c:29ff:fe24:b7d0%em2 prefixlen 64 scopeid 0x3
enc0: flags=0<> mtu 1536
        priority: 0
trunk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:0c:29:24:b7:c6
        priority: 0
        trunk: trunkproto failover
                trunkport em2
                trunkport em1 master,active
        groups: trunk
        media: Ethernet autoselect
        status: active
        inet 192.168.126.5 netmask 0xffffff00 broadcast 192.168.126.255
        inet6 fe80::20c:29ff:fe24:b7c6%trunk0 prefixlen 64 scopeid 0x6
pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33200
        priority: 0
        groups: pflog
3、启动时生效要有配置文件

代码: 全选

[obsd47]/# echo "up" >hostname.em1
[obsd47]/# echo "up" >hostname.em2
[obsd47]/# echo "trunkproto failover trunkport em1 trunkport em2 192.168.126.5 netmask 255.255.255.0" > hostname.trunk0
[obsd47]/# cat hostname.trunk0
trunkproto failover trunkport em1 trunkport em2 192.168.126.5 netmask 255.255.255.0

回复: [转贴]如何做端口汇聚

发表于 : 2011-06-12 13:12
leo
感谢hyaska兄发布并翻译精彩内容!!!

回复: [转贴]如何做端口汇聚

发表于 : 2011-07-07 15:30
chang
学习了,多谢