unable to access internet using the additional interface in azure VM.

Vigneshwaran S 31 Reputation points


I attached an additional interface(eth1) with attached public IP in the VM. I need to access the internet through the additional interface. I tried creating the default gateway for that interface ( sudo ip route add default via 10.x.x.x dev eth1 ). After run that command, the VM disconnects the ssh. I need to restart that VM and it goes back to default values.

Is there any other configuration needed for this?

VM: ubuntu 18.04 server
Both subnets and interfaces in the same VM
NSGs are configured to allow external traffic

route -n
Destination Gateway Genmask Flags Metric Ref Use Iface UG 100 0 0 eth0 U 0 0 0 eth0 U 0 0 0 eth1

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,257 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,199 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Alan Kinane 16,796 Reputation points MVP
    1 person found this answer helpful.

  2. risolis 8,701 Reputation points

    @Vigneshwaran S

    You have been started in the beginning with the following details hehehe:

    (I have many network as I have k8s pods, Here are some useful network)

    Are you using CNI advanced networking features on your K8 node?


    1 person found this answer helpful.

  3. risolis 8,701 Reputation points

    @Vigneshwaran S

    Your virtual network is 10/8 as per your output(Correct me if I am mistaken)....

    Did you subnet your space address into small subnets or not? You can do subnetting and allocate each NIC in different subnet....

    Did you restart your VM after adding another NIC?
    Do you have any UDR(User define routes set up)?

  4. risolis 8,701 Reputation points

    @Vigneshwaran S

    I just wanted to know if you have any other concern.


    0 comments No comments

  5. Vigneshwaran S 31 Reputation points


    Sorry for the late reply.

    I followed this blog (https://www.thomas-krenn.com/en/wiki/Two_Default_Gateways_on_One_System) and it is working.

    Thankyou @risolis and @Alan Kinane .

    0 comments No comments