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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change subnet mask

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Hello,
I want to change the subnet mask of my box, how do I do.
Thanks
 
Try editting file /etc/netmasks. There should be an entry for your subnet.
 
Look at the file [tt]/etc/netmasks[/tt]. It should contain something like...

Code:
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
# 
#       network-number  netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.  Currently this number is restricted to being a class
# A, B, or C network number.  In the future we should be able to support
# arbitrary network numbers per the Classless Internet Domain Routing
# guidelines.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
#               128.32.0.0 255.255.255.0
#
10.12.10.0       255.255.255.0

The last line in this example is assigning the netmask [tt]255.255.255.0[/tt] to the [tt]10.12.10.0[/tt] network.

Hope this helps!
 
thanks all,
Actually, this is what I have done, but I am not sure I do it right because I get error:
- I change the netmask IP in the /etc/netmask file
- Next, I run command, eg (of IP):
# ifconfig hme0 128.32.0.0 [red]netmask 255.255.255.0[/red] broadcast 192.25.255.255 up

I get the error below:
ifconfig: SIOCSLIFBRDADDR: hme0: Invalid argument

Does this mean I have to plump the hme0 first?
Thanks
 
yes
1) plumb
2) up

in your example
ifconfig hme0 plumb
ifconfig hme0 128.32.0.0 netmask 255.255.255.0 broadcast 192.25.255.255 up

you can do both in one line
ifconfig hme0 128.32.0.0 netmask 255.255.255.0 broadcast 192.25.255.255 plumb up

-> man ifconfig (scroll down till EXAMPLES)

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Thanks Franz.
I correct according to your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top