VPN to Azure gateway connects but does not resolve addresses - azure

I have set up a VPN to an Azure IKEv2 gateway following instructions from these sites:
full tutorial
Create Certificate
I had originally used the StrongSwan Gui version but after checking found that none of the configuration mentioned in the cli version had been completed so I worked through the cli version. When I start the VPN I get no errors and I can see logs in syslog that indicate the connection is set up. When I browse to a page that I need the connection for I get an error page stating DNS error. It has connected on more than one occasion and I have used the page but then if I turn it off and start it up again it does not work. I haven't found a pattern for it working yet and seems to be genuinely random.
I am on Ubuntu Linux
inxi -S
System: Host: lg-MS-7A71 Kernel: 4.15.0-51-lowlatency x86_64 bits: 64 Desktop: Gnome 3.28.3
Distro: Ubuntu 18.04.2 LTS
inxi -i
Network: Card: Realtek RTL8111/8168/8411 PCIE Gigabit Ethernet Controller driver: r8169
IF: enp3s0 state: down mac: 30:9c:23:61:4b:25
WAN IP: 2.124.241.7
IF: enp3s0 ip-v4: N/A ip-v6-link: N/A
IF: docker0 ip-v4: 172.17.0.1 ip-v6-link: N/A
IF: wlxbcec23c34e3a ip-v4: 192.168.0.20 ip-v6-link: fe80::96fb:6e3b:1233:79dc
not sure if it is clear from that but I don't use the on board network card and instead have a usb wifi adapter installed.
lshw (irrelavant removed)
*-network:0
description: Wireless interface
physical id: 2
bus info: usb#1:8
logical name: wlxbcec23c34e3a
serial: bc:ec:23:c3:4e:3a
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=rtl88x2bu ip=192.168.0.20 multicast=yes wireless=IEEE 802.11AC
I did try to switch to the on board network interface but that wasn't an improvement so I just kept trying to work on the wifi.
I have no idea what is wrong here but the connection is being made I am sure of it. When viewing the syslog I can see the subnet address I have been given from Azure which is also listed on the dashboard when I have connected. So it must be connecting except that if I ping the test address I have it does not resolve. That leaves the certificates or my configuration/set up. If the certificates were bad I would not connect (I don't think) so what do I need extra on my set up.
It is almost as though the connection is good but the link between my browser and the network doesn't recognise it. Is this possible?
[edit: more info]
I have gone through this again with more detailed instructions and I an now sure that I am connecting to the azure vpn but I am not getting the dns servers added:
adding DNS server failed
adding DNS server failed
handling INTERNAL_IP4_DNS attribute failed
adding DNS server failed
handling INTERNAL_IP4_DNS attribute failed
installing new virtual IP 172.20.20.130
CHILD_SA dv0_vnet{1} established with SPIs cd6f6be2_i 8c59932a_o and TS 172.20.20.130/32 === 10.216.0.0/17 172.20.20.0/24 183.3.0.0/22 183.3.5.128/25 183.3.6.0/25
connection 'dv0_vnet' established successfully

Finally I have figured this out. The last problem I had was a DNS problem setting dns server from Azure gateway. To fix this I had to install resolvconf and configure it for dynamic updates.
I had to:
install and configure strongswan (best instructions I found)
set mss/mtu in the charon configuration (as mentioned in this
post)
Install & configure resolvconf (as in answer here)
Set up network manager vpn (The graphical element for top right of
menu)
when that is done I bring up the connection
sudo ipsec up <vpn name as in ipsec.conf>
start the network manager client
and then I can browse to my test site in the vpn.

Related

curl: (28) Failed to connect to raw.githubusercontent.com port 443: Connection timed out

I am facing one error while installing FCL-CLI on my system (linux).
The command I have used is : sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" .
Error: curl: (28) Failed to connect to raw.githubusercontent.com port 443...NEED HELP!
Set DNS 8.8.8.8 in network will resolve this
Faced the same issue while trying to install nvm on ubuntu. Following steps solved my issue:
1)Open the /etc/hosts file using
$ sudo nano /etc/hosts
2)Enter your password.
3)Add the following IP address at the end of the file:
185.199.108.133 raw.githubusercontent.com
4)Save and close the file.
5)Now Try installing Again.
This my fix your problem.
Change from network in setting.
Open the /etc/hosts file using
$ sudo nano /etc/hosts
and then add following IP
185.199.108.133 raw.githubusercontent.com
save it and reinstall it again
For Windows Users:
Go to the Control Panel.
Click Network and Internet > Network and Sharing Center > Change adapter settings.
Select the connection for which you want to configure Google Public DNS. For example:
3.1 To change the settings for an Ethernet connection, right-click the Ethernet
interface and select Properties.
3.2 To change the settings for a wireless connection, right-click the Wi-Fi
interface and select Properties.
If you are prompted for an administrator password or confirmation, type the password or provide confirmation.
Select the Networking tab. Under This connection uses the following items, select Internet Protocol Version 4 (TCP/IPv4) or Internet Protocol Version 6 (TCP/IPv6) and then click Properties.
Click Advanced and select the DNS tab. If there are any DNS server IP addresses listed there, write them down for future reference, and remove them from this window.
Click OK.
Select Use the following DNS server addresses. If there are any IP addresses listed in the Preferred DNS server or Alternate DNS server, write them down for future reference.
Replace those addresses with the IP addresses of the Google DNS servers:
For IPv4: 8.8.8.8 and/or 8.8.4.4.
For IPv6: 2001:4860:4860::8888 and/or 2001:4860:4860::8844.
For IPv6-only: you can use Google Public DNS64 instead of the IPv6 addresses in the previous point.
Test that your setup is working correctly; see Test your new settings.
Repeat the procedure for additional network connections you want to change.
Ref: [https://developers.google.com/speed/public-dns/docs/using][Configure your network settings to use Google Public DNS]
Use a VPN or go to 1.1.1.1 in your browser and use WRAP by Cloudflare. Worked for me 👍

DNS server not working in QEMU usermode networking

I am trying to get QEMU 2.8.0 on Windows host to work with my Linux guest with vanilla 2.6.11.12 kernel but it is responding with unknown host.
I am using user mode networking (SLIRP).
Here's my qemu network status:
And my ifconfig:
And my routing table:
I am able to ping the router but not the QEMU DNS server:
Any help would be greatly appreciated!
Thank you very much.
This was not a problem with QEMU but instead a problem with my DNS setup.
My /etc/nsswitch.conf contained:
hosts: files
instead of the correct:
hosts: files dns
So it was not making the DNS requests to the server.

How to install whm,cPanel in my laptop?

I want to install whm & cpanel in my laptop. I install centOs 6.4 using oracle virtualBox as per instruction/iso in http://www.comunidadhosting.com/t/tutorial-de-como-instalar-cpanel-en-localhost.18879/.
After install it i check IP and it show me 10.0.2.15 . but my main problem is I am not able ping to guest machine from my host. When I ping from my guest to host machine then it's working fine , and host get internet access also.
I use NAT in networking.
Can any body tell me what is the problem and how to solve it ?
You need to check if you have a bridged connection OR a NAT connection with the outside host network. Both should have the same network connection and IP may be same/different.
And, if you have done this, then you need to disable the firewall on the guest-machine side so that your host machine could connect to the VM.
Your ping may then be failing because of getting blocked by the VM's firewall.

How to configure internet on CentOS installation on VirtualBox

I am a beginner to linux. I have done the fresh installation of CentOS 7 on my Windows VirtualBox.
Over the tutorials for CentOs 6 they have mentioned to edit /etc/sysconfig/network-scripts/ifcfg-eth0 file for the configurations.
But in my installation there is no such file. I have ifcfg-enp0s3 and ifcfg-lo files available.
From the CentOS tutorial, the eth0 portion of /etc/sysconfig/network-scripts/ifcfg-eth0 refers to the network interface. eth0 is the most common name for a standard ethernet interface in Linux. From your question, your system has two interfaces: enp0s3 and lo. lo is the loopback interface, so ignore that one. That leaves enp0s3.
Go ahead and follow the instructions with /etc/sysconfig/network-scripts/ifcfg-enp0s3. It should work, assuming that interface doesn't have any weird quirks associated with it.
Same here! I installed CentOS 7 in Windows7 Virtulabox, there is no eth0, but enp0s3.
After first reboot, used command ip addr, enp0s3 had no ip address
bundled;
Then I updated /etc/sysconfig/network-scripts/ifcfg-enp0s3, changed ONBOOT=no to ONBOOT=yes, enp0s3 had ip 10.x.x.x, still useless;
Then I updated /etc/sysconfig/network-scripts/ifcfg-enp0s3 according to the accepted answer of centos minimal installation static ip address, it works!
As my IP address of Ethernet adapter VirtualBox Host-Only Network is 192.168.56.1, I set 192.168.56.35 to enp0s3, and my vbox NIC mode is Host-Only.
Type nmtui in the terminal
Go to 'edit connection' and hit enter
Select 'enp0s3' and hit enter
Go down to 'Automatically connect' using down arrow key
Press space bar
Go down and press hit enter on 'Ok'
Go back and quit
It worked for me like this on windows 10 -Change Adapter 1 Name to "Remote NDIS based Internet Sharing Device"

Linux Debian SSH connection to another machine has delay after network settings change

Hi StackOverflow members,
I have an issue with ssh connection on my Debian 7 system to a remote OpenSSH server located on the same network. It looks like there is some network configuration problem but I cann't find where it lays. This two debian machines are connect with a switch that is NOT connected to a router. So the two machines have no internet connection.
A-Debian 7
IP: 192.168.1.2
MASK: 255.255.255.0
GW: 192.168.1.1
B-Debian 7
IP: 192.168.1.3
MASK: 255.255.255.0
GW: 192.168.1.1
With that configuration the ssh command prompts my for a password in less then a second. But the with the following network configuration I get the password prompt after a 10+ second delay:
A-Debian 7
IP: 10.10.1.83
MASK: 255.255.255.128
GW: 10.10.1.1
B-Debian 7
IP: 10.10.1.82
MASK: 255.255.255.128
GW: 10.10.1.1
The ssh connection from the server A -> B runs with both configs on custom 1111 port.
The B machine has also a Web server running on port 8080 that has no delays with both net configurations.
Thank you in advance for any clues or tips how to solve that problem.
SOLVED: Removing of the gateway parameter "GW: 10.10.1.1" in the network settings has solved the problem.
The usual culprits here are IPv6 and DNS lookups.
SSH might try to connect via IPv6, first, but the timeout is too low for that. You can see whether IPv6 is enabled with
cat /proc/sys/net/ipv6/conf/eth0/disable_ipv6
To disable:
echo 1 > /proc/sys/net/ipv6/conf/eth0/disable_ipv6
The second culprit is DNS; my guess is that DNS lookups don't work correctly with the second configuration. Try host www.google.com to test this theory.
If that also has a delay, you need to fix your DNS setup.
If that's not it, check the rest of your networking parameters: Gateway, cables, etc.
Start to ping the other host. Is that fast & reliable?
Next, try remote login (ssh, telnet). Note that you can give telnet a port to connect to, so if you have DB server running, you can still use telnet to connect to the server. It will print an error but it allows you to test the TCP/IP connection without any extra error sources.

Resources