Configure FreeBSD with Multiple IP Addresses

Last modified: October 8, 2020
You are here:
Estimated reading time: 1 min

Introduction

A basic network configuration at FastyCloud consists of a single IPv4 address, configured by DHCP. If you have advanced networking requirements, FastyCloud supports multiple public IPs and up to five private networks. You need to manually configure these advanced scenarios. Refer to the networking configuration page in the customer portal for your exact configuration. This example demonstrates three public IPv4 addresses, two private IPv4 networks, and two public IPv6 addresses.

IPv4 Info

MultipleIP

IPv6 Info

MultipleIP

Example for FreeBSD

Configure the public network with three public IPv4 addresses and two public IPv6 addresses. Configure two private networks.

Populate /etc/rc.conf with:

static_routes="linklocal"
route_linklocal="-net 169.254.0.0/16 -interface vtnet0"
ifconfig_vtnet0="inet 192.0.2.101 netmask 255.255.254.0"
defaultrouter="192.0.2.1"
ifconfig_vtnet0_alias0="192.0.2.102 netmask 255.255.255.255"
ifconfig_vtnet0_alias1="192.0.2.103 netmask 255.255.255.255"

rtsold_enable="YES"
ipv6_activate_all_interfaces="YES"
rtsold_flags="-aF"
ifconfig_vtnet0_ipv6="inet6 2001:db8:1000::100 prefixlen 64"
ifconfig_vtnet0_alias0="inet6 2001:db8:1000::200 prefixlen 64" 

# Private network 1
ifconfig_vtnet1="inet 10.1.1.100 netmask 255.255.240.0 mtu 1450"
# Private network 2
ifconfig_vtnet2="inet 10.1.1.200 netmask 255.255.240.0 mtu 1450"

Start the router solicitation daemon or reboot.

# service rtsold start
# reboot

Nameservers

Verify that /etc/resolv.conf has your preferred nameservers for IPv4, and optionally IPv6.

domain       example.com
nameserver   2001:db8:1000::1
nameserver   192.0.2.200

More Resources

  • How to Configure Multiple Private Networks at FastyCloud
  • How to Configure IPv6 on your VPS

Want to contribute?

Was this article helpful?
Dislike 0
Views: 25