wiki:TipAndDoc/network

Version 15 (modified by mitty, 14 years ago) (diff)

--

disable ipv6

  • 以下の一行を、modprobeの設定ファイルに追加
    install ipv6 /sbin/modprobe -n -i ipv6
    
    • Ubuntu -> /etc/modprobe.d/blacklist (/etc/modprobe.d/* のどれでも可)
    • RedHat -> /etc/modprobe.conf

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

/etc/ppp/ip-up.local

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

  • 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
      

Attachments (4)

Download all attachments as: .zip