wiki:TipAndDoc/network

misc

  • NetShareの件はProxifier使ったら一発だった - むぅもぉ.jp

    このツールは、どうやら通信してるアプリを勝手に見つけて、その通信を奪って、指定したSocksプロキシを通してくれるらしい。なので、ブラウザ側の設定は何も変えなくていいし、そもそもブラウザがSocks5に対応してなくてもOKだし、ブラウザに限らずなんのソフトにでも使えるし、Proxifierを起動するかしないかだけなので、環境の切り替えも簡単。もちろんDNSとかも問題なくいける。WindowsもMacも使える。

  • http://info.iet.unipi.it/~luigi/dummynet/

    dummynet is a tool originally designed for testing networking protocols, and since then used for a variety of applications including bandwidth management. It simulates/enforces queue and bandwidth limitations, delays, packet losses, and multipath effects. It also implements a variant of Weighted Fair Queueing called WF2Q+. It can be used on user's workstations, or on machines acting as routers or bridges.

  • Linuxにおけるnetwork device nameの最大長は15文字
    • netdevice(7) - Linux manual page

      char ifr_name[IFNAMSIZ]; /* Interface name */

    • /usr/include/net/if.h
      /* Length of interface name.  */
      #define IF_NAMESIZE 16
      
      # define IFNAMSIZ   IF_NAMESIZE
      
    • /usr/include/linux/if.h
      #define IFNAMSIZ    16
      
    • 16文字以上の名前をつけようとしても短縮される模様
      • $ sudo brctl addbr 15abcdefghijklm
      • $ sudo brctl addbr 16abcdefghijklmn
      • $ ifconfig -a | grep HW
        15abcdefghijklm Link encap:Ethernet  HWaddr 36:2a:a6:20:08:66
        16abcdefghijklm Link encap:Ethernet  HWaddr ba:92:3e:48:24:23
        

CIFS vs NFS

  • 結論: Linux<=>Linux間のファイル共有はNFSが良い
  • 速度はNFSの方が高速
    • dd if=10MB.cifs of=/mnt/temp/10MB.cifs
      10485760 bytes (10 MB) copied, 28.8593 s, 363 kB/s
      
    • dd if=10MB.nfs of=/mnt/dropbox/10MB.nfs
      10485760 bytes (10 MB) copied, 12.9951 s, 807 kB/s
      
  • ファイルのパーミッション等
    • cifs => umaskの影響を受ける
      • デフォルトでは「-rwxr--r--」になる
    • nfs => 基本的にコピー元のまま
  • ファイル名の大文字小文字の区別
    • cifs => 区別しない(元々別だったファイルが一つに上書きされてしまう)
    • nfs => 区別する
  • 認証
    • cifs => 容易
    • nfs => ホスト(IP)ベースの認証は楽。ユーザ名ベースの認証は不明(出来ない?)

get information

  • NICの羅列
    ip link | grep "^[1-9]" | cut -d : -f 2 | cut -d ' ' -f 2 | grep "^eth"
    
  • IPの取得
    ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
    
    ip addr | grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1 | grep -v 127.0.0.1
    

SYN Cookies

  • to enable
    • sysctl -w net.ipv4.tcp_syncookies=1
    • /etc/sysctl.conf > net.ipv4.tcp_syncookies=1

calculate netmask

  • ipcount <= perlのNet::IPモジュールに含まれる
    • aptitude install libnet-ip-perl
      • /usr/share/doc/libnet-ip-perl/examples/ipcount
        Usage:
                ipcount [-r] [-d <prefix>] address
        
                -r: Print Reverse Ranges
                -d <prefix>: Cut down the original prefix in several prefixes
        
        The address range can be one of:
        
        ipcount IP + size
        ipcount IP1 - IP2
        ipcount IP/len
        
  • via tool/netmask計算 - Linux Tips

NICが活性化される順序

  • CentOS
    • ifcfg? の数字が若い順に固定?(任意の順序に変更できるか不明)
  • Ubuntu
    • interfacesに記載された順の模様

wakeonlan

  • sudo aptitude install -R wakeonlan
  • デフォルトルートとは違うNICから送出したい場合
    • wakeonlan -i 192.168.100.255 00:1D:60:XX:YY:ZZ
      Sending magic packet to 192.168.100.255:9 with 00:1D:60:XX:YY:ZZ
      
    • tcpdump -np port 9 -i eth0
      11:30:32.420790 IP 192.168.100.254.34625 > 192.168.100.255.9: UDP, length 102
      

fix DNS server on DHCP network

  • /etc/resolv.conf file troubles - Ubuntu Forums
  • DHCP配下のネットワークで、DNSを固定する
    • デフォルトではIP割り当て時に/etc/resolve.confが自動で書き換わってしまう
  • man dhclient.conf
    OPTION MODIFIERS
           The supersede statement
    
            supersede [ option declaration ] ;
    
           If for some option the client should always use a locally-configured value or values rather than whatever is supplied by the  server,  these  values  can  be
           defined in the supersede statement.
    
  • /etc/dhcp3/dhclient.conf
    supersede domain-name-servers 127.0.0.1;
    
    • => /etc/resolv.conf
      nameserver 127.0.0.1
      

tftp

  • tftp client on Windows 7

Slepnir2

ping

Pukiwiki

locale

  • see also locale.alias - kubota の日記

    Linux システムにおいて、locale.alias というファイルは、GNU libc にも含まれるし、X Window System にも含まれる。これらのファイルには、ASCII ではない文字が含まれている。fran0xe7ais と bokm0xe5l のふたつだ。

Remote Desktop Protocol

Traffic Control on Linux

Open vSwitch

Last modified 6 years ago Last modified on Mar 16, 2018 12:30:49 PM

Attachments (4)

Download all attachments as: .zip