How to connect Multiple Nics with VPC Peering at Google Cloud Platform

Assumed we can connect successfuly with VPC Peering within this tutorial. Now we try add more nics. in this example, we added 1 nic. Nic at Google compute engine cant add or remove, we must recreate compute engine to have more or less nic.


+-------+                 +--------+
|       nic0+             |        |
|       |   <-----------> nic0     |
|       nic1+             |        |
+-------+                 +--------+

server 1                  server2

server 1

nic0 =
nic1 =

server 2

nic0 =


server 1

  1. Create a new VPC Network with subnet . Dont overlap other subnet, in this example we use
  2. Create VPC Network Peering with name single-iface (in example). Follow this tutorial.
  3. configure or add two nic
    • with first nic0 subnet/network dhroot (in example), with external custom static ip address.
    • with second nic1 subnet/network single-iface (in example), with none external ip address.


  1. server 1 done.

server 2

  1. Create VPC Network Peering with name single-iface2-dgp (in example). Follow this tutorial.
  2. server 2 done

at the end configuration, it should be looks like these:

from instance 1

from instance 2

we can ping {from,to} server 1 {to,from} server 2 via nic0. But cant ping server 1 with ip address from server 2 because main/default routed to when leave interface. We can use tcpdump to troubleshoot this issue.

so we need route nic1 traffic from/to via interface nic1 or eth1 to with table routing to fix this issue.

assumed ip address nic1/eth1:, so configure server 1 with these commands:

ifconfig eth1 netmask broadcast mtu 1430
echo "1 rt1" | tee -a /etc/iproute2/rt_tables
ip route add src dev eth1
ip route add default via dev eth1 table rt1
ip rule add from table rt1
ip rule add to table rt1

recheck again traffic route to

root@dct:~# ip route show dev eth1 table rt1
default via 


now, trying ping or other tcp connect from server 2:

[root@serv3 ~]# telnet 22
Connected to
Escape character is '^]'.
SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u2