How to change DNS IP for programmatically on CF 2.0 - compact-framework

I want to change the DNS IP Address programmatically to the Adapter on Compact Framework. I have checked in the NetworkInterface class of OpenNetCF 2.3 as well, but I do not want the device to be rebooted after setting.
Could somebody throw a light on the please?

The adapter's DNS server addresses are stored in the registry in a key like this:
[HKEY_LOCAL_MACHINE\Comm\<Adapter Name>\Parms\Tcpip]
"DNS"=REG_MULTI_SZ:<IP address of the DNS name server>.
Note that it is a multi_sz value.
Simply update the registry and rebind the adapter using the SDF's NetworkInterface.Rebind() method or by calling DeviceIoControl on the NDIS device with IOCTL_NDIS_REBIND_ADAPTER (which is what the SDF's call is doing).

Related

Using 'connmanctl config' to set static IP without wired connection

I am currently using 'connmanctl config' to set static and DHCP settings with a wired connection. I'm curious if anyone has been successful with applying settings with the wire unplugged?
I would typically use 'connmanctl services' for a list of services then perform a string.match(blah, "ethernet_%w+_cable") to use that wired service name. I have been able to find and apply that service name with the ethernet cable unplugged BUT now when using 'connmanctl config':
connmanctl config ethernet_f8dc7a04ea82_cable --ipv4 manual 192.168.91.108 255.255.255.0 192.168.91.1 --nameservers 8.8.8.8
I get this error:
Error ethernet_f8dc7a04ea82_cable: Method "SetProperty" with signature "sv" on interface "net.connman.Service" doesn't exist
As you can see I have the service applied to the command and this is the same service name as when the cable is plugged in. This feature would be nice for equipment that needs to be pre-programmed before reaching the customer. I have also researched this error but can't find it being an issue with others the same as it is with my situation. Have also read many blogs, articles, etc...on trying to achieve this with nothing that jumps out at me.
...Any ideas ?
I had to perform this action via back-end with the code that I am using to configure. Just an example...settings are applied to /var/lib/connman/ethernet_?????cable/settings. I created the adapter name with the MAC address because it does not exist until the network is detected, created the directory /ethernet?????_cable then created an empty settings file on the fly. When programming and saving the settings via the equipment I am using I just insert the settings manually. When a network cable is plugged in and detected the settings you have applied work wonderfully.

Non local IP-ADDRESS in izpack

I'm trying get the IP address in my izpack installer. I have used the ${IP_ADDRESS} variable, but I get the local "127.0.0.1" address instead of the public IP of the computer. Is it the expected functioning? It seems quite useless to me, but I must have missed something. How can I get the public IP?
izpack: v5.0.3
java: 1.7.0_79
Ubuntu: 15.04
Thanks.
It looks like, ${IP_ADDRESS} is taken as (part from IzPack installer sources):
InetAddress localHost = InetAddress.getLocalHost();
IPAddress = localHost.getHostAddress();
hostname = localHost.getHostName();
So, the problem is, that InetAddress.getLocalHost() in most cases returns localhost addresses.
If you need to determine your public ip, it's not as easy, as just to take your localhost's address. You have to iterate over your network interfaces, getting their addresses and determine, which one you need. It's quite a common case if you need to do it not in your business code, but you need it inside the installer.
As I know, it's possible to make your own jar-file and to use it inside your installer, may be you should try to make your own ligic, that determine this public ip and is called from your IzPack installer.

Authentication on CRM 2013 with NLB

I have a problem of authentication on a vanilla CRM2013 installed on a NLB. The crm 2013 is working correctly if i use the ip address of the NLB, but if i try to access the NLB using is unique name, it's prompting for credentials and is not authenticating the user (the user is the one that i used for the setup process). Anyone has ever seen something like this? I try to fiddler the request and beside a small difference in a cookie request in the header to me they look the same. Also if i ping the unique name of the NLB it responds with the correct ip address.
The last test that i did was add the name in the host file, and i had the same problem (no authentication), looks like is managing to get to the server but it fails to authenticate. I tried to use localhost address and it worked (on both the single servers), and it worked with the name of the 2 servers that are part of my cluster, it worked with the ip of those servers too. Anyone has any idea why with the ip address of the NLB everything is working as i expect and as soon as I use the name is not working?
Recap:
Address |Status
-------------------------
CRM1.com |working
192.168.1.CRM1 |working
CRM2.com |working
192.168.1.CRM2 |working
192.168.1.NLB |working
NLB.com |not working
Obviously this is sample data, and I know that with the single server i will not use the NLB, I was expecting to have issues with both the Ip and the servername, not with just one of them.
I found out the reason is not working. When you install behind a NLB you need to change some parameters in iss. Since I'm not very good at managing it in the config editor you need to change the section, and update 2 keyvalues from false to true. Step 2-10 of this guide http://blogs.msdn.com/b/niran_belliappa/archive/2014/02/17/network-load-balancing-microsoft-dynamics-crm-2013.aspx

Force Glassfish to bind to a network interface

We are using Glassfish on multi homed servers and I would like to force Glassfish just to use one interface.
I updated domain.xml by
substituting every occurrence of 0.0.0.0 by the IP address
everywhere a port was mentioned without an address address=<IP> was added
every host=localhost was substituted with host=<IP>
After starting Glassfish several listeners are still listening on every available IP address:
3820: I tried to specify an address but the option is ignored
<iiop-listener port="3820" id="SSL" address="<IP>" security-enabled="true">
3920: same as above
<iiop-listener port="3920" id="SSL_MUTUALAUTH" address="127.0.0.1" security-enabled="true">
has no effect
7776: no idea
The next listeners use some dynamically generated ports
53491
53495
53496
53497
Now my question:
is there a way to make sure Glassfish will be using one and just one network interface?
if this cannot be achieved with Glassfish is there a way on a Linux system to trick an application to see only one interface?

moved net.tcp WCF services from localhost to IP address on new site, services won't load

I have a website running 2 WCF services. Working awesome until I needed to move them from the "Default Web Site" in IIS7 to a dedicated website with a new IP address. Now I get the error message:
"...could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name"
ALL I did was change:
net.tcp://localhost/...
TO:
net.tcp://10.1.2.204/...
I have changed every spot in my configs which once used localhost to specified IP address. The new website is setup exactly the same with the proper net.tcp bindings and it is bound to the single IP address of 10.1.2.204.
I cannot seem to figure out what is going on. I am looking at the svc trace logs and all I get is a bunch of the same.
My new website is called "core" whereas previously I was hosting on "Default Web Site". I added a new FQDN/public IP to route to this new site (backwards to the mentioned private IP address). Now my services are busted.
I know baseAddress is ignored when using IIS/WAS hosting, so I am not sure what else to check. I changed absolutely nothing else in the configs.
What else can I provide to help troubleshoot this?
--
I am also seeing this in the service trace viewer:
Activity Name Receive bytes on connection 'Listen at 'net.tcp://hole.myserver.com/...'.'.
...but the WCF services are actually hosted on that new "core" website which translates to my new private IP address. I have change FQDN names for the example. To make it clear:
I used to have 1 FQDN on this server using Default Web Site.
I now added a 2nd FQDN to this server, new website, second IP. It seems to me that the listening should be directed towards: net.tcp://core.myserver.com instead of net.tcp://hole.myserver.com. Let's pretend the server name is hole.myserver.com and my new website is core.myserver.com on the same server.
Hopefully this is not confusing and you can make sense of it.
I'm using the default net.tcp port of 808 and binding of 808:*
--
This is the first exception thrown that I can tell:
The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:10'.
--
None of these combos will activate the service and all produce the same exception:
net.tcp://localhost
net.tcp://localhost:808
net.tcp://10.1.2.204
net.tcp://10.1.2.204:808
even using a different port which I have done before without issue:
net.tcp://localhost:75
net.tcp://10.1.2.204:75
none of these work. :(
Thanks so much!
Its rights issue. Right click on your new website --> then Edit Permissions. On properties window click security tab and Edit button. Then Add IIS_IUSRS and give Read & Execute, List folder contents, Read permissions. Now iisreset and start to host and connect net tcp on new website.