Thinking Out Loud

January 6, 2013

IP Address using PREFIX versus NETMASK

Filed under: linux — mdinh @ 11:46 pm

I have not been on a Linux server in ages. Recently, I noticed the use of PREFIX versus NETMASK for IP configuration.

Basically PREFIX=16 is the same as NETMASK 255.255.0.0 and PREFIX=24 is the same as NETMASK 255.255.255.0

Which one is your server using?

[oracle@rac02 ~]$ uname -an
Linux rac02.localdomain 2.6.39-200.24.1.el6uek.x86_64 #1 SMP Sat Jun 23 02:39:07 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
[oracle@rac02 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
 NAME="System eth0"
 DEVICE="eth0"
 TYPE="Ethernet"
 BOOTPROTO=none
 ONBOOT=yes
 NM_CONTROLLED="yes"
 IPV4_FAILURE_FATAL=yes
 IPV6INIT=no
 GATEWAY=172.16.0.1
 DNS1=172.16.0.1
 DEFROUTE=yes
 PREFIX=16
 #rac01
 #IPADDR=172.16.1.51
 #HWADDR=08:00:27:D4:1A:98
 #rac02
 HWADDR=08:00:27:35:2D:54
 IPADDR=172.16.1.52
[oracle@rac02 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth1
 NAME="System eth1"
 DEVICE="eth1"
 TYPE="Ethernet"
 BOOTPROTO=none
 ONBOOT=yes
 NM_CONTROLLED="yes"
 IPV4_FAILURE_FATAL=yes
 IPV6INIT=no
 DEFROUTE=yes
 GATEWAY=172.16.0.1
 PREFIX=24
 #rac01
 #HWADDR=08:00:27:33:4C:DF
 #IPADDR=10.10.10.71
 #rac02
 HWADDR=08:00:27:BD:53:A7
 IPADDR=10.10.10.72

Reference:

http://www.netfilter.org/documentation/HOWTO/networking-concepts-HOWTO-4.html

About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 294 other followers

%d bloggers like this: