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

Vigneshwaran S 31 Reputation points
2022-03-10T14:48:40.083+00:00

Hi,

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
0.0.0.0 10.1.0.1 0.0.0.0 UG 100 0 0 eth0
10.1.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
10.2.0.0 0.0.0.0 255.255.255.0 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,586 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,312 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Alan Kinane 16,811 Reputation points MVP
    2022-03-10T15:17:02.353+00:00
    1 person found this answer helpful.

  2. risolis 8,711 Reputation points
    2022-03-11T06:57:07.897+00:00

    @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?

    Thx!

    1 person found this answer helpful.

  3. risolis 8,711 Reputation points
    2022-03-11T04:56:31.903+00:00

    @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,711 Reputation points
    2022-03-14T07:32:46.143+00:00

    @Vigneshwaran S

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

    Regards,

    0 comments No comments

  5. Vigneshwaran S 31 Reputation points
    2022-04-19T13:52:33.3+00:00

    Hi,

    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