LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 02-10-2011, 12:38 PM   #1
baltazar3
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Rep: Reputation: 0
Ifconfig and network masks


I have been reading up on networking basics, and I have have one question which I couldnt find the answer to although I googled quite a bit.

What is the network mask for a interface actually used for. Here I mean the network mask that is set when you configure the interface with ifconfig. I know that it separates the network address from the host address, and I understand how network masks are used in the routing table. What I dont understand is why every interface needs its own netmask. Wont packages get routed correctly regardless of this value as long as the routing table is configured properly?

I did a little bit of testing and didnt notice any difference (just tested pinging) when setting this parameter to strange values.
 
Old 02-10-2011, 01:15 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Google for "TCP/IP subnet mask".

Essentially, every 32-bit IP address consists of two parts: the "network" a host resides in, and the "host#" within that network. The "subnet mask" basically determines which bits are part of the subnet address, and which bits part of the host address. Among other benefits, this allows more granular administrative control.
 
Old 02-10-2011, 03:00 PM   #3
wpeckham
Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix
Posts: 832

Rep: Reputation: 181Reputation: 181
More about sibnet mask

It also defines the subnet, or range of addresses, for which a direct network should exist. For that subnet routing should not be needed, all other traffic goes through the default route unless there is a specific routing that overrides.
 
Old 02-10-2011, 07:06 PM   #4
baltazar3
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wpeckham View Post
It also defines the subnet, or range of addresses, for which a direct network should exist. For that subnet routing should not be needed, all other traffic goes through the default route unless there is a specific routing that overrides.
If routing is not needed on that subnet, then it should be possible to send and receive packets on the subnet with an empty routing table. But this dosent work for me.
 
  


Reply

Tags
ifconfig, ip, netmask, network


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between Network Connection configuration and ifconfig aarav2306 Linux - Newbie 1 07-07-2009 03:54 PM
Static IP works from ifconfig but not /etc/network/interfaces neilneil2000 Linux - Networking 4 06-03-2008 03:44 PM
Getting IP address for a network interface through the filesystem, not ifconfig nachosmith Linux - Networking 2 02-26-2007 03:55 AM
ifconfig on Network start/restart chris1303 Linux - Networking 7 02-04-2005 04:21 AM
IFCONFIG and other network commands :( blyzard Linux - Newbie 19 07-30-2003 02:09 PM


All times are GMT -5. The time now is 03:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration