single interface multiple networks + broadcast to all networks

Discussion in 'Linux Networking' started by David Werner, Feb 3, 2005.

  1. David Werner

    David Werner Guest


    I have a machine which is in one network say
    But we have here a configuration where two networks
    and 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?

    David Werner, Feb 3, 2005
    1. Advertisements

  2. David Werner

    prg Guest

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

    If I understand your question, yes. The most common broadcast will be
    in regard to arp requests for normal traffic.
    To be able to route any packets from one interface to another you must
    [root]# echo 1 > /proc/sys/net/ipv4/ip_forward
    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?
    email above disabled
    prg, Feb 3, 2005
    1. Advertisements

  3. David Werner

    David Werner Guest

    I'm not speaking of routers.
    What ifconfig -a me gives:

    eth0 Link encap:Ethernet HWaddr 00:E0:18:98:C5:C8
    inet addr: Bcast: Mask:
    inet6 addr: fe80::2e0:18ff:fe98:c5c8/64 Scope:Link
    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: Mask:
    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 U 0 0 0 eth0 U 0 0 0 eth0 U 0 0 0 lo 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

    - Broadcast to some other host in 49er network like

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


    What not works is:

    - Broadcast to the other 49er local network


    - Broadcast to the whole class B network with


    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.

    with ipp.

    Thank you,
    David Werner, Feb 3, 2005
  4. David Werner

    prg Guest

    David Werner wrote:
    [snip the garbled Google ifconfig -a. I pasted it elsewhere for
    0 eth0
    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.
    Because this _is_ local, ie., on the subnet of eth0.
    This is actually a unicast to the host, I believe.
    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 dev eth0

    But I don't think it will help you :( Worth a try?
    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
    As above -- your networks' prefix length (/24) doesn't match (/16).
    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:
    #BrowseRelay @IF(src) @IF(dst)
    to force the packects out a particular interface (?), but an
    intervening router won't forward the broadcast dst

    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:

    email above disabled
    prg, Feb 3, 2005
  5. David Werner

    David Werner Guest

    No alias, but just a route I think.
    Here actually it seems to do it. Maybe anyways not to recommendable
    as it can happen that this changes.
    I suppose so too now.
    Yes, it seems now to me the right choice to setup another interface (ipalias)
    and use 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,
    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.
    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 Werner, Feb 4, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.