Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ifconfig question

Status
Not open for further replies.

reason1000

IS-IT--Management
Feb 1, 2002
38
US
Hello,

I have a server on which I would like to change the subnet mask. The mask is currently 255.255.0.0 and I would like to change it to 255.255.255.0. If I run the ifconfig command to change the subnet mask, will any connections to the server be interrupted and/or lost? This is a file server and several users will be connected with open files, etc.

When I do run the ifconfig command to set the mask, do I need to specify the IP address in the command? The IP is staying the same.

Thanks!
 
> I have a server on which I would like to change the subnet mask. The mask is currently 255.255.0.0 and I would like to change it to 255.255.255.0. If I run the ifconfig command to change the subnet mask, will any connections to the server be interrupted and/or lost? This is a file server and several users will be connected with open files, etc.

> When I do run the ifconfig command to set the mask, do I need to specify the IP address in the command? The IP is staying the same.

> Thanks!

Apparently you know little about networking. What is your network range? Do you know? 255.255.0.0 is a /16 for 65534 hosts or 256 /24's. A 255.255.255.0 netmask (aka a /24) is only capable of having 254 machines. So if you have say 365 computers running in your network it won't suffice, you should use a netmask such as 255.255.254.0 which would give you 510 available IP addresses. However, depending on your network and how it's set up, if the machines are running DHCP a quick reboot or start menu/run/ipconfig /renew_all should do the trick. If the addresses were statically assigned you would have to renumber your network.

And yes, its best to run the full command...

ifconfig $INTERFACE -inet $IPADDRESS netmask $NETMASK up

Don't forget, your route will change too.

perl -e 'print $i=pack(c5,(40*2),sqrt(7600),(unpack(c,Q)-3+1+3+3-7),oct(104),10,oct(101));'
 
The 255.255.0.0 mask was setup that way by my predecessor. DHCP is assigning IP addresses and most workstations are now on a /24 mask. I was merely wondering if running ifconfig, reconfiguring the mask on the file server, would interrupt currently open connections.

Thanks for the flame.
 
Wasn't a flame sorry if you took it to be one.

perl -e 'print $i=pack(c5,(40*2),sqrt(7600),(unpack(c,Q)-3+1+3+3-7),oct(104),10,oct(101));'
 
AFAIK it should not interrupt any connections provided the new netmask would have allowed those connections in the first place.

You should get away with:

[tt]ifconfig ethX netmask 255.255.255.0[/tt]

Annihilannic.
 
You also will need to make the changes permanent by editing your nic script.

If you are using a RH based distro you will find all interfaces' files in the /etc/sysconfig/network-scripts directory.

Other (like debian) may be found simply in etc/sysconfig or /etc/sysconfig/network

QatQat

Life is what happens when you are making other plans.
 
Thanks guys. What I've ended up doing, temporarily, is add secondary IP addresses to the Interfaces of effected servers. The secondary IPs are setup with a 24 bit mask. So, now the interfaces are reachable from both clients with a 16 bit mask and those with a 24 bit mask. In DNS I added records pointing the FQDNs of the servers to the secondary IP addresses. This is all working right now. Come this weekend I'll remove the secondary IPs, set the proper net mask, and restart the servers. We have some other things to do that will require some downtime anyway.
 
Did you have under 254 hosts for the /24? Just curious... What I've done in the past is when I get to the 185 mark of 254 I up the netmask to allow room for growth. This way come next summer it doesn't bit you in the ... hynee

perl -e 'print $i=pack(c5,(40*2),sqrt(7600),(unpack(c,Q)-3+1+3+3-7),oct(104),10,oct(101));'
 
Yeah, I have well under 254 hosts. We are a small company. We probably have around 110 hosts total, which includes printers, switch management interfaces, etc. Every once in a while we might add a new computer or printer but there's not much growth. If we do get anywhere near 200 hosts I will definitely do as you said and up the mask to a /23.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top