Find the answer to your Linux question:
Results 1 to 2 of 2
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2006
    Posts
    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 10.1.1.1 gateway? Assume i have:

    eth0 as.. (app and db must use this as primary)
    IP ADDRESS=192.168.1.21
    NETMASK=255.255.255.0

    and

    eth0:0 as (I must use this for all external traffic)
    IP ADDRESS=10.1.1.21
    NETMASK=255.255.255.0
    GATEWAY=10.1.1.1

    Also need to use a multi-cast group address of 255.0.0.22

    aea

  2. #2
    Linux Enthusiast
    Join Date
    Apr 2004
    Location
    UK
    Posts
    707
    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.

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

    Let us know how you get on,

    Chris...
    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
  •