How to configure IPV4 address and Subnet Mask - xamarin

In Xamarin iOS we can connect to a Wi-Fi network using SSID and password as below
var config = new NEHotspotConfiguration(SSID, Password, false) {
JoinOnce = false };
var configManager = new NEHotspotConfigurationManager();
await configManager.ApplyConfigurationAsync(config);
provided HotSpotConfiguration is added in the app entitlement.
My question is
Is it possible to change Configure IP option from Automatic to Manual?
If yes, how to configure IP address and subnet mask?

1. In Xarmain.ios NEHotspotConfigurationManager is from Apple's native method.
NEHotspotConfigurationManager refer to this from apple , this from xamarin
A configuration manager that applies and removes hotspot configurations of Wi-Fi networks.
So it can not configure IPV4 address and Subnet Mask
2. However, NEIPv4Settings
NEIPv4Settings contains the Internet Protocol version 4 (IPv4) settings of a IP layer network tunnel. can do that.you can refer to here from apple , here from xamarin
They are all extend from NetworkExtension (Configure VPN tunnels. Customize and extend core networking features.)
So you can use NEIPv4Settings to do that.
If you want connect to a wireless access point that is not connected to the internet.The Wifi connection is established fine and I can access other devices on that LAN.In ios,you can do that.
3. Workaround
The Wifi connection on the iPhone/iPad must be configured as a static connection. You must specify an unused IP in the range of the wifi access point (e.g. 192.168.0.2). Specify a mask (255.255.255.0). Do NOT enter any router IP.
Once connected to that wifi network, you can access other devices connected to the same wifi LAN (e.g. 192.168.0.*).
And do that, WAN is accessible through 3G!
More info: If want to do VPN, you can study NEVPNManager ,also extend from NetworkExtension.

Related

access to relay boards via VPN

I have a few 'smart' relay boards on different sites. These boards have a ethernet connection and are running a built-in web server on TCP 8080. I can access them from the local network and control them via a browser.
To control these boards remotely, I could assign them a fixed local IP address, open TCP port 8080 on my router and forward it to that address. But this is a risky thing to do, off course.
And I would have to do this on the different routers (from different IPSs) on each site and keep track of all these public IP addresses. (Via a dyndns service. Most routers are not VPN-enabled, afaik.)
Is there a better way using VPN-tunnels? I already have a Linux VPS running for other purposes and could install a Raspberry Pi on each location. All these Raspi's could connect to my VPS. And I would no longer need the dyndns.
Maybe, I could also find a way to map the URLs for the different relay boards to a more human-friendly form. Like this: http://myvps.domain.com/site2/relayboard3
How can I achieve this? I could install OpenVPN on the VPS server and the Raspberry Pi's (one for each site). But how do I have to configure this? VPS in the role as VPN server and Raspi's as VPN clients?
(I assume the gateway address from the relay boards has to change to the local address from the Raspberry.)
And do I need a VPN client om my Android phone to be able to browse to the relay boards or not?
What do I need to forward the http connections to the correct relay board? A proxy server?

forward vpn network to another interface

I have an RB750 with the follow setup:
- Interface 1 = WAN static IP
- Interface 2 = Static IP from a LAN network (LAN provided by another FW)
- MK as a IPSec/L2TP working well providing to clients the subnet x.x.x.x
I would like to redirect all traffic from VPN clients to the LAN network provided in Interface 2.
I mean; User setup in his computer the VPN with success, when connected they need to access the server z.z.z.z located inside the network provided in Interface 2.
Any ideas how to configure it?
You provide not much information, but if im not wrong
you can try NAT for example
/ip firewall nat add chain=srcnat action=masquerade out-interface="your Interface 2" src-address="your l2tp subnet x.x.x.x"

How to force MacOS to send network packets to local proxy even when Wi-Fi is not connected

MacOS version: Mojave
I have a program listening on a local port(2080). I would like to forward all network requests to this program.
In order to accomplish this, I have configured the Wi-Fi network service to use a socks5 proxy as well as dns server pointing to local host.
This works as long as the Wi-Fi network service is connected to any network, regardless wether that network is connected to the internet. (For instance, a chromecast).
Is there a way to force the packages to the program without having to connect to a network?
Previous attempts include creating a network service attached to the lookback device, lo0, with the proxy and dns settings as before (couldn't get any packets to be routed through the program, network panel says not connected) And installing tun/tap discussed in this question.(Virtual network interface in Mac OS X).
The device will show up in ifconfig, but not in network services after editing the SystemConfiguration/preferences.plist
Any guidance is welcomed.
Nevermind I figured it out. The Tun/Tap will work, just need to configure the virtual network service with correct DNS and proxy settings.

Private Server is accessed only by computers with IPs in range 10.10.20.XX

They say that IP addresses between the range 10.0.0.0 up to 10.255.255.255 can be used in private networks.
My work’s network has about 200 computers connected to each other using plain switch. At my office I own 2 computers which are connected to the network. The following configuration is true.
My PC1
IP: 10.10.20.113
Windows XP
Firewalls Off
No Proxy
Accessing PC2 from Firefox Browser using http://10.10.20.20 (It Works)
My PC2 (server PC)
IP:10.10.20.20
Windows XP, Apache Server
Firewalls Off
No Proxy
Server on this PC spits its homepage through the network at http://10.10.20.20
My private/local server above (PC2 with IP: 10.10.20.20) can be accessed only by Computers with IPs between the range 10.10.20.0 up to 10.10.20.255. A computer on the network that has an IP e.g. 10.10.30.30 throws a time out error. If I change Server's IP to 10.10.30.30 it works on networked computers in the IP range 10.10.30.XX but not on networked computers in the IP range 10.10.20.XX
How can I make my private server be accessed on any computer at the same private network with any IP addresses between the whole private range from 10.0.0.0 up to 10.255.255.255 ? Why god makes life difficult?
Thank U in advance !
It appears that your network has a mask length of /24. That means that the mask is 255.255.255.0. To access a network outside your network, you need a router. You wrote that you only have a switch so you need to add a router to route between networks.
Devices in the network 10.10.20.0/24 can only connect to devices in the 10.10.20.1 to 10.10.20.254 range. The 10.10.30.0/24 network has a range of hosts from 10.10.30.1 to 10.10.30.254. They are two different networks, and you need a router to route between those networks.

Share Internet on the same interface OS X

I have a laptop with only one Ethernet port and I connect to the internet through it using DHCP to get my IP. I also have a LAN which needs to connect to the Internet. The ONLY way to achieve this is using the laptop's Ethernet port.
I created an alias for en0 and allowed me to connect to the LAN.
The problem would be how to share the Internet using the same Ethernet port from the DHCP IP(which I set up using the Network Settings) to the alias(different IP) for the LAN. Again both IPs are on the same physical interface.
Thanks
You would have to set up a separate IP network space, add a secondary address to your ethernet interface, and run natd on your laptop to translate and route between the networks.
(of course putting all your other devices on the secondary network).

Resources