change local network

|**|

pc2 files

$ ssh -l mm 192.168.2.8
Password: 
$ su -
Password: 
# mount
/dev/hdb1 on / type ext3 (rw)
/dev/hda2 on /var/data type ext3 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbdevfs on /proc/bus/usb type usbdevfs (rw)

pc2 の 設定ファイルの 内容を 見て行きます これが 最終では有りませんが 参考に 表示 しておきます。まず /etc/hosts

# sed -e '/^#/d' /etc/hosts | sed -e 1d
127.0.0.1       localhost
192.168.2.8     nyanta.no-ip.info nyanta
192.168.0.5     lx.bcnet.ne.jp lx

つぎは /etc/hosts.allow

# sed -e '/^#/d' /etc/hosts.allow 
ALL : LOCAL
ipop3d : 192.168.2.0/255.255.255.0:allow
ipop3d : 192.168.0.0/255.255.255.0:allow

つぎは /etc/resolv.conf

# sed -e '/^#/d' /etc/resolv.conf
domain bcnet.ne.jp
nameserver 127.0.0.1
nameserver 192.168.0.1 
nameserver 192.168.2.8

次は sendmail 関連の access と local-host-names です。まず access

# cat /etc/mail/access
192.168.0 RELAY 
127.0.0.1 RELAY 
192.168.2 RELAY

次は /etc/mail/local-host-names

# cat /etc/mail/local-host-names 
nl.bcnet.ne.jp
lx.bcnet.ne.jp
mc.bcnet.ne.jp
wc.bcnet.ne.jp
nyanta.no-ip.info
192.168.0.8
192.168.2.8
192.168.0.5
192.168.0.6
192.168.0.7

bind (named) 関連 まず /var/data/jail/named/var/named/bcnet.hosts

# cat /var/data/jail/named/var/named/bcnet.hosts
$TTL 86400
@               IN      SOA     nl.bcnet.ne.jp. root.nl.bcnet.ne.jp. (
                20030121        ; Serial
                3600            ; Refresh
                900             ; Retry
                604800          ; Expire
                86400 )         ; Minimum TTL
;
                IN      NS      nl.bcnet.ne.jp.
                IN      MX  10  nl.bcnet.ne.jp.
nl              IN      A       192.168.2.8
;adsl           IN      A       192.168.0.1
;lx             IN      A       192.168.0.5
;ws             IN      A       192.168.0.6
;mc             IN      A       192.168.0.7
;www            IN      CNAME   lx
qqq             IN      CNAME   nl
;
;

/var/data/jail/named/var/named/bcnet.hosts.rev

# cat /var/data/jail/named/var/named/bcnet.hosts.rev 
$TTL 3D
@               IN      SOA     nl.bcnet.ne.jp. root.nl.bcnet.ne.jp. (
                20030121        ; Serial
                3600            ; Refresh      
                900             ; Retry        
                604800          ; Expire  
                3600)           ; Minimum TTL
        IN      NS      nl.bcnet.ne.jp.
;1      IN      PTR     adsl.bcnet.ne.jp.
;5      IN      PTR     lx.bcnet.ne.jp.
;6      IN      PTR     ws.bcnet.ne.jp.
;7      IN      PTR     mc.bcnet.ne.jp.
8       IN      PTR     nl.bcnet.ne.jp.

/etc/rc.d/rc.inet1 を 見て行きます

# sed -e '/^#/d' /etc/rc.d/rc.inet1

HOSTNAME=`cat /etc/HOSTNAME`

/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

if [ -f /var/run/inet1-scheme ] ; then
  INET1_SCHEME=`cat /var/run/inet1-scheme`
else
  INET1_SCHEME="fixed"
fi

if [ "$INET1_SCHEME" = "fixed" ] ; then

  # IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the 
  # eth0 interface. If you're only using loopback or SLIP, don't include the
  # rest of the lines in this file.

  # Edit for your setup.
  IPADDR="192.168.2.8"          # REPLACE with YOUR IP address!
  NETMASK="255.255.255.0"               # REPLACE with YOUR netmask!
  NETWORK="192.168.2.0"         # REPLACE with YOUR network address!
  BROADCAST="192.168.2.255"     # REPLACE with YOUR broadcast address, if you
                                # have one. If not, leave blank and edit below.
  GATEWAY="192.168.2.1"         # REPLACE with YOUR gateway address!

  # Uncomment the line below to configure your ethernet card.
  /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}

  # If the line above is uncommented, the code below can also be uncommented.
  # It sees if the ethernet was properly initialized, and gives the admin some
  # hints about what to do if it wasn't.
  if [ ! $? = 0 ]; then
    cat << END
Your ethernet card was not initialized properly.  Here are some reasons why this
may have happened, and the solutions:
1. Your kernel does not contain support for your card.  Including all the 
   network drivers in a Linux kernel can make it too large to even boot, and
   sometimes including extra drivers can cause system hangs.  To support your
   ethernet, either edit /etc/rc.d/rc.modules to load the support at boottime,
   or compile and install a kernel that contains support.
2. You don't have an ethernet card, in which case you should comment out this
   section of /etc/rc.d/rc.inet1.  (Unless you don't mind seeing this error...)
END
  fi

  # Uncomment these to set up your IP routing table.
  # /sbin/route add -net ${NETWORK} netmask ${NETMASK} eth0
  if [ ! "$GATEWAY" = "" ]; then
   /sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1
  fi
elif [ "$INET1_SCHEME" = "dhcp" -o "$INET1_SCHEME" = "DHCP" ] ; then
  if [ -x /sbin/dhclient ] ; then
    /sbin/dhclient eth0
  else
    cat << END
/sbin/dhclient was not found.
Please install ISC DHCP.
END
  fi
fi

次は 確認試験です。

にゃんたろう 拝!

2005年11月21日 (月) 23:53:49 JST 作成

|**|


change local network

Copyright © 2004.-2007. nyantarou All Rights Reserved.