顯示文章

這裡允許您檢視這個會員的所有文章。請注意, 您只能看見您有權限閱讀的文章。


文章 - lawrence.pan

頁: [1]
1
我也是跟樓主相同的狀況, 想做頻寬合聚,但只會跑在一張介面卡上:

我是用 Bandwidth Monitor 的軟體去監視網卡的流量。

lab os: centos 5.3

interface Port-channel1
 switchport mode access

interface FastEthernet0/3
 switchport mode access
 load-interval 30
 channel-group 1 mode active
 spanning-tree portfast
 spanning-tree bpdufilter enable

interface FastEthernet0/5
 switchport mode access
 load-interval 30
 channel-group 1 mode active
 spanning-tree portfast
 spanning-tree bpdufilter enable


lo249#sh lacp neighbor
Flags:  S - Device is requesting Slow LACPDUs
        F - Device is requesting Fast LACPDUs
        A - Device is in Active mode       P - Device is in Passive mode   

Channel group 1 neighbors

Partner's information:

                  LACP port                        Admin  Oper   Port    Port
Port      Flags   Priority  Dev ID          Age    key    Key    Number  State
Fa0/3     FA      255       00e0.815d.7eeb   8s    0x0    0x9    0x1     0x3F
Fa0/5     FA      255       00e0.815d.7eeb   8s    0x0    0x9    0x2     0x3F

lo249#sh lacp internal
Flags:  S - Device is requesting Slow LACPDUs
        F - Device is requesting Fast LACPDUs
        A - Device is in Active mode       P - Device is in Passive mode   

Channel group 1
                            LACP port     Admin     Oper    Port        Port
Port      Flags   State     Priority      Key       Key     Number      State
Fa0/3     SA      bndl      32768         0x1       0x1     0x3         0x3D
Fa0/5     SA      bndl      32768         0x1       0x1     0x5         0x3D


lo249#sh lacp counters
             LACPDUs         Marker      Marker Response    LACPDUs
Port       Sent   Recv     Sent   Recv     Sent   Recv      Pkts Err
---------------------------------------------------------------------
Channel group: 1
Fa0/3       24799  934      0      0        0      0         0   
Fa0/5       24790  1046     0      0        0      0         0   




## Linux set ##

# cat /etc/modprobe.conf
alias bond0 bonding
options bond0 mode=4 miimon=50 lacp_rate=1 xmit_hash_policy=layer3+4

# cat /etc/sysconfig/network-scripts/ifcfg-{eth0,eth1,bond0}

DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
HWADDR=00:E0:81:5D:7E:EB

DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
HWADDR=00:E0:81:5D:7E:EC

DEVICE=bond0
IPADDR=192.168.1.70
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no

# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.2.4 (January 28, 2008)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer3+4 (1)
MII Status: up
MII Polling Interval (ms): 50
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: fast
Active Aggregator Info:
        Aggregator ID: 3
        Number of ports: 2
        Actor Key: 9
        Partner Key: 1
        Partner Mac Address: 00:0a:b8:24:ef:00

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:e0:81:5d:7e:eb
Aggregator ID: 3

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:e0:81:5d:7e:ec
Aggregator ID: 3

2
當初只是為了找方法設,才臨時使用storm-control 來限制,應該可以找有關 access-list 的方式來設置 rate-limite

3
int f0/1
sorm-control unicast level bps 1024k

限制接f0/1的pc 上傳,限值會超過一點點,有 burst

4
backupdaily.sh
代碼: [選擇]
#!/bin/sh
day=`date +%Y-%m-%d`
basedir="/tmp/backup/daily"

        /etc/rc.d/init.d/mysqld stop && sleep 3

        cd /var/lib/ && tar -cvf $basedir/mysql-$day.tar mysql > /dev/null 2>&1

        /etc/rc.d/init.d/mysqld start

        exit

ftp-lifeshow.sh

代碼: [選擇]
#!/bin/sh

host="10.10.10.10"
id="xxx"
pw="xxx"

basedir="/tmp/backup/daily"

day=`date +%Y-%m-%d`
filename="mysql-$day.tar"

function transfter (){

/usr/bin/expect -c "
               
                set timeout 86400
                spawn ftp -n $host
               
                expect \"ftp>\" { send \"user $id \r\"}
                expect \"Password:\" {send \"$pw\r\"}
                expect \"ftp>\" { send \"lcd $basedir\r\"}
                expect \"ftp>\" { send \"put $filename\r\"}
                expect \"complete\" { send \"bye\r\"}
               
"
}

        transfter > $basedir/$filename.log


exit

service crond restart
chkconfig crond on

vi /etc/crontab
# add cron
30 2 * * * root sh /root/backupdaily.sh
30 3 * * * root sh /root/ftp-lifeshow.sh

我試這樣OK ,你試試吧。




頁: [1]