Solarisの基本的なネットマスク

Solarisの基本的なネットマスク

Solarisローカルゾーンのデフォルトのネットマスクは何ですか?

空のファイルがありますが、/etc/netmasks実行するとifconfigネットマスクがffffff00

[username@servername]# /usr/sbin/ifconfig -a
lo0:10: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ifname5:3: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 7
        inet 10.56.20.179 netmask ffffff00 broadcast 10.56.20.255

netmasksファイルが空の場合、再起動時にサブネットマスクをどのように設定しますか?これは大域ゾーンのエントリに基づいていますか?

ifconfig同様に(??)コマンドを使用してインターフェイスのアドレスを設定し、ネットマスクがコマンドに明示的に設定されていない場合、デフォルトのサブネットマスクはどこに設定されますか?

言う再起動またはフェイルオーバー時の動作を予測するために、静的構成ファイルに対して非大域ゾーンの構成済みサブネットマスクを確認したいと思います。この情報を含むファイルは何ですか?

schllyが述べたように、私が提示した例は10.xxxネットワークの一般的な設定ではないかもしれませんが、(私より経験豊富な)誰かが意図的に設定を構成しているようです。 10.xxx ネットワーク設定チェックリスト。グローバルエリア。

ベストアンサー1

地域と Solaris のバージョンによっては、ネットワークを異なる方法で指定する必要があります。共有ネットワークインターフェイスを使用すると、ゾーンオペレーティングシステムがグローバルゾーンと共有されるため、ネットワーク構成について知る必要はありません。したがって、実際にはネットワークは大域ゾーンで定義され、zonecfg構成でIPを指定するだけです。

単独IP(Solaris 11で利用可能)を使用している場合は、別々のIPスタックがあるため、各ゾーン内でIPを手動で構成する必要があります。

schilyは、ネットマスクが指定されていない場合はデフォルト値からインポートされるとよく​​言及しました。見たらここ以下を見つけることができます:

ネットマスクマスク

For IPv4 only. Specify how much of the address to reserve for subdividing networks into subnetworks. The mask includes the network part of the local address and the subnet part, which is taken from the host field of the address. The mask contains 1's for the bit positions in the 32-bit address which are to be used for the network and subnet parts, and 0's for the host part. The mask should contain at least the standard network portion, and the subnet field should be contiguous with the network portion. The mask can be specified in one of four ways:

    with a single hexadecimal number with a leading 0x,

    with a dot-notation address,

    with a “+” (plus sign) address, or

    with a pseudo host name/pseudo network name found in the network database networks(4).

If a “+” (plus sign) is given for the netmask value, the mask is looked up in the netmasks(4) database. This lookup finds the longest matching netmask in the database by starting with the interface's IPv4 address as the key and iteratively masking off more and more low order bits of the address. This iterative lookup ensures that the netmasks(4) database can be used to specify the netmasks when variable length subnetmasks are used within a network number.

If a pseudo host name/pseudo network name is supplied as the netmask value, netmask data may be located in the hosts or networks database. Names are looked up by first using gethostbyname(3NSL). If not found there, the names are looked up in getnetbyname(3SOCKET). These interfaces may in turn use nsswitch.conf(4) to determine what data store(s) to use to fetch the actual value.

For both inet and inet6, the same information conveyed by mask can be specified as a prefix_length attached to the address parameter.

また、ゾーン構成で共有アドレスを使用し、zonecfg で認識されない IP を構成している場合は、次のメッセージが表示されます。

zone 'zone-shared-ip': warning: net0: no matching subnet found in netmasks(4): 10.0.2.150; using default of 255.0.0.0

おすすめ記事