[[PageOutline]] [[TitleIndex(TipAndDoc/network,format=group)]] * [http://linux-ip.net/ Guide to IP Layer Network Administration with Linux (http://linux-ip.net/)] * [http://www.linux.or.jp/JF/JFdocs/Adv-Routing-HOWTO/lartc.kernel.obscure.html Linux Advanced Routing & Traffic Control HOWTO - あまり知られていない設定] = misc = * [http://muumoo.jp/news/2008/08/16/0proxifier.html NetShareの件はProxifier使ったら一発だった - むぅもぉ.jp] > このツールは、どうやら通信してるアプリを勝手に見つけて、その通信を奪って、指定したSocksプロキシを通してくれるらしい。なので、ブラウザ側の設定は何も変えなくていいし、そもそもブラウザがSocks5に対応してなくてもOKだし、ブラウザに限らずなんのソフトにでも使えるし、Proxifierを起動するかしないかだけなので、環境の切り替えも簡単。もちろんDNSとかも問題なくいける。WindowsもMacも使える。 = 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 }}} = open relay test = * telnet localhost 25 「以外」のIPで繋いで、以下のような例でメール送信できたらOpen relayになっているので注意 {{{ HELO mitty.jp MAIL FROM: hoge@mitty.jp RCPT TO: fuga@example.org DATA From: hoge@mitty.jp Subject: test relay testmail . QUIT }}} = warning with dhcp3 = * [https://bugs.launchpad.net/ubuntu/+source/dhcp3/+bug/39249 Bug #39249 in dhcp3 (Ubuntu): “(Dapper, Hardy) can't create /var/lib/dhcp3/dhclient.eth0.leases: Permission denied”] * ◦sudo chown dhcp:dhcp /var/lib/dhcp3/ = /etc/ppp/ip-up.local = * Ubuntu(Debian)の、/etc/network/interfacesにおけるpost-up command(のPPP版)にあたるもの * [http://tsutomu.lasttom.jp/item/30 らpapa's Web Site - CentOSでソースポリシールーティング] * [http://www.org3.net/tech_notes/flets-square.html フレッツ・スクウェア - マルチセッション] = SYN Cookies = * [http://ja.wikipedia.org/wiki/SYN_cookies SYN cookies - Wikipedia] * [http://lkml.org/lkml/2008/2/5/167 LKML: Andi Kleen: Re: [PATCH] Add IPv6 support to TCP SYN cookies] * [http://www.soi.wide.ad.jp/class/20060020/slides/11/26.html 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 ] address -r: Print Reverse Ranges -d : 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 [http://linux.mini13i.gotdns.org/?tool%2Fnetmask%B7%D7%BB%BB tool/netmask計算 - Linux Tips] = NICが活性化される順序 = #NIClinkOrder * 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 = * [http://ubuntuforums.org/showthread.php?t=491711 /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 }}} = Cluster SSH = * [http://blog.livedoor.jp/hakin/archives/51564707.html しげふみメモ : Cluster SSHで複数ホストでコマンド同時実行] = tftp = * [[Image(tftp-win7.png, 33%)]]