single interface multiple networks + broadcast to all networks

single interface multiple networks + broadcast to all networks

Post by David Werne » Fri, 04 Feb 2005 12:38:08



Hello,

I have a machine which is in one network say 192.168.1.0.
But we have here a configuration where two networks 192.168.1.0
and 192.168.2.0 are local and directly available.
So I had to set up two routes to the local networks.
Now this machine should be a cups-server to both networks
and broadcast his cups-information into both networks.
I seems that I can sent only broadcast-packets  to the network
where the host belongs.
Is it so uncommon to sent broadcast into the other network?
Or must be the source of a broadcast packet originate in the same network?
Do I have to enable something under /proc/sys/net/...
Or is just cups broken?

Greetings,
        David

 
 
 

single interface multiple networks + broadcast to all networks

Post by prg » Fri, 04 Feb 2005 13:35:13



> Hello,

> I have a machine which is in one network say 192.168.1.0.
> But we have here a configuration where two networks 192.168.1.0
> and 192.168.2.0 are local and directly available.
> So I had to set up two routes to the local networks.
> Now this machine should be a cups-server to both networks
> and broadcast his cups-information into both networks.
> I seems that I can sent only broadcast-packets  to the network
> where the host belongs.
> Is it so uncommon to sent broadcast into the other network?

Routers -- unlike switches -- are broadcast boundaries.  Ie.,
broadcasts do not propogate beyond the local subnet.

Quote:> Or must be the source of a broadcast packet originate in the same

network?

If I understand your question, yes.  The most common broadcast will be
in regard to arp requests for normal traffic.

Quote:> Do I have to enable something under /proc/sys/net/...

To be able to route any packets from one interface to another you must
set:
[root]# echo 1 > /proc/sys/net/ipv4/ip_forward

Quote:> Or is just cups broken?

Not much we can confidently suggest without info about
-- all your nics (ifconfig -a),
-- all your route tables ($ route -n),
-- how you are trying to set up cups, and
-- confirmation that you have flushed your iptables rules when testing
(ie., firewall issues?)

Just how are you trying to access the cups printer?
prg
email above disabled

 
 
 

single interface multiple networks + broadcast to all networks

Post by David Werne » Fri, 04 Feb 2005 23:52:43




>> Hello,

>> I have a machine which is in one network say 192.168.1.0.
>> But we have here a configuration where two networks 192.168.1.0
>> and 192.168.2.0 are local and directly available.
>> So I had to set up two routes to the local networks.
>> Now this machine should be a cups-server to both networks
>> and broadcast his cups-information into both networks.
>> I seems that I can sent only broadcast-packets  to the network
>> where the host belongs.
>> Is it so uncommon to sent broadcast into the other network?

> Routers -- unlike switches -- are broadcast boundaries.  Ie.,
> broadcasts do not propogate beyond the local subnet.

I'm not speaking of routers.

Quote:

>> Or must be the source of a broadcast packet originate in the same
> network?

> If I understand your question, yes.  The most common broadcast will be
> in regard to arp requests for normal traffic.

>> Do I have to enable something under /proc/sys/net/...

> To be able to route any packets from one interface to another you must
> set:
> [root]# echo 1 > /proc/sys/net/ipv4/ip_forward

>> Or is just cups broken?

> Not much we can confidently suggest without info about
> -- all your nics (ifconfig -a),
> -- all your route tables ($ route -n),
> -- how you are trying to set up cups, and
> -- confirmation that you have flushed your iptables rules when testing
> (ie., firewall issues?)

What ifconfig -a me gives:

eth0      Link encap:Ethernet  HWaddr 00:E0:18:98:C5:C8  
          inet addr:129.69.98.105  Bcast:129.69.98.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:18ff:fe98:c5c8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8369789 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7188752 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1786347940 (1703.5 Mb)  TX bytes:1268345025 (1209.5 Mb)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2198 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2198 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:198318 (193.6 Kb)  TX bytes:198318 (193.6 Kb)

What netstat -nr says:

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
129.69.98.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
129.69.49.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         129.69.98.254   0.0.0.0         UG        0 0          0 eth0

Here iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination        

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination        

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination        

No firewall seems to be active.

As you see the Net 49 is local.
Now what I want to do in cups to broadcast into that net too.
What I originally do not wanted to do is to set another
ifalias of the host in the 49er network, as it seems to me to
take another ip-number for nothing.  And what I also
not intended to do is to set up some relay-host for the browsing
in the 49er network.

What works on the cups server is:
---------------------------------

- Broadcast to the local network with
BrowseAddress 129.69.98.255

- Broadcast to some other host in 49er network like
BrowseAddress 129.69.49.10

- global Broadcast. If I rely on the routers we could use that.

BrowseAdress 255.255.255.255

What not works is:
------------------

- Broadcast to the other 49er local network

BrowseAddress 129.69.49.255

- Broadcast to the whole class B network with

BrowseAddress 129.69.255.255

I checked these cases with tcpdump on another host so I assume that
it not so much a problem of the receiving host, but currently
of the sending.

Quote:

> Just how are you trying to access the cups printer?

with ipp.

Thank you,
        David

- Show quoted text -

Quote:> prg
> email above disabled

 
 
 

single interface multiple networks + broadcast to all networks

Post by prg » Sat, 05 Feb 2005 08:51:28


[snip the garbled Google ifconfig -a. I pasted it elsewhere for
reading]

Quote:

> What netstat -nr says:

> Kernel IP routing table
> Destination     Gateway         Genmask         Flags   MSS Window
irtt Iface
> 129.69.98.0     0.0.0.0         255.255.255.0   U         0 0
 0 eth0
> 129.69.49.0     0.0.0.0         255.255.255.0   U         0 0
 0 eth0
> 127.0.0.0       0.0.0.0         255.0.0.0       U         0 0
 0 lo
> 0.0.0.0         129.69.98.254   0.0.0.0         UG        0 0

 0 eth0
[snip]

Quote:> As you see the Net 49 is local.
> Now what I want to do in cups to broadcast into that net too.
> What I originally do not wanted to do is to set another
> ifalias of the host in the 49er network, as it seems to me to
> take another ip-number for nothing.  And what I also
> not intended to do is to set up some relay-host for the browsing
> in the 49er network.

I'm not sure about your setup here.  An alias on eth0:x 129.69.49.x?
You do have a route entered on that interface (eth0) but that doesn't
make it "local" in any sense I'm familiar with.

Quote:> What works on the cups server is:
> ---------------------------------

> - Broadcast to the local network with
> BrowseAddress 129.69.98.255

Because this _is_ local, ie., on the subnet of eth0.

Quote:> - Broadcast to some other host in 49er network like
> BrowseAddress 129.69.49.10

This is actually a unicast to the host 129.69.49.10, I believe.

Quote:> - global Broadcast. If I rely on the routers we could use that.

> BrowseAdress 255.255.255.255

Linux doesn't like you using this address -- it will normally change
this to the local subnet broadcast address.  Similar problem occurs
with DHCP clients (like Win) that boot up with this broadcast.  The
"solution" in that case is to add a "host" address (on the dhcpd box)
similar to:
# route add -host 255.255.255.255 dev eth0

But I don't think it will help you :(  Worth a try?

Quote:> What not works is:
> ------------------

> - Broadcast to the other 49er local network

> BrowseAddress 129.69.49.255

Because it's not the local subnet.  CUPS only broadcasts to the local
subnet and I doubt you can trick it into seeing multiple networks as
one.

Quote:> - Broadcast to the whole class B network with

> BrowseAddress 129.69.255.255

As above -- your networks' prefix length (/24) doesn't match (/16).

Quote:> I checked these cases with tcpdump on another host so I assume that
> it not so much a problem of the receiving host, but currently
> of the sending.

As near as I can tell, it's built into the cupsd _not_ to broadcast
unsolicited packets beyond the local subnet.

The closest candidate I could locate in cupsd.conf was:

to force the packects out a particular interface (?), but an
intervening router won't forward the broadcast dst 255.255.255.255.

The built-in restriction makes sense as a wayword router could "flood"
a server broadcast onto other networks.  It's also why routers don't
forward broadcasts.

I'm unclear on your network layout and the position of the cups print
server in that network.  You could, I think, get a server to broadcast
out each _physically_ attached interface onto the interfaces' subnets.
Otherwise, I don't think you will "trick" it into broadcasting farther
than that.

That's really the purpose of BrowsePoll and BrowseRelay:  provide a
means of crossing router broadcast constraints.  In fact, that's the
only way I've used cups in a multiple, routed, subneted network.  It's
also the mechanism that cups uses to "find" internet printers (which
obviously could not "broadcast" their presence).

Your situation may not "fit" the cupsd default behavior and I don't
know if slp is a reasonalbe/effective solution for your needs.  Cups
(according to cupsd.conf) supports it, but I'm sot sure of the details.
 You can check out openslp here:
http://www.openslp.org/

hth,
prg
email above disabled

 
 
 

single interface multiple networks + broadcast to all networks

Post by David Werne » Sun, 06 Feb 2005 01:20:43




> [snip the garbled Google ifconfig -a. I pasted it elsewhere for
> reading]

>> What netstat -nr says:

>> Kernel IP routing table
>> Destination     Gateway         Genmask         Flags   MSS Window
> irtt Iface
>> 129.69.98.0     0.0.0.0         255.255.255.0   U         0 0
>  0 eth0
>> 129.69.49.0     0.0.0.0         255.255.255.0   U         0 0
>  0 eth0
>> 127.0.0.0       0.0.0.0         255.0.0.0       U         0 0
>  0 lo
>> 0.0.0.0         129.69.98.254   0.0.0.0         UG        0 0
>  0 eth0
> [snip]
>> As you see the Net 49 is local.
>> Now what I want to do in cups to broadcast into that net too.
>> What I originally do not wanted to do is to set another
>> ifalias of the host in the 49er network, as it seems to me to
>> take another ip-number for nothing.  And what I also
>> not intended to do is to set up some relay-host for the browsing
>> in the 49er network.

> I'm not sure about your setup here.  An alias on eth0:x 129.69.49.x?
> You do have a route entered on that interface (eth0) but that doesn't
> make it "local" in any sense I'm familiar with.

No alias, but just a route I think.

- Show quoted text -

Quote:

>> What works on the cups server is:
>> ---------------------------------

>> - Broadcast to the local network with
>> BrowseAddress 129.69.98.255

> Because this _is_ local, ie., on the subnet of eth0.

>> - Broadcast to some other host in 49er network like
>> BrowseAddress 129.69.49.10

> This is actually a unicast to the host 129.69.49.10, I believe.

>> - global Broadcast. If I rely on the routers we could use that.

>> BrowseAdress 255.255.255.255

> Linux doesn't like you using this address -- it will normally change
> this to the local subnet broadcast address.  Similar problem occurs
> with DHCP clients (like Win) that boot up with this broadcast.  The
> "solution" in that case is to add a "host" address (on the dhcpd box)
> similar to:

Here actually it seems to do it. Maybe anyways not to recommendable
as it can happen that this changes.

- Show quoted text -

Quote:> # route add -host 255.255.255.255 dev eth0

> But I don't think it will help you :(  Worth a try?

>> What not works is:
>> ------------------

>> - Broadcast to the other 49er local network

>> BrowseAddress 129.69.49.255

> Because it's not the local subnet.  CUPS only broadcasts to the local
> subnet and I doubt you can trick it into seeing multiple networks as
> one.

>> - Broadcast to the whole class B network with

>> BrowseAddress 129.69.255.255

> As above -- your networks' prefix length (/24) doesn't match (/16).

>> I checked these cases with tcpdump on another host so I assume that
>> it not so much a problem of the receiving host, but currently
>> of the sending.

> As near as I can tell, it's built into the cupsd _not_ to broadcast
> unsolicited packets beyond the local subnet.

I suppose so too now.

> The closest candidate I could locate in cupsd.conf was:

> to force the packects out a particular interface (?), but an
> intervening router won't forward the broadcast dst 255.255.255.255.

Yes, it seems now to me the right choice to setup another interface (ipalias)
and use that.

Quote:

> The built-in restriction makes sense as a wayword router could "flood"
> a server broadcast onto other networks.  It's also why routers don't
> forward broadcasts.

> I'm unclear on your network layout and the position of the cups print
> server in that network.  You could, I think, get a server to broadcast
> out each _physically_ attached interface onto the interfaces' subnets.
> Otherwise, I don't think you will "trick" it into broadcasting farther
> than that.

Yes, this might be a choice.
I think to setup an real ipalias and broadcast onto that.
But, I haven't tested it now,

Quote:

> That's really the purpose of BrowsePoll and BrowseRelay:  provide a
> means of crossing router broadcast constraints.  In fact, that's the
> only way I've used cups in a multiple, routed, subneted network.  It's
> also the mechanism that cups uses to "find" internet printers (which
> obviously could not "broadcast" their presence).

Yes, I made a setup with BrowseRelay but viewed from the point
of reliability its one service more which can break.
I even thought of making an iptable which catches the broadcast
packet and rewrite it's address and sending it out again,
like NAT, but I think its not worth to make such
a difficult setup.

Quote:

> Your situation may not "fit" the cupsd default behavior and I don't
> know if slp is a reasonalbe/effective solution for your needs.  Cups
> (according to cupsd.conf) supports it, but I'm sot sure of the details.
>  You can check out openslp here:
> http://www.openslp.org/

Yes, I have had enabled it testwise, but it's packets looked strange to me :)
I'll consider it again.

Greetings and many thanks for your help,
        David

- Show quoted text -

Quote:

> hth,
> prg
> email above disabled

 
 
 

1. Multiple network interfaces via a single network card

Hello!

I have the following problem. I run linux (RH7.2) on a laptop. I use
different Ethernet networks at work and at home, and I would like to
be able to switch between the networks as easily as possible.

Everything is different in these networks, including IP address,
machine name etc. Previously when I was using PPP to set up the
network at home I had two different /etc/sysconfig/network files
depending on the situation. This worked since I had two different
interfaces, eth0 and ppp0. Now, however, that solution will not work,
since I am unable to configure two different interfaces, eth0 and
eth1, to use the same network card. According to my own inquiries, the
following lines in /etc/modules.conf should do the trick, but they
don't.

alias eth0 3c59x
alias eth1 3c59x

When I try to get eth1 up I just get the message 'delaying eth1
initialization' (when I try this eth0 is of course down.) Interface
eth0 still works fine when I put it up.

What am I doing wrong?

Jarmo

2. ci/co problem via NFS only between linux box

3. Does AIX support Combine 2 network adaptor to form a single network interface using single IP

4. slattach - almost works

5. Broadcasting with multiple network interfaces

6. I have the Trackball Marble + of Logitech, but I don't can use the wheel

7. Multiple external networks to multiple internal networks

8. termcap entry for vt220

9. Network interface sees broadcasts but nothing else!?!

10. More than one IP Addresses on a single Network Interface

11. Broadcast RPC (Well, any network broadcast code...)

12. Mandrake Single Network Firewall Web-interface Slow!!!

13. assign only one single IP address to 2 or more networks interface to your computer