1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Multiple IP Address for same host

Discussion in 'Tomato Firmware' started by baluvee, Feb 3, 2014.

  1. baluvee

    baluvee Network Guru Member

    Hi All
    For Oracle RAC, I need to have multiple IP address for same host. I have RT-N16 with tomato firmware Tomato Firmware 1.28.0000 MIPSR2-106 K26 USB AIO. I would appreciate if someone can help me with the request. I apologize if this was already answered.
     
  2. dc361

    dc361 LI Guru Member

    Do you have multiple hosts that need addressing or a single host that needs multiple addresses? The reason that I ask is that I understand that Oracle RAC (Real Applications Cluster) is a way to enable multiple hosts to share/use a single database (instance). My experience with RAC is for the enterprise layer where we either did use separate computers or VMs on separate hosts.

    To more directly answer or at least suggest a work-around -- did you try giving your host (if you need multiple IP for a single host) their own static IPs on the host -- As far as I know tomato's dhcp will only give a single IP to a single MAC address. On windows 7 pro for example you add an address using the advanced TCP/IP settings under the connection properties window.
     
  3. baluvee

    baluvee Network Guru Member

    thanks for the reply. single host needs multiple address. I am not using mapping mac to ip address. I left mac address as blank. I am trying to assign multiple ip for one host, but tomato throws error saying hostname duplicate
     
  4. dc361

    dc361 LI Guru Member

    That's correct. As far as I know Tomato can only issue one address per mac address, or in some cases one IP address for two separate mac addresses (wired/wireless can be issued the same IPV4.)

    To get multiple addresses on your system you will have to configure them on the host system and not through the router.. (thus my comments about windows and adding addresses to the interface.)

    So... if you are serving 192.168.1.2 - 192.168.1.50 through your router you could manually configure the host computer to have 192.168.1.55, 192.168.1.56, etc...
     
  5. koitsu

    koitsu Network Guru Member

    You're looking for IP aliases, assuming that what you're asking is "how can I get the Tomato router to answer on more than one IP address?"

    ifconfig {interface}:{index} {ipaddress}. Example:

    Code:
    ifconfig br0:0 192.168.1.2
    ifconfig br0:1 192.168.1.3
    
    And to remove an alias:

    Code:
    ifconfig br0:0 down
    ifconfig br0:1 down
    
    Be aware that you may need to restart daemons to pick up these changes.
     
  6. baluvee

    baluvee Network Guru Member

    Thanks for the replies. I am looking something like

    Round Robin
     
  7. koitsu

    koitsu Network Guru Member

    One-liner responses do not help anything. There are a couple of us that do not understand what you're asking, or even how/why this issue has anything to do with TomatoUSB at all. Everything you've been talking about so far implies it's something you want to do on a host/system running Oracle RAC, not TomatoUSB.

    If you could take the time to write an eloquent response that explains your situation in full, provides technical details of what you're trying to accomplish/what you want to solve, and describe the machines (by IP address, etc.) and what system runs what, it would be appreciated.

    As for "round robin" -- a super generic term which means something completely different depending on what you're referring to (load balancers, DNS, etc.) -- if what you're trying to accomplish is to get an Oracle DB connection (from the client) to "balance" between multiple IP addresses on a server (that may or may not be on the same physical server), then the simplest method is to use round-robin DNS. If your Oracle server(s) are 10.10.10.1 and 10.10.10.2, then you would make a DNS entry somewhere (you would need to run your own DNS server presumably) and specify something like this in the zone file:

    Code:
    oracleserver  IN A 10.10.10.1
                  IN A 10.10.10.2
    
    Then to establish an SQL connection, you would connect to the hostname "oracleserver". New TCP connections would "balance" between those two servers in a round-robin fashion, as long as the client DNS stack honours multiple A records (Java (the language/JVM), for example, does not -- it indefinitely caches a DNS lookup. You have to tell Java to stop doing DNS caching entirely for this to work). And as I said, those two IP addresses can be on the same server if you wish them to be (and to do that you need to use IP aliases on the Oracle server host itself, as well as ensure that the Oracle SQL server/daemon is able to answer on multiple IPs (using INADDR_ANY or by specifying them in some config file -- this is not an Oracle help site)).
     
    Last edited: Feb 5, 2014
  8. baluvee

    baluvee Network Guru Member

    Sorry Koitsu, It was not my intention to give one liner. somehow it was missed. Thanks for your time. what I need is
    create at least one single name
    that resolves to three IP addresses using a round-robin algorithm. Three IP addresses are
    recommended considering load balancing and high availability requirements regardless of the number
    of servers in the cluster.
    The IP addresses must be on the same subnet as your default public network in the cluster. The name
    must be 15 characters or less in length, not including the domain, and it must be resolvable without the
    domain suffix (for example: “sales1-scan’ must be resolvable as opposed to “scan1-can.example.com”).
     
  9. koitsu

    koitsu Network Guru Member

    Your question is about DNS, which I have already answered.

    Can you now explain what this has to do with TomatoUSB/routers?

    Surely a company deploying Oracle RAC runs their own DNS server somewhere on the local network -- and whoever runs that would be the person to talk to about getting what you need. :)
     
  10. dc361

    dc361 LI Guru Member

    So, my understanding is that you have 3 oracle servers in a cluster and you want client computers on a local subnet to be served an address for an oracle server in a round robin process.

    A couple of things -- First -- Koitsu mentioned that this is a DNS server function (it is!) so you could get your friendly network admin to add the records. If this isn't possible, fortunately tomato has a built-in DNS server called dnsmasq. Second -- what normally happens is that once you are served an address for a host, you have that address until the TTL value of the DNS record times out and then your local DNS resolver will go looking for another address. So there's the problem in a nutshell, we need to set the TTL for the address as low as practical and we need to have multiple addresses for a single locally resolved host name.

    Here's one solution that I came up with after a bit of searching, head scratching, and testing. I am running tomato RAF version 1.2x on an E3000 and I tested with a macbook pro...

    A) create a hosts file like the following:

    192.168.1.90 oraprod
    192.168.1.91 oraprod
    192.168.1.92 oraprod
    192.168.1.80 oratest
    192.168.1.81 oratest
    192.168.1.82 oratest

    Store this file in some sort of persistent location (jffs, usb stick, etc.) I put mine on usb in a directory called dns which is mounted by the router on /mnt/DC.

    B) Go to the ADVANCED -> DHCP/DNS page

    Make sure that "Use internal DNS" is checked.

    Enter the following (updated to reflect the location where your new host file is stored) in the dnsmasq custom configuration box:

    local-ttl=1
    addn-hosts=/mnt/DC/dns/hosts

    C) Test!

    dcmbp:~ dc$ ping oratest
    PING oratest (192.168.1.80): 56 data bytes
    Request timeout for icmp_seq 0
    Request timeout for icmp_seq 1
    ^C
    --- oratest ping statistics ---
    3 packets transmitted, 0 packets received, 100.0% packet loss
    dcmbp:~ dc$ ping oratest *** I waited 2-3 seconds ***
    PING oratest (192.168.1.81): 56 data bytes
    Request timeout for icmp_seq 0
    Request timeout for icmp_seq 1
    ^C
    --- oratest ping statistics ---
    3 packets transmitted, 0 packets received, 100.0% packet loss
    dcmbp:~ dc$ ping oratest ***ditto***
    PING oratest (192.168.1.82): 56 data bytes
    Request timeout for icmp_seq 0
    Request timeout for icmp_seq 1
    ^C
     
    baluvee likes this.
  11. baluvee

    baluvee Network Guru Member

    Thanks
     
  12. baluvee

    baluvee Network Guru Member

    Thanks a lot dc361. it helped.
     
    Last edited: Feb 5, 2014

Share This Page