Changing Network Configurations
This page covers how to modify the MangoGT's network settings, including switching from DHCP to a static IP address, configuring DNS servers, and understanding the default hostname and IPv6 addressing scheme.
Prerequisites
You will need SSH access to the MangoGT to change network settings. See SSH Access for connection instructions.
Log into the unit via SSH on port 2222 with the mango user and the password from the sticker inside the MangoGT box:
ssh mango@mangogtXXXX.local -p 2222
Default Network Configuration
All MangoGT units ship with the following default network settings:
| Setting | Default Value |
|---|---|
| IP addressing | DHCP client (automatic) |
| Hostname | mangogtXXXX (where XXXX is the serial number) |
| IPv6 link-local | fe80::XXXX (where XXXX is the serial number) |
| SSH port | 2222 |
| Mango web port | 8443 (HTTPS) or 8080 (HTTP) |
For example, a MangoGT with serial number 1234 would have:
- Hostname:
mangogt1234 - IPv6 link-local address:
fe80::1234
The hostname and static IPv6 address are based on the unit serial number for ease of identification, even before DHCP assigns an IPv4 address.
Changing to a Static IP Address
Step 1: Edit the Network Interfaces File
Open the network configuration file with a text editor:
sudo nano /etc/network/interfaces
Step 2: Modify the eth0 Configuration
The default configuration uses DHCP. Replace or modify the eth0 section with your desired static IP settings:
Default (DHCP):
allow-hotplug eth0
iface eth0 inet dhcp
Static IP example:
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1 8.8.8.8
Adjust the values to match your network:
| Parameter | Description | Example |
|---|---|---|
address | The static IP address to assign to the MangoGT | 192.168.0.100 |
netmask | The subnet mask for your network | 255.255.255.0 |
gateway | The default gateway (usually your router's IP) | 192.168.0.1 |
dns-nameservers | Space-separated list of DNS servers | 192.168.0.1 8.8.8.8 |
The gateway and dns-nameservers lines are optional. Omit them if the MangoGT does not need internet access or external DNS resolution (for example, on an isolated control network).
Step 3: Save and Exit
Press Ctrl+X to exit nano, then Y to confirm saving, then Enter to overwrite the file.
Configuring DNS Servers
When using a static IP, DNS servers should be defined in both the network interfaces file (as shown above) and in the /etc/resolv.conf file for immediate effect:
sudo nano /etc/resolv.conf
Add or modify the nameserver entries:
nameserver 192.168.0.1
nameserver 8.8.8.8
Save and exit with Ctrl+X, Y, Enter.
The first nameserver listed is the primary DNS server. The second is used as a fallback. Using a public DNS server like 8.8.8.8 (Google) or 1.1.1.1 (Cloudflare) as the secondary is a common practice to ensure DNS resolution continues working if the local DNS server becomes unavailable.
On some Debian systems, resolv.conf may be overwritten by the networking service on restart. If your DNS settings are not persisting, ensure the dns-nameservers directive is present in /etc/network/interfaces as shown in the static IP example above.
Applying Network Changes
After modifying the network configuration, apply the changes by restarting the networking service:
sudo systemctl restart networking
Alternatively, reboot the MangoGT:
sudo reboot
If you are connected via SSH and change the IP address, you will lose your SSH connection. Make sure you know the new IP address before applying changes so you can reconnect. If you make a mistake, you can access the MangoGT via the HDMI console to correct the configuration.
Switching Back to DHCP
To switch from a static IP back to DHCP, edit /etc/network/interfaces and replace the static configuration with:
allow-hotplug eth0
iface eth0 inet dhcp
Then restart the networking service or reboot the unit.
Verifying Network Settings
After applying changes, verify the configuration:
# View current IP address and network interface status
ifconfig eth0
# Test network connectivity
ping -c 4 8.8.8.8
# Test DNS resolution
ping -c 4 google.com
# View the routing table
ip route show
Multiple Network Interfaces
The MangoGT has a single Gigabit Ethernet interface (eth0). If you need additional network connectivity (for example, to connect to both a corporate network and an isolated control network), you can:
- Add a USB Ethernet adapter for a second wired interface
- Add a USB WiFi adapter for wireless connectivity
Additional interfaces are configured by adding new sections to /etc/network/interfaces using the interface name assigned by the system (typically eth1 for a second Ethernet adapter or wlan0 for WiFi).
Firewall Considerations
The MangoGT does not have a firewall enabled by default. If you need to restrict network access, you can install and configure iptables or ufw:
# Install ufw (Uncomplicated Firewall)
sudo apt-get install ufw
# Allow SSH access
sudo ufw allow 2222/tcp
# Allow Mango web access
sudo ufw allow 8443/tcp
# Enable the firewall
sudo ufw enable
Always allow SSH access (port 2222) before enabling a firewall, or you will lock yourself out of remote administration. Keep HDMI console access available as a fallback.
Related Pages
- Accessing the MangoGT — Initial setup and first-time login
- SSH Access to the MangoGT — Next step: command-line access over SSH
- Using OpenVPN — Set up VPN for secure remote access