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

Recommended Answers

All 4 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.