Change IP Address using Visual Basic - vb.net

How can you change your IP Address using visual basic please? I havnt been able to find anything useful anywhere so i was just wondering if I could get some help on here?
Im not onabout the external Ip address. I know that cannot be changed(I have a static one from my isp.) Im onabout changing the internal ipaddress... for example changing from: 192.168.1.150 to 10.0.0.125 –
Thanks
Chris

You could use some Windows scripting. It gets a little messy but you could create the script in VB.Net, write it to your hard drive and then execute it. When done, you can delete the script.
Here is an example of a script that changes the IP Address (and some other related fields):
http://www.wincert.net/forum/topic/40-change-ip-configuration-via-vb-script/
Then, you would execute it in VB.Net by calling
Process.Start("<The path of your .vbs file here>")
Good luck.

Your IP Address is leased to you via your ISP when you go online - you can't just "change it". If your ISP uses Dynamic IP leasing, you can switch off your router/modem for around 5 minutes, and reconnect - at which point you'll receive a new IP.
The only way to replicate this via VB would be to disconnect the user from a modem-based service within your application. But in this case, I'd hazard a guess that clicking the "disconnect" button would be an easier solution for the user.

you may not need to write any script to do this. And you dont need 2 network adapters as the only way to do this. in windows the network adapter can be assigned several IP addresses at the same time. go into network properties ipv4 tcp/ip settings advanced. you can put several ip addresses and masks. so if you have one pc but are using 2 different networks, just put 2 addresses in, then whichever network is connected use it normally.
if you have a network gadget like a new router and its on 192.168.0.200 and you know its going to be set to 10.1.1.x after you login, assign the computer 2 IPs like 192.168.0.100 and then 10.1.1.100.

Related

How to discover other domain hosts using rtps_discovery

Recently, I try hard to use OpenDDS SSL in WAN network. But All my attempts to failed.
This is caused by the inability to find different hosts.
I realized one thing. OpenDDS security should use rtps_discovery, not InfoRepo, and it is difficult to find two hosts in different subnetworks via rtps_discovery.
I have been searched about discovering host by rtps_discovery option from SourceForge, github, and stackoverflow. But, No one successed in this manner.
https://sourceforge.net/p/opendds/mailman/message/36320180/
https://github.com/objectcomputing/OpenDDS/issues/854
So, my question is how to find the host using rtps_discovery on the WAN network.
here is my ini file:
[common]
DCPSGlobalTransportConfig=$file
DCPSSecurity=1
[domain/4]
DiscoveryConfig=uni_rtps
[rtps_discovery/uni_rtps]
SedpMulticast=0
ResendPeriod=2
SpdpSendAddrs=publisher's IP:56789
[transport/the_rtps_transport]
transport_type=rtps_udp
use_multicast=0
local_address=subscriber's IP:55555
please give me some ideas to solve this problem
It is really impossible to discover hosts in different subnetworks via rtps_discovery??
I'm finally success to communicate using rtps discovery!
It just SpdpSendAddrs attribute set 8410 port.
like this:
[common]
DCPSGlobalTransportConfig=$file
DCPSSecurity=1
[domain/4]
DiscoveryConfig=uni_rtps
[rtps_discovery/uni_rtps]
SedpMulticast=0
ResendPeriod=2
SpdpSendAddrs=subscriber's IP:8410
[transport/the_rtps_transport]
transport_type=rtps_udp
use_multicast=0
But, new question is that how to confirm this security function work properly??
When I capture packet by wireshrk, I can see the data not encryped.
I used OpenDDS Messenger security example.

Nifi, processor group. How to map all allowed path to just one listening port of different headers

Lemme come straight into this.
Well, I have implemented Nifi to localhost. It's working well and everything seems to be perfect.
I have made many different flows with headers of course within the cluster as below.
Cluster
When I right click the header and go to "View configuration" go to "Properties" will see as follows.
Processor details
You can see the "Listening Port" that is 10004 and a "hostname" as well. Then there is "Allowed path" as can be seen.
Now If I want to access this specific header I have to hit using 10.0.0.18:10004/spec/transform.
Now the issue is, I have many different headers which are having a different listening port that is assigned by me. NIFI is not allowing me to assign the same port for every flow I make. but I have to assign different port every time I make a new flow. I just want to assign port 10004 to every other flow and just differ them using the "Allowed path".
How come I make this possible. I have to always assign new port to every new flow. Is there a way to do that. Hope you guys understand what am I actually willing to have. Hope to have your answers soon.
Thank you
You can have one HandleHttpRequest at the beginning of your flow listening on port 10004, and set the "Allowed Paths" property to a regular expression that matches all of the paths you want to support. HandleHttpRequest will add the path as an attribute to each flow file named "http.context.path", so you could then use a RouteOnAttribute to route each path to a different part of the flow.
As Bryan Bende
but in nifi 1.14.0 that is attribute: http.request.uri

omnet++ Inet - Simulating dynamic access point behaviour

I have to create a particular simulation for a college project. The simulation should feature several mobile nodes cyclically switch between 802.11 access point and station modes. While in station mode, nodes should read the SSIDs of access points around them, and then they should change their SSID in AP mode accordingly. There is no need for connections or data exchange between the nodes beside the SSID reading.
Now, I've been through Omnet/Inet tutorials/documentation (all two of them), and I feel pretty much stuck.
What I could use right now is someone confirming my understanding of the framework giving me some directions on how exactly I should proceed.
From what I understand is Inet does not implement any direct/easy way to do what I'm trying to do. Most examples have fixed connections declared in NED files and hosts with a fixed status (AP or STA) defined in the .ini file.
So my question is basically how do I do that: do I need to extend a module (say, wirelessHost), modifying its runtime behaviour, or should I implement a new application (like UDPApp) to have my node read other SSIDs and change his accordingly? And what is the best way to access an host's SSID?
You may utilize two radios for each mobile node e.g. **.mobilenode[*].numRadios = 2 (see also example in /inet/examples/wireless/multiradio/).
The first radio operates as AP **.mobilenode[*].wlan[0].mgmtType = "Ieee80211MgmtAPSimplified" which has to adapt its SSID.
The second radio serves as STA **.mobilenode[*].wlan[1].mgmtType = "Ieee80211MgmtSTA". Now, you have to sub-class Ieee80211AgentSTA which handles the SSID scanning procedure and has to change the first radio's SSID upon new SSID detection. Then you utilize the adopted sub-class within the simulation. Finally, active scanning has to be activated **.mobilenode[*].wlan[1].agent.activeScan = true.

Labview: error in accessing server addres space

I am trying to access the server address space and I am getting this Error.
LabVIEW: (Hex 0xFFFA8EBB) The node path refers to a node that does not exist in the server address space
The server is on a Plc and I am connected via Lan. the information i have is
Server-URL: opc.tcp://192.168.1.135:4840
Namespace-URI: urn:B&R/pv/
I have tried different things but i am not sure how to access the variables in address space. any suggestions would be helpful
B&R Publishes the Endpoints of your data in a fairly consistent manner. If you use a OPC UA browsing tool, you will find that the address space visible to Labview should start with
PLC.Modules.<Default>
B&R Automation Studio requires that you complete the default OPC UA configuration. Within that configuration you would need to enable the nodes/endpoints in question. You can then access these nodes in Labview.
You should check the following:
Under your controller, confirm that you have enabled OPC UA in the
configuration view.
Next, check that you have added a OPC UA Default View File to your
configuration for the hardware you are running.
Finally, in that file, ensure that you have enabled the endpoint/variable and that
it has at least the read permission. The quickest and most expedient
way is to ensure that you have gone to the top level of the OPC UA
Default View File and added the Everyone role and that Read is
enabled. This will cascade down to all enabled endpoints.
Save this and make sure it has been built and added to your controller. You should be able to access endpoints then.
For example, if I have a program called "LampController" running in B&R with a variable called switchState it would be addressed by:
PLC.Modules.<Default>.LampController.switchState
You need to use %26; in place of an ampersand. The ampersand is used to delimit the URI from the query segment. It's pretty unusual to even have an ampersand in a URI. Are you sure you typed it right?

How to dial a call on Cisco VOIP 7940 from my PC?

I'm trying to automate the dialing process: dial any number, patch others on the call, connect to a bridge at a scheduled time. I know how to do this while physically present in the office, but I need to automate it so that people can dial/get patched on the call without being physically present in the office.
If any one can help me with, how i can dial a number on VOIP phone from my PC, I would be able to do the rest (automation part).
Any Idea/Suggestion will be highly appreciated. Specially, the first method "Cisco IP Phone Services XML" which was suggested here: https://stackoverflow.com/questions/2517239/how-can-i-call-from-my-pc-through-my-cisco-ip-phone/. This one seems quite easy to implement as my automation tool primarily works around XMLs.
Iv'e never tested this with anything other than a SIP version of the Cisco 7940 series, so if your using SCCP or MCGP then what I present below may or may not work :-)
1) You need to make sure that you have your VOIP phone correctly set up and requesting it's config files from a TFTP server, helping you do that in this reply is beyond the scope of what I'm describing here.
2) Ensure that somewhere in one of those config files (Usually SIPXXXXXXXXX.cnf - where xxxxx is the phones mac address) you have 3 lines that configure the device for telnet access (which is disabled by default), the lines should look like this:
telnet_level: 2
phone_prompt: myphone
phone_password: mypassword
The telnet level MUST be 2, 0 disables, 1 makes it read only, the phone prompt is whatever you want the prompt to be '>', 'myphone ###' whatever and the password is the password you'll use to log in.
3) Once you've made those changes to your phone restart it by either pressing '*', '6' and 'Settings' at the same time, or by power cycling it. When it reboots it should obey the new settings in your config.
4) Now point a telnet program at the IP address allocated to your phone, and if all's gone well, you should get asked for a password, enter the password and marvel at the internal world of your Cisco phone ;-)
5) There are a number of commands you can use now, typing a ? and pressing return will give you help, typing then ? will help you on that command. type test ? and press return and you should see the following:
Test Command Definitions
------------------------
onhook , hu - Handset Onhook
offhook , hd - Handset Offhook
key , ky - Simulate Keystrokes
open , op - Open the Test Session
close , cl - Close the Test Session
show , sh - Show Call Feedback
hide , hi - Hide Call Feedback
6) Issue the command:
test open
your phone should reply with:
TEST: Opening Session
you are now in test mode.
7) once in test mode, entering
test key <key>
will activate that key. If you enter
test key ?
the phone should reply with:
Test Key Names
--------------
0-9 # *
line1 line2 navup navdn volup voldn
soft1 soft2 soft3 soft4 serv info dir
msgs set headset spkr mute
replace above with any of those names to activate that key.
8) Once your done, remember to call
test close
before disconnecting the telnet session.
I showed you the manual way here, but it doesn't take much to realize that you could easily script that from a PC or server that has access to the same sub-net as the phone. I have a set of JSON services running on mine that allows my home security system to do things like call the police if an intruder is detected while I'm not home, of for my web based phone book to auto dial numbers by clicking on a link.
All you need to know is the exact key sequence you need, then you can simply just open the test console, send the key sequence, and close. ANY key that's press-able on the phones front panel can be automated this way.