question

chaitanya-5758 avatar image
0 Votes"
chaitanya-5758 asked chaitanya-5758 commented

how to login with secondary network interface IP (private IP) in Ubuntu 18 Azure VM?

I had created a Azure ubuntu 18 VM in a private subnet. I'm attaching one more network interface to that VM which has only private IP but I'm unable to login into VM using secondary private IP. Also I'm not able to do telnet from and to that VM. Any help will be appreciate.

azure-virtual-machines
· 14
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @chaitanya-5758 , thank you for reaching out to us. Happy to help. Can you please tell me what steps did you perform to add second NIC to your VM?

I request you to validate the steps performed from How to create a Linux virtual machine in Azure with multiple network interface cards (except the fact that public IP is used in tutorial instead). Additionally, please note that you have to Configure guest OS for multiple NICs to make them work and to send to or from a secondary network interface, you have to manually add persistent routes to the operating system for each secondary network interface.

Once you've added the route for a secondary interface, verify that the route is in your route table with route -n.

Let me know if any questions/doubts.




0 Votes 0 ·

First of all I making the VM in stop state and attaching my already created secondary NIC to that stopped VM. Then I start the VM and login the VM using bastion host bcoz I choose the private VM. Then I'm going to create a "51-secondary.yaml" in "/etc/netplan" directory and making the script to configure the Secondary NIC IP address. Then I did "sudo netplan appy" and I'm logging out. Now if I want to login with secondary IP (private IP) I'm not able to login into VM. I allowed the same NSG which attached yo primary NIC for Secondary NIC also. I allowed SSH port to that NSG. For your reference I'm giving the "51-secondary.yaml" content here. Please check it.

0 Votes 0 ·

85288-capture34.png

0 Votes 0 ·
capture34.png (12.0 KiB)

Thank you for this information. Can you change your 51-secondary.yaml file like below (for now)?:

 network:
     version: 2
     renderer: networkd
     ethernets:
         eth0:
             addresses:
                 - 172.17.33.75/26
             dhcp4: true

Please check out this and this articles for more information about this change.

Further, I request you to save the file by using :wq and test your changes by running netplan try in Bash.

Assuming no issues with netplan try, run netplan apply. Verify the IP address is added to the network interface by running ip addr list eth0. You should be able to see IP address as part of the list. Let me know if you are able to connect to private IP after this








0 Votes 0 ·
Show more comments
Bechir avatar image
0 Votes"
Bechir answered chaitanya-5758 commented

Look at the nsg, maybe ssh is not allowed.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I allowed port 22 in the NSG inbound rules but still I'm not able to login into VM

0 Votes 0 ·
singhh-msft avatar image
0 Votes"
singhh-msft answered singhh-msft commented

@chaitanya-5758 , thank you for reaching out to us. Happy to help. Pls reconfigure Azure Bastion using Step-by-Step Guide: How to access Azure VMs securely using Azure Bastion?. Make sure the Bastion is in same region as that of other resources and the subnet of Bastion is appropriate. Further, make sure that there is no routing table attached to it.


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@chaitanya-5758 , just checking in to see if you got a chance to have a look at my response.

0 Votes 0 ·