Wireguard works fine on WiFi but not working on LTE/3G (Mobile Network) - centos

I have a personal CentOS server and running an instance of Wireguard.
Everything works fine on WiFi but I have a problem connecting on LTE/3G (mobile network).
On LTE, Wireguard client shows it's connected to the server but there is no traffic. If I disconnect and reconnect it many times, randomly it got working.
I realized every time I do disconnect and reconnect, It gets a new Listen Port. So I tried to set one of the ports that are working fine on the client to disable random ports, but after one or two disconnect and reconnecting, that port is not functioning!
I also tried another mobile phone and the same result.
Any ideas?

Related

VS Code access to live server extension from another device

I want to see my website preview from my phone.
I just changed this setting and it was working fine.
It was working fine when my phone and computer are connected to same modem.
But when i connected another internet from my phone i cant access to live server
I am using 5500 port there is nothing running,
i gave access to 5500 port from firewall.
if you are in local network you write pc local ip in the address, if you are in another network, you write the public ip address of the pc + port.

2 router in cascade with 2 DHCP and remote access

The installation is in a holidays house (so no permanent internet access)
I have a 4g-Routerm (ROUTER-1 = huawei B525-b23) that enable the internet access. I switch it on one day a week.
I have another router (ROUTER-2 = GL-MT300N-V2).
ROUTER-2 is always plugged on electricity.
On ROUTER-2 is connected through ethernet port a Raspberry-Pi3 (with Home Assistant on it).
On ROUTER-2 is connected through WIFI a Camera IP
ROUTER-1 and ROUTER-2 are connected together through ethernet.
When ROUTER-1 is not plug to electricity, none have acces to internet, but it's not an issue.
The camera save picture on the Rapbery Pi3, the Home Assistat is recording some sensor data.
When I switch on the electricity on the ROUTER-1, everyone have access to internet.
What I want is to have remote Access to my router-2 and my Rasberry and my Camera when ROUTER-1 is online
How should I do ?
Hi I can think of two solutions for this setup but both involve buying a second hand cheap router.
I think the use of a single router would make this setup a lot easier. Any router would work that supports:a USB 4g Modem to be attached to it, and has support for setting up a openvpn server and you need to be OK with leaving the Internet on all the time just make sure you dont have any services running that use up bandwidth and you should be ok. You can can connect both raspberry pi and IP camera to that router. Setup Openvpn server open the UDP port required and download the certificates, You should be able to vpn into your network and manage it through SSH or something remotely.
The second option is tailored to you but still requires swapping the 4G Modem with another one that supports these things: Wake on LAN, openvpn server, supports ssh into it over LAN and either has 4G support through a sim card slot or a usb port with modem support.
You can then have it setup so this new Router-1 is switched off with wake on lan configured on it and the raspberry pi to send the magic packet. You can use something like this to get an idea of how WoL https://www.lifewire.com/wake-on-lan-4149800. You can use cron on your raspberry pi to send WoL signal to Router 1 once a week which would eventually give you internet access once the router is up. You have to setup a vpn server on it and forward the required port and download the certificates. When your scheduled WoL cron runs make sure you are able to connect through vpn then access network resources you wish, at the end when you are done you can ssh into the router-1 and turn it off.
I hope this helps. I had a look at the router models you are using and it doesnt leave you with many options. You can get cheap second hand routers online that support everything that is required.

oVirt engine 3.6 in local Internet **connectionless** network

I wanna use oVirt engine 3.6 in my Internet connectionless network. I installed oVirt with yum over internet. After that I tried to work offline. When I go offline Web Interface it still works fine. But I connected it to my local netowork Interface starts not to respond. I check POST/GET requests that made by it and I see it stuck on request/respond to/from GenericApiGWTService. For example, normally time between request and respond takes 1 to 600ms but when I connect it to local network it take up to 300.000ms second and eventually it fails. I use CentOS 7 x86_64. I couldn't figure out what is it cause to that.
I fix the problem by;
Use another IP from different address group then the one you use for
internet connection. Example: I used 192.168.1.10 for internet
connection. When I connect pc to local I changed it to 192.168.2.10
Delete all Gateway and DNS IPs.
Then it works fine.

Connect to attached pc from WP7 by opening a socket to localhost

When developing and testing WP7 apps you're pc is connected to either a real WP7 phone or to the WP7 Device Emulator. For a specific development-purpose I would like to connect directly to the development pc (let's call it the host pc) from the WP7 app without having to rely on an external toast-server. I'm using plain sockets, System.Net.Sockets.Socket.
There seem to be two options:
Obtain the host pc's LAN IP and connect to that
Connect to localhost
Option 1 usually works well, but not always: The host pc may not necessaily have an IP, in which case there's nothing to connect to. Also, in some scenarios all LAN traffic is directed through a company-wide proxy which will disrupt this mechanism.
That lead me to try out option 2. To my surprise it seems to work, but I need to be more sure than simply "it seems to work". I've googled all over but can't find any definitive answer, not even on Microsoft's site like e.g. http://msdn.microsoft.com/en-us/library/ff754351(v=VS.92).aspx. So this is my question:
What exactly is the defined behavior of connecting to localhost from a WP7 app?
Altrernatively, is there a fool-proof way of connecting back to the host-pc?
(Let me stress this again: For this particular purpose I can't use toasts, because the development pc may not even be online.)
Edit:
I work at EQATEC and the application in question is the EQATEC Profiler. Right now the profiler/app-communication is handled by injecting a socket/http-client into the deployed WP7 app that connects back to the profiler's LAN IP address. It works very well and is really fast, but in some very rare cases users are offline and therefore doesn't have an IP, or have some prohibitive lan proxy rules.
Therefore connecting to "localhost" would be excellent if that somehow magically would always work for everybody. It works for me and a couple of test-users, but does it work for all our many thousand profiler users all over the world? I'd like to be more sure.
"localhost" by definition is the machine running the code (well specifically the NIC doing the communication). For either the Phone or the Emulator, that would mean the phone or the emulator, not the PC they are attached to.
When you attach to a PC, you do have a network - it's an RNDIS connection in which both sides get an IP address which traditionally (pre-WP7) could be resolved with 'ppp-peer', though I've not tested that resolution on the Phone. I suspect it will be the same, since WMDC is still what's connecting and they'd have little reason to change that connection mechanism.
If the emulator is resolving localhost to the PC on which is resides, that's a definite bug and I would not count on it continuing to work as they add more robust socket support to the Phone platform.
System.Net.Sockets.Socket isn't really currently available for WP7 programming, but it might be available at some future point (maybe in Mango... maybe...)
AFAIK, the only way to reliably do what you want to do is to set up an http server on the development PC and to provide your app with an HTTP address of that server - or to route messages via some "Cloud proxy"
I'm surprised localhost works at all on the real device... I can only assume that they are asking the connected PC to resolve that DNS name - but even then I'm surprised 127.0.0.1 works.
The ip you're looking for is "192.168.55.100"
That's the ip address the phone uses to connect to the host pc.
If you'd like to connect to the phone, apparently its ip address will be "192.168.55.101"
For the emulator just use localhost or 127.0.0.1
This is from the old ActiveSync days, so I don't know how official it is or how likely it is to last, but for right now at least it worked on my phone.

Connecting Real device to Android emulator

I am developing a network app for Android and I'm still stuck on connecting my real Android device with an device-emulator running on my desktop computer.
I've created private network with a router, so the only ones connected to the network are my pc and my mobile phone, in order to avoid firewall/closed ports problems.
My PC ip is 192.168.1.100 and I'm trying to ping each other so I can sea reachability of each network node. Ping works fine from my PC (not the emulator console) to the phone.
The problem is that I want to ping the PC-emulator from my mobile phone, not the PC itself... For that, I use the emulator console... Should I use my computer IP or should I use another one? I've seen some ip's like "10.0.x.x" here http://developer.android.com/guide/developing/tools/emulator.html
But I guess those are for connecting two EMULATORS, right?
Besides, I've tried to connect them by socket, creating a redirection for the port via Emulator console, but still can't connect them.
Any clues?
Thanks!!
I tried the early solution I gave you and it didn't work. As you said maybe the reason is the redir command of the emulator console only redirects packets comming from the localhost.
So I searched for a simple proxy server and used it in the same machine to test it out.
http://www.java2s.com/Code/Java/Network-Protocol/Asimpleproxyserver.htm
With this I used the following configuration:
on the proxy:
String host = "localhost";
int remoteport = 3000;
int localport = 4000;
Then run the emulator instance:
Server socket listening on port 2000.
Open telnet instance and issue "redir add tcp:3000:2000"
And finally on the real device open a socket to the machine address on port 4000.
So the network map looks like:
Device <-> machine:4000 Proxy machine:3000 <-> :3000 Emulator :2000 -> Application
This worked for me using the same application on the device and emulator.
I've reached the conclusion that emulator can only receives packets coming from the loopback (127.0.0.1), since when you issue "redir add tcp:port:newPort, it only redirects the first port (associated to the loopback) to the second port (associated to the "emulator virtual ip").
I've tried to create a bridge, which redirects all the packets coming to my pc to the IP 127.0.0.1, but still not works. Thus, I think the emulator has been developed only to communicate with other emulators...
I hope anyone that comes here contradicts me.
You may be able to connect a real device with an emulator instance.
Did you tried setting a redirection on the emulated device and then connect the real device trough a java socket?
For example:
On the emulated device open a server socket listening on port 2000, then open a telnet connection and issue the command:
redir add tcp:4000:2000
Finally, open a socket on the real device to your machine address (192.168.1.100) on port 4000.