4) Set SBC LAN as Default Gateway

Set SBC LAN interface as the default gateway, so that the YMP can initiate outbound connections to the Internet through the SBC gateway.

The following diagram represents the architecture of your VPC after you've completed this step.

  1. Connect SSH to the SBC server, then type the following command:
    sudo echo 1 > /proc/sys/net/ipv4/ip_forward
    sudo iptables -t nat -A POSTROUTING -o SBCwaniface -j MASQUERADE
  2. Connect SSH to the YMP server, set the gateway IP address to the IP address of SBC LAN.
    1. Type ifconfig to get IP address of your YMP server.
    2. Edit the configuration file interfaces.
      sudo vi /etc/network/interfaces
    3. Add the following sentences.
      Note: Make sure the sentence is placed on the last line: source /etc/network/interfaces.d/*.cfg.
      • {ymp_wan_interface} is the network interface name of your YMP WAN port. Generally, the WAN interface name is eth0. For different AMI chosen on the instance, the interface name may be different.
      • {ymp_ip} is the IP address of your YMP server.
      • {sbc_lan_ip} is the IP address of your SBC LAN interface.
      sudo iface {ymp_wan_interface} inet static
      sudo address {ymp_ip}
      sudo netmask 255.255.255.0
      sudo gateway {sbc_lan_ip}
  3. Restart the network.
    sudo /etc/init.d/networking restart
  4. Install traceroute.
    sudo apt-get update && apt install traceroute
  5. Check if the configuration is correct.
    sudo traceroute google.com
    If the configuration is successful, the route table should show SBC LAN IP address as the gateway IP.