In AIX, how can I use relevance to get netmask addess

(imported topic written by SystemAdmin)

I need to create a fixlet to change netmask from 255.255.255.0 to 255.255.254.0 on a select group of hosts that are on a specific network and are not 255.255.254.0 But I don’t know what inspector for AIX that would give me this info.

But in addition, I need to find the interface names and if boded exists or

Q: names of ip interfaces of network

A: lo

A: bond0

A: bond0:1

Q: names of ip interfaces of network

A: lo

A: eth1

Q: exists names of ip interfaces of network whose ( it = "bond0)

E: A string constant had no ending quotation mark.

Or maybe a better way is to determine if there are any files in folder “/etc/sysconfig/network-scripts” containing 255.255.255.0. Then in action script I would just edit them all to 255.255.254.0

Q: lines of files of folder “/etc/sysconfig/network-scripts” contains “255.255.255.0”

E: A singular expression is required

Here I get the value, but don’t know the file names?

Q: lines whose ( it contains “255.255.255.0” ) of files of folder “/etc/sysconfig/network-scripts”

A: NETMASK=255.255.255.0

A: NETMASK=255.255.255.0

Like this grep command output?

uxprd110:/etc/sysconfig/network-scripts

root # grep 255.255.255.0 *

ifcfg-bond0:NETMASK=255.255.255.0

ifcfg-bond0:1:NETMASK=255.255.255.0

1 Like

(imported comment written by SystemAdmin)

After review here are the requirements

In the /etc/sysconfig/network-scripts directory, determine filenames containing 161.222.58 and 255.255.255.0

lines whose ( it contains “161.222.58”) of files of folder “/etc/sysconfig/network-scripts”

A: IPADDR=161.222.58.65

A: GATEWAY=161.222.58.1

A: IPADDR=161.222.58.225

lines whose ( it contains “255.255.255.0” )of files of folder “/etc/sysconfig/network-scripts”

A: NETMASK=255.255.255.0

A: NETMASK=255.255.255.0

T: 16235

Q: exists lines whose ( it contains “255.255.255.0” )of files of folder “/etc/sysconfig/network-scripts” and exists lines whose ( it contains “161.222.58”) of files of folder “/etc/sysconfig/network-scripts”

A: True

T: 408

BUT, I need to know if both conditions exist in a single file, not any file in the “/etc/sysconfig/network-scripts” directory.

If that cn be accomplished, then In the action script, I will need to do the same so I can determine the filenames of the files that I need to change the mask from 255.255.255.0 to 255.255.254.0

(imported comment written by SystemAdmin)

Another Idea…

Is there a way to combine the fol1owing into a single command to determine if a single interface has an address containg 161.222.58 and a broadcast of 161.222.58.255. Because once the netmask is changed from 255.255.255.0 to 255.255.254.0, the new broadcast address will become 161.222.59.255

Q: broadcast addresses of ip interfaces of network

A: 161.222.58.255

A: 161.222.58.255

T: 296

Q: addresses of ip interfaces of network

A: 127.0.0.1

A: 161.222.58.65

A: 161.222.58.225

T: 255