/usr/sbin/ifconfig
rootユーザでのみ実行可能です
ifconfig インターフェース名 パラメータ | ネットワーク環境の状態を設定します。 |
---|
plumb | 物理インタフェース名に関連付けられたデバイスを使用可能にします。 |
---|---|
unplumb | 物理インタフェース名に関連付けられたデバイスを削除します。 |
up | インターフェースを活性化します。 |
down | インターフェースを非活性化します。 |
netmask | 物理インターフェースに関連付けられたデバイスのネットマスク値を設定します。 |
ifconfig hme0:1 plumb
ifconfig hme0:1 192.168.128.111 netmask 255.255.255.0
ifconfig hme0:1 up
ifconfig hme0:1 down
ifconfig hme0:1 unplumb
インターフェース名hme0:1に関連付けられたデバイスを使用可能にします。
ifconfig hme0:1 plumb ifconfig hme0:1 192.168.128.111 netmask 255.255.255.0 ifconfig hme0:1 up
再起動時に本設定は消えてしまうので、/etc/hostname.[インターフェース], /etc/hosts, /etc/netmasks のネットワーク設定が必要です。
インターフェースhme0:1にIPアドレスとして192.168.128.111を、netmaskとして255.255.255.0を設定します。
# ifconfig hme0:1 192.168.128.111 netmask 255.255.255.0
インターフェースhme0:1を活性化します。
# ifconfig hme0:1 up
インターフェースhme0:1を非活性化します。
# ifconfig hme0:1 down
インターフェースhme0:1に関連付けられたデバイスを削除します。
# ifconfig hme0:1 unplumb