FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 11-23-2007, 03:18 PM
"Rafael Barrera Oro"
 
Default static IP, gateway and netmask setting

thanks very much! ill give it a try

2007/11/23, Alberto Avi <alberto.avi@gmail.com>:
> i have to admit i totally guessed the
> 10.0.0.255 value

Hi Rafael,

ipcalc is you friend !

alberto@nabas ~ $ ipcalc 10.0.0.1/255.255.255.0


Address:** 10.0.0.1************ 00001010.00000000.00000000. 00000001
Netmask:** 255.255.255.0 = 24** 11111111.11111111.11111111. 00000000

Wildcard:**0.0.0.255************00000000.00000000. 00000000. 11111111
=>
Network:** 10.0.0.0/24**********00001010.00000000.00000000. 00000000
HostMin:**
10.0.0.1************ 00001010.00000000.00000000. 00000001
HostMax:** 10.0.0.254********** 00001010.00000000.00000000. 11111110
Broadcast:
10.0.0.255********** 00001010.00000000.00000000. 11111111
Hosts/Net: 254****************** Class A, Private Internet
--
gentoo-user@gentoo.org mailing list
 
Old 11-23-2007, 10:55 PM
 
Default static IP, gateway and netmask setting

"Rafael Barrera Oro" <borafael@gmail.com> writes:

> i have to admit i totally guessed the 10.0.0.255 value
>
> should this work?
> are all the values listed here correct and/or necessary?

You won't need to stipulate brdcast address in my own experience.
I'm not sure you even need to list the netmask but I always do.
I've never listed broadcast address and have'nt had any problems.

--
gentoo-user@gentoo.org mailing list
 
Old 11-26-2007, 05:10 PM
Dan Farrell
 
Default static IP, gateway and netmask setting

On Fri, 23 Nov 2007 17:55:39 -0600
reader@newsguy.com wrote:

> You won't need to stipulate brdcast address in my own experience.
> I'm not sure you even need to list the netmask but I always do.
> I've never listed broadcast address and have'nt had any problems.

you don't have to list the broadcast or netmask, if they can be guessed
from context. In the case of using a 192.168.x/24 network they can
generally both be guessed properly, because that's a Class C private
address .

However, in the case of 10.0.0/24, this may not be true. that is
defined as class A private address space, and the networking utilities
would probably assume it was 10.0.0/8, a netmask of 255.0.0.0 and a
broadcast of 10.255.255.255. That is what ifconfig does at least:

pascal ~ # ifconfig eth0:1 10.0.0.1
pascal ~ # ifconfig eth0:1
eth0:1 Link encap:Ethernet HWaddr 00:50:70:56:2E:CA
inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:225 Base address:0xc000

ifconfig is probably being used to configure your interfaces, unless
you switched to iproute2.
--
gentoo-user@gentoo.org mailing list
 
Old 11-28-2007, 08:18 AM
Etaoin Shrdlu
 
Default static IP, gateway and netmask setting

On Monday 26 November 2007, Dan Farrell wrote:

> you don't have to list the broadcast or netmask, if they can be
> guessed from context. In the case of using a 192.168.x/24 network
> they can generally both be guessed properly, because that's a Class C
> private address .
>
> However, in the case of 10.0.0/24, this may not be true. that is
> defined as class A private address space, and the networking utilities
> would probably assume it was 10.0.0/8, a netmask of 255.0.0.0 and a
> broadcast of 10.255.255.255. That is what ifconfig does at least:
>
> pascal ~ # ifconfig eth0:1 10.0.0.1
> pascal ~ # ifconfig eth0:1
> eth0:1 Link encap:Ethernet HWaddr 00:50:70:56:2E:CA
> inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> Interrupt:225 Base address:0xc000

That is what ifconfig does, if you don't specify a netmask:

[root@mozart /x]# ifconfig eth0:1 10.0.0.1 netmask 255.255.255.0
[root@mozart /x]# ifconfig eth0:1
eth0:1 Link encap:Ethernet HWaddr 00:11:2F:BB:F6:0D
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:17


I don't know exactly how initscripts work, but I suppose that if the /24
is given in /etc/conf.d/net, then both the resulting iproute2 and
ifconfig command that bring the interface up will include the netmask
specification.
--
gentoo-user@gentoo.org mailing list
 
Old 11-28-2007, 05:58 PM
Dan Farrell
 
Default static IP, gateway and netmask setting

On Wed, 28 Nov 2007 10:18:05 +0100
Etaoin Shrdlu <shrdlu@unlimitedmail.org> wrote:

> I don't know exactly how initscripts work, but I suppose that if
> the /24 is given in /etc/conf.d/net, then both the resulting iproute2
> and ifconfig command that bring the interface up will include the
> netmask specification.

How the net init script works (there's really only one, generally net.*
is linked to net.lo for update simplicity) is configured
in /etc/conf.d/net. /etc/conf.d/net.example holds examples for just
about every imaginable configuration, but from my net, iproute2 looks
something like:

modules=("iproute2");
config_eth0=( "192.168.1.87/24 brd 192.168.1.255");
routes_eth0=( "default via 192.168.1.1" );
config_eth1=( "192.168.1.88/24 brd 192.168.1.255" );

but as you can see, that still doesn't set up a netmask but uses the
default. I agree that in both cases the default would be /8 for a
10.xxx network, but as you can see the config syntax is different for
iproute2 and ifconfig.
--
gentoo-user@gentoo.org mailing list
 
Old 11-28-2007, 06:11 PM
"Rafael Barrera Oro"
 
Default static IP, gateway and netmask setting

Indeed, setting the ip, gateway, and netmask was enough to make it work in my case.

Thanks to all for your replies.

2007/11/28, Dan Farrell <
dan@spore.ath.cx>:On Wed, 28 Nov 2007 10:18:05 +0100
Etaoin Shrdlu <
shrdlu@unlimitedmail.org> wrote:

> I don't know exactly how initscripts work, but I suppose that if
> the /24 is given in /etc/conf.d/net, then both the resulting iproute2
> and ifconfig command that bring the interface up will include the

> netmask specification.

How the net init script works (there's really only one, generally net.*
is linked to net.lo for update simplicity) is configured
in /etc/conf.d/net.**/etc/conf.d/net.example holds examples for just

about every imaginable configuration, but from my net, iproute2 looks
something like:

modules=("iproute2");
config_eth0=( "192.168.1.87/24 brd
192.168.1.255");
routes_eth0=( "default via 192.168.1.1" );
config_eth1=( "192.168.1.88/24 brd
192.168.1.255" );

but as you can see, that still doesn't set up a netmask but uses the
default.**I agree that in both cases the default would be /8 for a
10.xxx network, but as you can see the config syntax is different for

iproute2 and ifconfig.
--
gentoo-user@gentoo.org mailing list
 
Old 11-28-2007, 07:56 PM
Etaoin Shrdlu
 
Default static IP, gateway and netmask setting

On Wednesday 28 November 2007, Dan Farrell wrote:

> How the net init script works (there's really only one, generally
> net.* is linked to net.lo for update simplicity)

That script only calls functions defined elsewhere. The hard (and
module-dependent) work is done by the files located
in /lib/rcscripts/net. In particular, /lib/rcscripts/net/iproute2.sh
and /lib/rcscripts/net/ifconfig.sh define all the various *_up(),
*_down(), *_add_address(), etc. functions that are invoked by net.lo.

> /etc/conf.d/net.example holds examples for just
> about every imaginable configuration, but from my net, iproute2 looks
> something like:
>
> modules=("iproute2");
> config_eth0=( "192.168.1.87/24 brd 192.168.1.255");
> routes_eth0=( "default via 192.168.1.1" );
> config_eth1=( "192.168.1.88/24 brd 192.168.1.255" );
>
> but as you can see, that still doesn't set up a netmask but uses the
> default.

What I see is that you are explicitly specifying the netmask. The /24 in
your lines specifies the netmask. Even if you didn't, in your case
things would probably still work, because iproute2 would probably use a
class C netmask, which is also /24. But nonetheless you are not
using "the default" (whatever this means), but are instead explicitly
specifying a netmask.

> I agree that in both cases the default would be /8 for a
> 10.xxx network, but as you can see the config syntax is different for
> iproute2 and ifconfig.

As I understand it, the syntax is exactly the same. What is different are
the commands that are run behind the scenes to configure the interfaces,
and these depend on the module you choose (iproute2 or ifconfig). In
other words, if you substituted modules=("iproute2") with
modules=("ifconfig") in your etc/conf.d/net, everything would still work
as expected.
The lack of a netmask specification will result in the tool used for the
configuration (ifconfig or iproute2) doing whatever is appropriate for
it: usually, this would just mean "use the default classful netmask",
--
gentoo-user@gentoo.org mailing list
 
Old 11-29-2007, 05:55 PM
Dan Farrell
 
Default static IP, gateway and netmask setting

On Wed, 28 Nov 2007 21:56:14 +0100
Etaoin Shrdlu <shrdlu@unlimitedmail.org> wrote:

> On Wednesday 28 November 2007, Dan Farrell wrote:
>
> > How the net init script works (there's really only one, generally
> > net.* is linked to net.lo for update simplicity)
>
> That script only calls functions defined elsewhere. The hard (and
> module-dependent) work is done by the files located
> in /lib/rcscripts/net. In particular, /lib/rcscripts/net/iproute2.sh
> and /lib/rcscripts/net/ifconfig.sh define all the various *_up(),
> *_down(), *_add_address(), etc. functions that are invoked by net.lo.

interesting tidbit.

> > /etc/conf.d/net.example holds examples for just
> > about every imaginable configuration, but from my net, iproute2
> > looks something like:
> >
> > modules=("iproute2");
> > config_eth0=( "192.168.1.87/24 brd 192.168.1.255");
> > routes_eth0=( "default via 192.168.1.1" );
> > config_eth1=( "192.168.1.88/24 brd 192.168.1.255" );
> >
> > but as you can see, that still doesn't set up a netmask but uses the
> > default.
>
> What I see is that you are explicitly specifying the netmask. The /24
> in your lines specifies the netmask. Even if you didn't, in your case
> things would probably still work, because iproute2 would probably use
> a class C netmask, which is also /24. But nonetheless you are not
> using "the default" (whatever this means), but are instead explicitly
> specifying a netmask.

good point. i seem to have overlooked the /24 part of my
configuration.

> > I agree that in both cases the default would be /8 for a
> > 10.xxx network, but as you can see the config syntax is different
> > for iproute2 and ifconfig.
>
> As I understand it, the syntax is exactly the same. What is different
> are the commands that are run behind the scenes to configure the
> interfaces, and these depend on the module you choose (iproute2 or
> ifconfig). In other words, if you substituted modules=("iproute2")
> with modules=("ifconfig") in your etc/conf.d/net, everything would
> still work as expected.
> The lack of a netmask specification will result in the tool used for
> the configuration (ifconfig or iproute2) doing whatever is
> appropriate for it: usually, this would just mean "use the default
> classful netmask",
yeah, I guess you're right. I for some reason thought the syntax was
different, but upon examining net.example I see that I was mistaken.
--
gentoo-user@gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 07:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org