You're headed in the wrong direction ... /etc/hosts isn't how you tell a computer what its own IP is, it's used for resolving domain names. (When you try to resolve a domain name typically your computer looks at hosts first, then goes to a DNS server, although that order can be reversed).
First, look in /etc/sysconfig/network to set the computer's boot-time host name. (The hostname command sets it at run-time).
Next, look in /etc/sysconfig/networking/devices to set the boot-time IP addresses for each network adapter in your linux box.
Finally, stop messing around with /etc/hosts
What you really want to do is get a DNS server set up which is beyond the scope of this problem. barring that, first, don't mess with the localhost line in your /etc/hosts or risk seriously breaking your computer. Second, put one line to refer to the *other* computer in each computer's /etc/hosts. hope this helps...