How to calculate the correct subnet for an interface (文档 ID 1059759.1)
发表于:2025-01-24 作者:千家信息网编辑
千家信息网最后更新 2025年01月24日,APPLIES TO: Oracle Database - Enterprise Edition - Version 10.2.0.1 and later Information in this do
千家信息网最后更新 2025年01月24日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安全错误
数据库的锁怎样保障安全
上海俱好货软件开发合伙企业
石家庄职工网络安全宣传
上海管理软件开发公司
多账号登录外网服务器工具
我的时间服务器
c#判断数据库返回内容
数据库 复制表数据结构
php下载到服务器
高新区运营网络技术服务费
保障孩子的网络安全
小学生日记软件开发
海康摄像机数据库版本
打开网络安全模式
管理云服务器的软件有哪些
怎样做个小型人员数据库
ARCGIS下载软件开发
深圳市网络安全与信息化管理局
网络技术对教学
网络技术部工作交接表
涪陵区工商软件开发服务公司
软件开发合作框架协议模板
食品产业信息技术与网络技术
深圳售后服务软件开发
网络安全工程师证书有哪些
保障孩子的网络安全
数据库安全厂商
学校网络安全管理举措
lol服务器排行
数据库最新开发语言
网匠网络技术服务有限公司