Here is the process for adding a secondary network interface for Ubuntu 18.04: https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/virtual-network-multiple-ip-addresses-portal#linux-ubuntu-1804
unable to access internet using the additional interface in azure VM.
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
5 answers
Sort by: Most helpful
-
-
risolis 8,721 Reputation points
2022-03-11T06:57:07.897+00:00 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!
-
risolis 8,721 Reputation points
2022-03-11T04:56:31.903+00:00 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)? -
risolis 8,721 Reputation points
2022-03-14T07:32:46.143+00:00 -
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 .