易截截图软件、单文件、免安装、纯绿色、仅160KB

linux网桥设置MAC地址时的行为

brctl addbr br0
ifconfig br0
br0 MAC is 00:00:00:00:00:00
brctl addif br0 eth1  (eth1 is xx:xx:xx:xx:xx:33)
ifconfig br0
br0 MAC is xx:xx:xx:xx:xx:33  same as eth1, auto change
brctl addif br0 eth2  (eth2 is xx:xx:xx:xx:xx:30)
ifconfig br0
br0 MAC is xx:xx:xx:xx:xx:30  same as eth2, For eth2 less than eth1, auto change
ifconfig eth2 hw ether xx:xx:xx:xx:xx:50
ifconfig br0
br0 MAC is xx:xx:xx:xx:xx:33  same as eth1, auto change
ifconfig br0 hw ether xx:xx:xx:xx:xx:99
ifconfig br0
br0 MAC is xx:xx:xx:xx:xx:33  same as eth1, NOT change
ifconfig br0 hw ether xx:xx:xx:xx:xx:33  ;same as eth1
ifconfig eth2 hw ether xx:xx:xx:xx:xx:20  ;less than eth1
ifconfig br0
br0 MAC is xx:xx:xx:xx:xx:33  same as eth1, `ifconfig br0 hw` NOT effective
ifconfig eth1 hw ether xx:xx:xx:xx:xx:50  ;upper op,we set br0 = eth1's MAC,now we change eth1 MAC
ifconfig br0
br0 MAC is xx:xx:xx:xx:xx:20  same as eth2, auto change
结论:
  br0如果没有指定hw MAC, br0的MAC地址会根据bridge中port的变化,自动选择port中最小的一个MAC地址作为br0的MAC地址。
  br0只能指定port中有的interface的MAC作为br0的MAC地址。
 
源代码分析:
  source code dir is: linux-2.4.x/net/bridge
 
  - br_device.c
      br_dev_setup() 注册了一些函数,其中  dev->set_mac_address = br_set_mac_address;  //这个就是ifconfig br0 hw ether调用的函数了
     
      static int  br_set_mac_address(struct net_device *dev, void *addr)
          {
            struct net_bridge *br = dev->priv;
            struct sockaddr *sa = (struct sockaddr *) addr;
           
          。。。。


相关文档:

Linux 内核体系简介【转】

1.Linux 内核简介 现在让我们从一个比较高的高度来审视一下 GNU/Linux 操作系统的体系结构。您可以从两个层次上来考虑操作系统,如图 1 所示。 图 1. GNU/Linux 操作系统的基本体系结构 最上面是用户(或应用程序)空间。这是用户应用程序执行的地方。用户空间之下是内核空间,Linux 内核正是位于这里。 GNU C Lib ......

Linux游说者的光荣使命






<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
    我们说句大白话,所谓“游说者”(
lobbist

lobber
)就是古代的“說客”,只是人们平日不好意思这么说而已。当今,甘愿做一名
Linux
游说者是很光荣的事情。此话当真? ......

获取linux的文件系统相关信息的知识点


在 struct mntent 中的成员与 /etc/fstab 文件中的条目是直接对应的。它的内容如下:
struct mntent {
char *mnt_fsname; /* 挂载的文件系统的名字 */
char *mnt_dir; /* 挂载点 */
char *mnt_type; /* 文件系统类型:ufs、nfs 等 */
char *mnt_opts; /* 选项,以� ......

linux挂载优盘假死

        由于 fc3 内核默认 fat32 文件系统字符编码是 ascii,如果优盘的文件名包含中文,那么在转换时会出问题,应用程序就会失去响应。具体的表现有多种,比如桌面假死,关机时提示无法卸载分区等等
解决的办法是在挂载时,根据语言环境 locale 的值,使用挂载参数。如果是 UTF- ......

添加开机logo(amlogic open linux) 学习笔记

1、修改kernel配置(linux os)
在linux下,终端---进入编译目录,执行make k.menuconfig,
在弹出的配置窗口里选择Device Drivers-----Amlogic Devices Driver-----Amlogic Display Driver-----setup logo和logo on osd0
2、图片转换(windows os)
   a、打开BitmapDataGet.exe工具,选择32位。
b、选择加 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号