Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Unhappy routing for dual ifaces and IPs on same NIC

    I am using RHEL WS. Can anyone tell me how to setup routing and dual ifaces on same NIC? I have an app with a db that looks for other related servers and infrastructure components via hardwired IPs in the app and database. The app and db must use iface eth0. My difficulty is that I must use an assigned IP from a completely different subnet and mask to network the host.

    I want to configure the app and db to see eth0 as the primary iface and then route all external IP traffic via an alias IP and interface eth0:0 on the same NIC. How do I route all external traffic to have source address from eth0:0 via the gateway? Assume i have:

    eth0 as.. (app and db must use this as primary)


    eth0:0 as (I must use this for all external traffic)

    Also need to use a multi-cast group address of


  2. #2
    Linux Enthusiast
    Join Date
    Apr 2004
    If I understand you correctly you want to set up eth0 for your app but have eth0:0 for normal internet traffic.

    From "man route":
    dev If force the route to be associated with the specified device
    When you are adding the route for the default gateway use the dev parameter as the last option.

    route add default gw dev eth0:0
    Change the gateway IP to whatever it should be and you should be set.

    Let us know how you get on,

    To be good, you must first be bad. "Newbie" is a rank, not a slight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts