存档

2011年2月 的存档

bonding in linux

2011年2月18日 评论已被关闭

####### bond0 #######
dond0 use dhcp
$cat ifcfg-bond0
DEVICE=bond0
BOOTPROTO=dhcp
ONBOOT=yes

$cat ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes

DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes

####### bond1 #######
$cat ifcfg-bond1
DEVICE=bond1
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.56.101
NETMASK=255.255.255.0
BONDING_OPTS=”mode=1 miimon=80 arp_interval=500 arp_ip_target=192.168.56.1″          

$cat ifcfg-eth2
DEVICE=eth2
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond1
SLAVE=yes

$cat ifcfg-eth3
DEVICE=eth3
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond1
SLAVE=yes

#######################3
cat /etc/modprobe.conf
add:
alias bond1 bonding
options bond1 miimon=80 mode=1

$modprobe bonding
$sudo /sbin/service network restart
$cat /proc/net/bonding/bond0
$cat /proc/net/bonding/bond1

[root@2hei.net ~]# ifconfig
bond0     Link encap:Ethernet  HWaddr 08:00:27:88:8C:E3  
          inet addr:10.100.10.110  Bcast:10.100.10.255  Mask:255.255.254.0
          inet6 addr: fe80::a00:27ff:fe88:8ce3/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:50626 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2674 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4491313 (4.2 MiB)  TX bytes:425663 (415.6 KiB)

bond1     Link encap:Ethernet  HWaddr 08:00:27:6F:EE:83  
          inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe6f:ee83/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:1980 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2064 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:124007 (121.1 KiB)  TX bytes:111090 (108.4 KiB)

eth0      Link encap:Ethernet  HWaddr 08:00:27:88:8C:E3  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:26130 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2405 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2316248 (2.2 MiB)  TX bytes:386534 (377.4 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:88:8C:E3  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:24505 errors:0 dropped:0 overruns:0 frame:0
          TX packets:289 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2175605 (2.0 MiB)  TX bytes:42289 (41.2 KiB)

eth2      Link encap:Ethernet  HWaddr 08:00:27:6F:EE:83  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:1980 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2032 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:124007 (121.1 KiB)  TX bytes:105295 (102.8 KiB)

eth3      Link encap:Ethernet  HWaddr 08:00:27:6F:EE:83  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:5795 (5.6 KiB)

[root@2hei.net ~]# mii-tool
eth0: no autonegotiation, 100baseTx-FD, link ok
eth1: no autonegotiation, 100baseTx-FD, link ok
eth2: no autonegotiation, 100baseTx-FD, link ok
eth3: no autonegotiation, 100baseTx-FD, link ok

[root@2hei.net ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 08:00:27:88:8c:e3

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 08:00:27:2d:3d:56

[root@2hei.net ~]# cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 500
ARP IP target/s (n.n.n.n form): 192.168.56.1

Slave Interface: eth2
MII Status: up
Link Failure Count: 0
Permanent HW addr: 08:00:27:6f:ee:83

Slave Interface: eth3
MII Status: down
Link Failure Count: 1
Permanent HW addr: 08:00:27:9c:5a:b8          

分类: linux 标签:

useful python modules zz

2011年2月12日 评论已被关闭

mark zz from http://bbs.chinaunix.net/viewthread.php?tid=1855562 :
Graphical interface wxPython http://wxpython.org   
Graphical interface pyGtk http://www.pygtk.org   
Graphical interface pyQT http://www.riverbankcomputing.co.uk/pyqt/   
Graphical interface Pmw http://pmw.sourceforge.net/   
Graphical interface Tkinter 3000 http://effbot.org/zone/wck.htm   
Graphical interface Tix http://tix.sourceforge.net/   
        
Database MySQLdb http://sourceforge.net/projects/mysql-python   
Database PyGreSQL http://www.pygresql.org/   
Database Gadfly http://gadfly.sourceforge.net/   
Database SQLAlchemy http://www.sqlalchemy.org/   
Database psycopg http://www.initd.org/pub/software/psycopg/   
Database kinterbasdb http://kinterbasdb.sourceforge.net/   
Database cx_Oracle http://www.cxtools.net/default.aspx?nav=downloads   
Database pySQLite http://initd.org/tracker/pysqlite   
        
MSN Messenger msnlib http://auriga.wearlab.de/~alb/msnlib/   
MSN Messenger pymsn http://telepathy.freedesktop.org/wiki/Pymsn   
MSN Messenger msnp http://msnp.sourceforge.net/   
Network Twisted http://twistedmatrix.com/   
Images PIL http://www.pythonware.com/products/pil/   
Images gdmodule http://newcenturycomputers.net/projects/gdmodule.html   
Images VideoCapture http://videocapture.sourceforge.net/   
        
Sciences and Maths scipy http://www.scipy.org/   
Sciences and Maths NumPy http://numpy.scipy.org//   
Sciences and Maths numarray http://www.stsci.edu/resources/software_hardware/numarray   
Sciences and Maths matplotlib http://matplotlib.sourceforge.net/   
        
Games Pygame http://www.pygame.org/news.html   
Games Pyglet http://www.pyglet.org/   
Games PySoy http://www.pysoy.org/   
Games pyOpenGL http://pyopengl.sourceforge.net/   
        
Jabber jabberpy http://jabberpy.sourceforge.net/   
        
Web scrape http://zesty.ca/python/scrape.html   
Web Beautiful Soup http://crummy.com/software/BeautifulSoup   
Web pythonweb http://www.pythonweb.org/   
Web mechanize http://wwwsearch.sourceforge.net/mechanize/   
        
Localisation geoname.py http://www.zindep.com/blog-zindep/Geoname-python/   
        
Serial port pySerial http://pyserial.sourceforge.net/   
Serial port USPP http://ibarona.googlepages.com/uspp   
        
Parallel Port pyParallel http://pyserial.sourceforge.net/pyparallel.html   
        
USB Port pyUSB http://bleyer.org/pyusb/   
        
Windows ctypes http://starship.python.net/crew/theller/ctypes/   
Windows pywin32 http://sourceforge.net/projects/pywin32/   
Windows pywinauto http://www.openqa.org/pywinauto/   
Windows pyrtf http://pyrtf.sourceforge.net/   
Windows wmi http://timgolden.me.uk/python/wmi.html   
        
PDA/GSM/Mobiles pymo http://www.awaretek.com/pymo.html   
PDA/GSM/Mobiles pyS60 http://sourceforge.net/projects/pys60   
        
Sound pySoundic http://pysonic.sourceforge.net/   
Sound pyMedia http://pymedia.org/   
Sound FMOD http://www.fmod.org/   
Sound pyMIDI http://www.cs.unc.edu/Research/assist/developer.shtml   
        
GMail libgmail http://libgmail.sourceforge.net/   
Google pyGoogle http://pygoogle.sourceforge.net/   
Expect pyExpect http://pexpect.sourceforge.net/   
WordNet pyWordNet http://osteele.com/projects/pywordnet/   
Command line cmd http://blog.doughellmann.com/2008/05/pymotw-cmd.html   
Compiler backend llvm-py http://mdevan.nfshost.com/llvm-py/   
3D VPython http://vpython.org

分类: python 标签: