How to force network configurations and routes
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.
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.
Prepare the following network information:
STATIC_IP
- the static IPv4 address allocated to the Hipchat ServerNETMASK
- the netmask the Hipchat Server will applyDNS_SERVER_1
andDNS_SERVER_2
- the DNS servers Hipchat Server will use to resolve hostnames on the networkGATEWAY_VM
- the default gateway through which Hipchat Server will contact the rest of the network
Gain 'root' access to the system:
sudo dont-blame-hipchat
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
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
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'
This file must not have a file extension (.sh, .pl, .rb, etc.) and must exist under
/home/admin/startup_scripts/
.Make the script executable and run it:
chmod +x /home/admin/startup_scripts/static_routes /home/admin/startup_scripts/static_routes
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'
This file must not have a file extension (.sh, .pl, .rb, etc.) and must exist under
/home/admin/startup_scripts/
.Make the script executable and run it:
chmod +x /home/admin/startup_scripts/static_dns /home/admin/startup_scripts/static_dns
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
Reboot the server:
reboot
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
- Validate that the Hipchat Server website (https://server.example.com/home) is accessible.
- Validate that Hipchat clients (https://server.example.com/chat) are able to connect to the Hipchat Server.