ラベル Unix/Linux の投稿を表示しています。 すべての投稿を表示
ラベル Unix/Linux の投稿を表示しています。 すべての投稿を表示

6/23/2011

DebianでmultiNIC設定

Debian6.0でmultiNICの設定が分からなくてはまってしまったので忘れないうちにメモ。
Redhatと比べるとstatic-routeの記載がめんどい。
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 10.1.1.10
        netmask 255.255.192.0
        network 10.1.0.0
        broadcast 10.1.1.255
        #gateway 10.1.0.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 10.1.1.8 10.1.1.9
        post-up route add -net 10.5.0.0 netmask 255.255.0.0 gw 10.1.0.1
        post-up route add -net 10.6.0.0 netmask 255.255.0.0 gw 10.1.0.1
        pre-down route del -net 10.5.0.0 netmask 255.255.0.0 gw 10.1.0.1
        pre-down route del -net 10.6.0.0 netmask 255.255.0.0 gw 10.1.0.1


allow-hotplug eth1
iface eth1 inet static
        address 10.2.1.10
        netmask 255.255.192.0
        network 10.2.0.0
        broadcast 10.2.1.255
        gateway 10.2.0.1
        dns-nameservers 10.2.1.8 10.2.1.9
        post-up route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.2.0.1
        pre-down route del -net 0.0.0.0 netmask 0.0.0.0 gw 10.2.0.1

6/14/2011

teratermマクロを使って操作ログの自動取得

こんな感じでマクロを作成
username = 'user'
hostname = '192.168.1.1'
HostID   = 'Server001'
gettime timestr "%Y%m%d-%H%M%S"
getenv 'USERNAME' opeuser

logname = 'C:\log\'
strconcat logname HostID
strconcat logname '_'
strconcat logname timestr
strconcat logname '_'
strconcat logname opeuser
strconcat logname '.log'
logopen logname 0 0 1 0 1

msg = 'Enter '
strconcat msg username
strconcat msg ' user Password'
passwordbox msg 'password'

msg = hostname
strconcat msg ':22 /ssh /auth=password /user='
strconcat msg username
strconcat msg ' /passwd='
strconcat msg inputstr

connect msg
sendln ''

C:\logに"hostname_YYYYMMDD-HHMMSS_ログインユーザ名.log"形式で勝手に作成。
あと、teraterm-menuを併用すれば1クリック、パスワード入力で接続できるようになる。

タイムスタンプが付加できれば、より良いんだけどうまい方法が見つからず・・・