Enable IP Forwarding

IP forwarding, also known as IP routing, is a process that allows a network device (like a router or a computer configured to act as a router) to pass incoming IP packets from one network interface to another. This is a fundamental function in networked environments, enabling communication between different networks and ensuring that data packets reach their intended destinations.

By default, IP forwarding is disabled. If you want to use your instance as a next hop for a route, this instance needs to forward packets whose sources don't match one of the default IP addresses or ranges. To forward packets with arbitrary source addresses, you must enable IP forwarding.

Procedures

  1. Check Enable IP forwarding when you create an instance, or check Enable IP Forwarding in Actions.

  2. Manually enable IP forwarding within the instancet operating system. Below are the steps for enabling IP forwarding on common OS types: Linux and Windows.

Temporary Enablement

To temporarily enable IP forwarding until the next reboot, you can use the following command.

  • For IPv4

    sudo sysctl -w net.ipv4.ip_forward=1
  • For IPv6

    sudo sysctl -w net.ipv6.conf.all.forwarding=1

Permanent Enablement

  1. To make the change permanent, edit the /etc/sysctl.conf file.

    sudo nano /etc/sysctl.conf
  2. Add or uncomment the following line.

    • For IPv4

      net.ipv4.ip_forward=1
    • For IPv6

      net.ipv6.conf.all.forwarding=1
  3. Save the file and apply the changes.

    sudo sysctl -p

Last updated