• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

redhat/fedora network-scripts/ifcfg-eth0 question

Red Squirrel

No Lifer
Is the network parameter the same as the gateway? or is this something different? I noticed in lot of examples a network parameter will look like this:

Network 10.1.1.0

But when configuring a gateway, in windows for example, you would put

10.1.1.1 since that is the IP of the router.

So how does it work in linux when you put 0? since a default gateway is not nesecarily x.x.x.1 it can be anything but .1 is just the convention normally used.

Theres also a file called network in system-config with an actual default gateway, but unlike in windows, setting it this way does not let you have a default gateway on a per-nic basis.

I'm just a little confused on how the networking works in linux, after having an issue with an ESX server which adding a route with the route command fixed. I have a feeling this is because of a configuration file that's not well set.
 
Originally posted by: RedSquirrel
Is the network parameter the same as the gateway?
No, the network is different than the gateway. The short explanation is that the network IP is your lowest IP minus one. As you say, that often means you have a gateway at x.y.z.1 and the network at x.y.z.0, but it could end up at addresses other than 0 and 1.
So how does it work in linux when you put 0? since a default gateway is not nesecarily x.x.x.1 it can be anything but .1 is just the convention normally used.
The default gateway is supplied elsewhere, for just the reasons you say. It is not derived from the network parameter.
Theres also a file called network in system-config with an actual default gateway, but unlike in windows, setting it this way does not let you have a default gateway on a per-nic basis.
By definition, you can only have one default gateway. If Windows describes it otherwise, it's wrong. The default gateway is the single IP address to send packets to when 1) the destination is not on a locally attached subnet, and 2) there is no static route configured for that destination.
I'm just a little confused on how the networking works in linux, after having an issue with an ESX server which adding a route with the route command fixed.
Unless you're configuring a router you should never have to touch the route command. The ifup/down scripts handle that for you.

 
So default gateway is basically gateway of last resort then? I always thought those were 2 different things but now that I know, it does make sense.

So why is it that in windows you have an option for default gateway for each interface? (if you have multiple) instead of a global option. Is this actually "network" and it just automaticly puts the 0 based on the subnet mask you supply? Silly Gates. 😛
 
Originally posted by: RedSquirrel
So default gateway is basically gateway of last resort then?
Yes.
So why is it that in windows you have an option for default gateway for each interface? (if you have multiple) instead of a global option.
Having Googled a bit, it looks like you're basically just giving the system multiple gateways to choose from. Windows will pick one of them to be "the" default gateway and the others aren't used. So it's kind of a failover configuration.

 
GATEWAY=x.x.x.x is valid in the ifcfg-ethx files as well as /etc/sysconfig/network, can't say I've ever used it to any effect though, but I'm guessing it's pretty much the same thing as the "per interface default gateway" in Windows.
If you feel like it, you can just skip GATEWAY in the global network file and put it in the ifcfg-ethx file(s) instead.
 
Oh I see so it would just pick one (probably eth0 or whatever is primary) but keep others as failover. This makes more sense now.
 
putting in multiple gateways on windows can really complicate and cause problems.


replace "windows" with any os btw
 
Back
Top