Find the answer to your Linux question:
Results 1 to 10 of 10
I am running and FC4 box with 2 ethernet interfaces. Each interface has a separate IP address assigned and the traffic is routing properly. What I am looking for is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2007
    Posts
    5

    Dual Hostname configuration


    I am running and FC4 box with 2 ethernet interfaces. Each interface has a separate IP address assigned and the traffic is routing properly.

    What I am looking for is a method of assigning a separate hostname to each interface. I have seached the web high and low, but cannot find anything to give me a clue on if/how this can be done.

  2. #2
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    Try adding the IP's and hostnames to /etc/hosts, then removing HOSTNAME= from /etc/sysconfig/networking and putting a HOSTNAME=whatever.whatever.com in /etc/sysconfig/network-scripts/ifcfg-eth0 and ifcfg-eth1

    Then reboot, see what happens

  3. #3
    Just Joined!
    Join Date
    Mar 2007
    Posts
    5
    Thanks, but it did not work.

  4. #4
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    Can you tell me what exactly defines 'working' in this situation, so I can better understand what you're trying to do.

  5. #5
    Just Joined!
    Join Date
    Mar 2007
    Posts
    5

    OK...you asked for it...

    I am working with a program called multicast beacon. You can read more about it here: http://dast.nlanr.net/projects/beacon/

    I am running two instances of this program. One is acting as the central beacon server for our campus network, the other is communicating as a beacon client to the central server at NLANR. I need the central server to report the hostname associated with the interface it is using and the client to do the same for it's interface. The main issue is the beacon program itself (I think). It apparently uses a couple of perl modules to grab the hostname, then sends the hostname to the central server. The central server then does a reverse lookup for the IP address. That info is then added to the beacon matrix.

    The only real issue is that the wrong host/ip info is showing up in the table. Even with proof that the two beacon instances are communicating on different interfaces, my boss still does not believe it is working. I have been posting this question to various groups for the past 2 weeks and still nothing.

    Like I said, it's working, the sniffer captures prove that. I just need to get the proper hostnames reported via beacon so the boss will be happy.

  6. #6
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    So a reverse lookup on two different ip's returns the same hostname?

  7. #7
    Just Joined!
    Join Date
    Mar 2007
    Posts
    5
    No. The beacon program is using 2 perl modules to get the hostname from the local machine. It apparently returns whatever the last 'HOSTNAME=xxx.xxx.xxx' entry is in the hosts file. I have verified this by changing the order of the HOSTNAME entries in this file. When I do that the last hostname in the file is what is sent to the central server. The beacon client does not send the IP information to the central server, only the hostname that it gets using the above process. When the central server gets that hostname info, it does a DNS lookup using the hostname it received from the client and adds that to the matrix.

  8. #8
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    If what you're saying is accurate, that's pretty horrible design. Are you sure that this program is arbitrarily grabbing the first field of the last line in the /etc/hosts file? Regardless of IP address?

  9. #9
    Just Joined!
    Join Date
    Mar 2007
    Posts
    5
    Well I'm not the most experienced programmer, but from what I can tell, yes this is how it works. I too think that is a pretty horrible design. I think my best hope at this time is some sort of response from the folks who developed the software.

    Todd

  10. #10
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    Well if the command
    Code:
    ifconfig -a
    shows eth0 with an ip of 10.10.10.10 and eth1 with an ip of 10.10.200.10, then your /etc/hosts should look something like this


    10.10.10.10 eth0.whatever.com eth0
    10.10.200.10 eth1.whatever.com eth1

    First field is IP, second is full hostname, third is alias

    Before you troubleshoot further I think your best bet like you say is to ask the developer how he determines the hostname. If it's via DNS, then you need to use route to make sure the appropriate packets always go out on the proper interface, so that the server on the other end gets the packet from the IP address of the proper interface.

Posting Permissions

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