Hi, on a linux machine, what command do I have to type to set up the netmask?
And apparently I've heard there is a route command that also has to be input which is something else I don't know about. Can anyone tell me the commands and why it is this route command is necessary

Edited by pyTony: Keep it organized! Moved to Linux forum

6 Years
Discussion Span
Last Post by CimmerianX

ifconfig eth0 x.x.x.x(ipaddress) netmask x.x.x.x(subnet mask)
You don't need to "route" anything...


You can assign the IP, subnet mask, broadcast address seperately or together with one command:

ifconfig eth0
ifconfig eth0 netmask
ifconfig eth0 roadcast

ifconfig eth0 netmask broadcast


Thanks all for the help.

I was told by a very entrusted source that a route command is necessary... confused :/


You wouldn't need to use the route command on a host unless there is more than 1 gateway on the subnet and the host must determine what gateway to use for what destination subnet.

Usually, all traffic for hosts that are not on your same subnet would be sent to the 'default gateway' which then sends along its way.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.