hajichan.net technical version
トップページ >> サーバ管理(Solaris) >> ifconfigによるネットワーク設定

サーバ管理

ifconfigによるネットワーク設定

アドレスの確認

# ifconfig -a

インターフェースの有効/無効

# ifconfig hme0 up
# ifconfig hme0 down

インターフェースの作成/削除

# ifconfig hme0 plumb
# ifconfig hme0 unplumb

アドレスの変更

# ifconfig hme0 down
# ifconfig hme0 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
# ifconfig hme0 up

とか

# ifconfig hme0 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255

設定ファイルで変更する場合、/etc/hostsを編集しIPアドレスを変更します。実際は、/etc/hostname.hme0が直接関係しますが、/etc/hostsとホスト名で対応付けされているため、/etc/hostsの方を変更すればいいです。 設定ファイル変更後は、システムの再起動を忘れずに。

# cat /etc/hostname.hme0
---
host

# vi /etc/hosts
---
192.168.1.10     host    loghost

# /etc/telinit 6

1枚のインターフェースに複数のIPアドレスを割当てる

# ifconfig hme0:1 plumb
# ifconfig hme0:2 plumb
# ifconfig hme0:1 192.168.1.11 netmask 255.255.255.0 broadcast 192.168.1.255 up
# ifconfig hme0:2 192.168.1.12 netmask 255.255.255.0 broadcast 192.168.1.255 up

MTUの変更

# ifconfig hme0 mtu 1454
ページのトップへ戻る