How to calculate the correct subnet for an interface (文档 ID 1059759.1)
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,APPLIES TO: Oracle Database - Enterprise Edition - Version 10.2.0.1 and later Information in this do
千家信息网最后更新 2026年11月02日How to calculate the correct subnet for an interface (文档 ID 1059759.1)APPLIES TO: Oracle Database - Enterprise Edition - Version 10.2.0.1 and later Information in this document applies to any platform. GOAL How to calculate the correct subnet to use in oifcfg, etc. oifcfg requires you to enter the subnet used for public and cluster_interconnect networks. However, ifconfig usually shows the IP and the netmask, but not the subnet. This note will show how to determine the subnet to be used with oifcfg. More generally, it also applies to the general question of determining the subnet for a given interface, given the IP address and netmask. SOLUTION Suppose that the interface to be used for public network is e1000g0 with ip address 171.197.26.137 and netmask ffffffc0.
In ifconfig -a output we will see this:
e1000g0: flags=209040843 mtu 1500 index 2 inet 171.197.26.137 netmask ffffffc0 broadcast 171.197.26.191 groupname prod ether 0:14:4f:95:39:9a
Note that the netmask is displayed as ffffffc0 in hex. (In some platforms it is displayed in decimal rather than hex.) This netmask ffffffc0 = ff.ff.ff.c0 = 255.255.255.192 . In binary notation this is 11111111.11111111.11111111.11000000
Another common way you may see to represent the netmask is as a simple 2-digit number like "26", to get this number, simply add up the digits:
11111111.11111111.11111111.11000000 => (1+1+1+1+1+1+1+1) + (1+1+1+1+1+1+1+1) + (1+1+1+1+1+1+1+1) + (1+1+0+0+0+0+0+0) = 8+8+8+2 = 26
A fast way to find the subnet, given the network address (171.197.26.137) and the netmask (255.255.255.192), is to use an IP calculator. Free IP calculators are available online. In this example, I used the calculator at http://jodies.de/ipcalc. Many others are available.
Plugging the address (171.197.26.137) and the netmask (255.255.255.192) into the calculator at http://jodies.de/ipcalc gives this output:
Result: Address: 171.197. 26.137 10101011.11000101.00011010.10 001001 Netmask: 255.255.255.192 = 26 11111111.11111111.11111111.11 000000 Wildcard: 0. 0. 0. 63 00000000.00000000.00000000.00 111111 => Network: 171.197. 26.128/26 10101011.11000101.00011010.10 000000 (Class B) Broadcast:171.197. 26.191 10101011.11000101.00011010.10 111111 HostMin: 171.197. 26.129 10101011.11000101.00011010.10 000001 HostMax: 171.197. 26.190 10101011.11000101.00011010.10 111110 Hosts/Net: 62
=> note how that gives the network 171.197.26.128/26 Ignore the /26 in this output, the "subnet" needed for oifcfg is 171.197.26.128.
Another way to get this information is to do a bit-AND on each bit of the address and netmask:
171.197. 26.137 => 10101011.11000101.00011010.10 001001 255.255.255.192 => 11111111.11111111.11111111.11 000000 & ------------------------------------ 10101011.11000101.00011010.10 000000 => 171.197.26.128
Yet another way to get this information is from oifcfg itself. The command oifcfg iflist shows the interface name and subnet for each interface:
$ ./oifcfg iflist e1000g0 171.197.26.128 e1000g2 171.197.26.128 e1000g3 10.241.6.0
So now you see where that 128 is coming from in oifcfg iflist. For each interface, oifcfg iflist shows the subnet for that interface.
So to enter this into oifcfg as the public network, you would use this syntax:
oifcfg setif -global e1000g0/171.197.26.128:public
In ifconfig -a output we will see this:
e1000g0: flags=209040843 mtu 1500 index 2 inet 171.197.26.137 netmask ffffffc0 broadcast 171.197.26.191 groupname prod ether 0:14:4f:95:39:9a
Note that the netmask is displayed as ffffffc0 in hex. (In some platforms it is displayed in decimal rather than hex.) This netmask ffffffc0 = ff.ff.ff.c0 = 255.255.255.192 . In binary notation this is 11111111.11111111.11111111.11000000
Another common way you may see to represent the netmask is as a simple 2-digit number like "26", to get this number, simply add up the digits:
11111111.11111111.11111111.11000000 => (1+1+1+1+1+1+1+1) + (1+1+1+1+1+1+1+1) + (1+1+1+1+1+1+1+1) + (1+1+0+0+0+0+0+0) = 8+8+8+2 = 26
A fast way to find the subnet, given the network address (171.197.26.137) and the netmask (255.255.255.192), is to use an IP calculator. Free IP calculators are available online. In this example, I used the calculator at http://jodies.de/ipcalc. Many others are available.
Plugging the address (171.197.26.137) and the netmask (255.255.255.192) into the calculator at http://jodies.de/ipcalc gives this output:
Result: Address: 171.197. 26.137 10101011.11000101.00011010.10 001001 Netmask: 255.255.255.192 = 26 11111111.11111111.11111111.11 000000 Wildcard: 0. 0. 0. 63 00000000.00000000.00000000.00 111111 => Network: 171.197. 26.128/26 10101011.11000101.00011010.10 000000 (Class B) Broadcast:171.197. 26.191 10101011.11000101.00011010.10 111111 HostMin: 171.197. 26.129 10101011.11000101.00011010.10 000001 HostMax: 171.197. 26.190 10101011.11000101.00011010.10 111110 Hosts/Net: 62
=> note how that gives the network 171.197.26.128/26 Ignore the /26 in this output, the "subnet" needed for oifcfg is 171.197.26.128.
Another way to get this information is to do a bit-AND on each bit of the address and netmask:
171.197. 26.137 => 10101011.11000101.00011010.10 001001 255.255.255.192 => 11111111.11111111.11111111.11 000000 & ------------------------------------ 10101011.11000101.00011010.10 000000 => 171.197.26.128
Yet another way to get this information is from oifcfg itself. The command oifcfg iflist shows the interface name and subnet for each interface:
$ ./oifcfg iflist e1000g0 171.197.26.128 e1000g2 171.197.26.128 e1000g3 10.241.6.0
So now you see where that 128 is coming from in oifcfg iflist. For each interface, oifcfg iflist shows the subnet for that interface.
So to enter this into oifcfg as the public network, you would use this syntax:
oifcfg setif -global e1000g0/171.197.26.128:public
文档
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
国智互联网科技
互联网科技与金融科技
互联网公司 科技公司
万易互联网科技有限公司
齐家互联网科技
紫鲸互联网科技
壹账通互联网科技
海南购全球互联网科技
哈尔滨秒房互联网科技有限公司
成都玖崟互联网科技有限公司乐商圈怎么样
济南华为互联网科技产业总部基地
顶级互联网科技成果有哪些
互联网经济与金融科技
受益于互联网科技的高速发展
青海科技产业互联网发展
想开互联网科技公司怎么样
长沙互联网科技
南京一网一红互联网科技有限公司
陕西九四连强互联网科技有限公司
众联互联网络科技
互联网科技有限公司图片
易通互联网络科技有限公司
互联网科技logo设计
互联网金融科技委员会
常德市电业局互联网科技部
浙南科技城互联网大厦建设工程
珠海东科互联网科技有限公司
云南互联网科技学费
兰石爱特工业互联网科技分公司
数字互联网科技有限公司