How to force network configurations and routes

Still need help?

The Atlassian Community is here for you.

Ask the community

This Knowledge Base article was written specifically for the Atlassian Server platform. Due to the Functional differences in Atlassian Cloud, the contents of this article cannot be applied to Atlassian Cloud applications.

This article and its contents are not supported by Atlassian.

It is meant to assist in setting up Hipchat Server on unsupported platforms such as Proxmox KVMs, OVH, or any other system with a non-standard custom network setup. Any issues encountered while executing the steps below will not be supported by Atlassian.

We recommend attempting these changes with direct terminal access to the Hipchat Server virtual machine to allow for recovery from network misconfiguration.

Purpose

In most circumstances, the hipchat network command will properly configure network settings in Hipchat Server. More information can be found in Configuring a static IP address.

However, in particular environments this command does not have an effect on the system's gateway and DNS settings. This article outlines the steps to force the network setup via alternative system commands.

Solution

Be sure to backup Hipchat Server before executing the steps below.

It is recommended that anyone executing the steps below has a basic understanding of networking concepts such as routing tables, gateways, and DNS resolution.

  1. Prepare the following network information: 

    1. STATIC_IP - the static IPv4 address allocated to the Hipchat Server
    2. NETMASK - the netmask the Hipchat Server will apply
    3. DNS_SERVER_1 and DNS_SERVER_2 - the DNS servers Hipchat Server will use to resolve hostnames on the network
    4. GATEWAY_VM - the default gateway through which Hipchat Server will contact the rest of the network
  2. Gain 'root' access to the system: 

    sudo dont-blame-hipchat 
  3. Update /etc/network/interfaces to have the following content: 

    auto lo eth0
    iface lo inet loopback
    iface eth0 inet static
        address STATIC_IP
        netmask NETMASK
        dns-nameservers DNS_SERVER_1 DNS_SERVER_2
    
  4. Copy /etc/network/interfaces to /home/admin/config/etc/network/interfaces. This will allow changes persist through reboots, upgrades and Chef runs: 

    cp /etc/network/interfaces /home/admin/config/etc/network/interfaces
  5. Create a script ("static_routes" in this example) under the /home/admin/startup_scripts/ directory to add static routes to the routing table:

    # Defining GATEWAY_VM as a direct destination
    /usr/bin/sudo dont-blame-hipchat -c '/usr/sbin/route add GATEWAY_VM dev eth0'
    # Defining GATEWAY_VM as a default gateway
    /usr/bin/sudo dont-blame-hipchat -c '/usr/sbin/route add default gw GATEWAY_VM'

    (warning) This file must not have a file extension (.sh, .pl, .rb, etc.) and must exist under /home/admin/startup_scripts/.

  6. Make the script executable and run it: 

    chmod +x /home/admin/startup_scripts/static_routes
    /home/admin/startup_scripts/static_routes
  7. Create a script ("static_dns" in this example) to assign static DNS server(s):

     echo "nameserver DNS_SERVER_1 DNS_SERVER_2" | /usr/bin/sudo dont-blame-hipchat -c '/sbin/resolvconf -a eth0.inet'

    (warning) This file must not have a file extension (.sh, .pl, .rb, etc.) and must exist under /home/admin/startup_scripts/.

     

  8. Make the script executable and run it: 

    chmod +x /home/admin/startup_scripts/static_dns
    /home/admin/startup_scripts/static_dns
  9. Apply the changes using the Hipchat Server command-line interface (CLI): 

    hipchat network -m static -i STATIC_IP -s NETMASK -g GATEWAY_VM -r DNS_SERVER_1,DNS_SERVER_2
  10. Reboot the server:

    reboot
  11. Validate the changes: 

    # Check the routing table
    route 
    # Check the configured DNS server(s)
    cat /etc/resolv.conf
    # Check outbound connectivity to the Internet. If outbound traffic to the Internet is not allowed, try with a local network IP instead.
    ping 8.8.8.8
    # Check DNS resolution. If outbound traffic to the Internet is not allowed, try with a local hostname instead.
    nslookup statuspage.io
    # Check for connectivity to the HipChat Server upgrade servers
    hipchat upgrade -c
  12. Validate that the Hipchat Server website (https://server.example.com/home) is accessible.
  13. Validate that Hipchat clients (https://server.example.com/chat) are able to connect to the Hipchat Server.

   


Last modified on Jan 19, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.