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 192.168.1.1
ifconfig eth0 netmask 255.255.255.0
ifconfig eth0 roadcast 192.168.1.255

ifconfig eth0 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255

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, networking, learning, and sharing knowledge.