title: private and public ipaddress on azure cloud
body: <p>I'm trying to run gwan on an Azure cloud machine. But I get issues with network interfaces, or I simply cannot hit the machine with the browser.</p>
  
  <p>I believe the issue has to do with internal IP address assigned by the Azure router, but also I could be missing some critical security issue (or something else)</p>
  
  <p>The machine is running CentOS.</p>
  
  <p>Here is my configuration:</p>
  
  <ol>
  <li><p>/etc/sysconfig/iptables-config</p>
  
  <p>added a rule for accepting traffic via port 80</p>
  
  <blockquote>
    <p>-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT</p>
  </blockquote></li>
  <li><p>/etc/hosts</p>
  
  <p>added the public IP address and mapped that to a subdomain of cloudapp.net</p>
  
  <blockquote>
    <p>192.12.45.23  myappname.cloudapp.net</p>
  </blockquote></li>
  <li><p>gwan_linux64-bit</p>
  
  <p>changed the directories to suit the public IP.</p>
  
  <blockquote>
    <p>mv 0.0.0.0_8080/#0.0.0.0 
    192.12.45.23_80/#192.12.45.23</p>
  </blockquote></li>
  <li><p>run gwan</p>
  
  <blockquote>
    <p>sudo ./gwan</p>
    
    <p>can't listen on 168.62.8.160:80 (Cannot assign requested address)
    Available network interfaces (2):
    127.0.0.1 12.109.24.35 </p>
  </blockquote></li>
  <li><p>Then I tried both 12.109.24.35 and 127.0.0.1 interfaces - 
  gwan ran without an error,  but I couldn't browse the machine using the public IP of 168.62.8.160:80</p></li>
  </ol>
  
  <p>further info:
  /etc/sysconfig/network  doesnt use the FQDN myappname.cloudapp.net but</p>
  
  <pre><code>HOSTNAME=myappname
  NETWORKING=yes
  </code></pre>
  
  <p>as well, /etc/sysconfig/network-scripts/ifcfg-eth0 </p>
  
  <pre><code>DHCP_HOSTNAME=myappname
  
  DEVICE=eth0
  </code></pre>