- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- how to change subnet mask
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 08:54 PM
04-01-2004 08:54 PM
I use the following command to check my linux server. When the destination is default (0.0.0.0), I want to change the Genmask to be 255.255.224.0 instead of 0.0.0.0.
Can you advice me which file I should change? And I was confused that it seems the following three line is configured in different files.
#netstat -rn
Kernel IP routing table
Destination Gateway Genmask Iface
15.104.96.0 0.0.0.0 255.255.224.0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 lo
0.0.0.0 15.104.96.1 0.0.0.0 eth1
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 09:49 PM
04-01-2004 09:49 PM
Re: how to change subnet mask
To change your subnet mask edit the file
/etc/sysconfig-network-scripts/ifcfg-eth?
where ? can be 0,1 etc
to define permanent route edit the file (it doesn't exist by default
/etc/sysconfig/static-routes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 09:54 PM
04-01-2004 09:54 PM
Re: how to change subnet mask
The default route is where the packet goes if it doesn't know where else to go.
It's the last-resort route.
In order for this to work, it can't be a match for *anything*, thus why it's a 0 bit subnet mask.
If you have a subnet you want to route, that isn't on the local net (15.104.96.0/255.255.224.0), then you need t add a static route (as Alexander has pointed out).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 09:56 PM
04-01-2004 09:56 PM
Re: how to change subnet mask
But my routing table has two lines for eth1, does that mean I need to add both of them to the same file /etc/sysconf/network-scrips/eth1?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 09:58 PM
04-01-2004 09:58 PM
Re: how to change subnet mask
The 0.0.0.0 route may be configured from GATEWAY=x.x.x.x
in
/etc/sysconfig/network
or
/etc/sysconfig/network-scripts/ifcfg-eth1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 10:08 PM
04-01-2004 10:08 PM
Re: how to change subnet mask
I am trying to add the subnet mask to /etc/sysconfig/network and restarting and waiting for the result.
I would like to know what's the difference between the following directory files:
/etc/sysconfig/network
/etc/sysconfig/networking/
/etc/sysconfig/network-scripts/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 10:14 PM
04-01-2004 10:14 PM
Re: how to change subnet mask
right now my /etc/sysconfig/network looks like this:
NETWORKING=yes
HOSTNAME=ssrvr260
GATEWAY=15.104.96.1
NETMASK=255.255.224.0
GATEWAYDEV=eth1
But the subnet mask is still 0.0.0.0 for Gateway 15.104.96.1? why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 10:15 PM
04-01-2004 10:15 PM
Solutionit's enough to restart the network service:
service network restart
/etc/sysconfig/network
is the file with system wide definitions:
like the hostname of the station, the default gateway.
/etc/sysconfig/network-scripts
directory holds the definitions for each network adapter and whatever is assigned with it.
Ip address,type, permission to disable etc
P.S.Please assign points if useful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 10:18 PM
04-01-2004 10:18 PM
Re: how to change subnet mask
It makes the address 15.104.96.1 as default gateway for 0.0.0.0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 10:27 PM
04-01-2004 10:27 PM
Re: how to change subnet mask
i will assign the rest of the answers finally.
Do you mean that if I use the default gateway the subnetmask must be 0.0.0.0 and can not be changed?
Does the netmask has any problem for this system? since I am trying to use "spdash" comunicate with another server existing in the same subnet, but it failed. while I could ping this server. Don't know why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 10:38 PM
04-01-2004 10:38 PM
Re: how to change subnet mask
to add route to a certain network try this command:
route add -net 10.10.0.0 netmask 255.255.0.0 gw 192.168.0.1
The addresses here are just examples of course.This means to add a route to a subnet 10.10.0.0 with subnet mask 255.255.0.0 via gateway 192.168.0.1
If you can ping some server -that means that you already can communicate with it.
So maybe you trying to access some service on that server that's blocked or unavailable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 10:48 PM
04-01-2004 10:48 PM
Re: how to change subnet mask
Please advice why the outside communication still need the lo setting?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 11:20 PM
04-01-2004 11:20 PM
Re: how to change subnet mask
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2004 12:30 AM
04-02-2004 12:30 AM
Re: how to change subnet mask
ifcfg-lo has:
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
You host file should have (if its the default) the following lines:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
So, in having a problem with the loopback configuration you would have seen problems with some network services.
Col.