Changing of IP address, Subnet Mask, Default Gateway on a “Local Area Network” , NOT “Wireless Network...












0















I want to change the above without going to Network Sharing Center. So i used a batch file. I found this code but it only works for Wireless Network Connection but not for "Local Area Networks". I also tried to rename my connections before rerunning the script but it still does not change anything. The code is below



set connectionName="Local Area Connection"
set staticIP=192.168.247.2
set subnetMask=255.255.255.0
set defaultGateway=192.168.247.2
netsh interface ip set address %connectionName% static %staticIP% %subnetMask% %defaultGateway% 1

(the last sentence is in a single line)



I also tried to use a simpler code as shown below



netsh interface ip set address "Local Area Connection" static 192.168.30.77 255.255.255.0 192.168.30.2



But in the end both programmers didn't change anything when i check the settings under Ipv4.



Can anyone please help me with this?










share|improve this question

























  • Try "netsh interface show interface" and change address of an existing interface name rather than "Local Area Connection".

    – lx07
    Jan 26 at 15:59
















0















I want to change the above without going to Network Sharing Center. So i used a batch file. I found this code but it only works for Wireless Network Connection but not for "Local Area Networks". I also tried to rename my connections before rerunning the script but it still does not change anything. The code is below



set connectionName="Local Area Connection"
set staticIP=192.168.247.2
set subnetMask=255.255.255.0
set defaultGateway=192.168.247.2
netsh interface ip set address %connectionName% static %staticIP% %subnetMask% %defaultGateway% 1

(the last sentence is in a single line)



I also tried to use a simpler code as shown below



netsh interface ip set address "Local Area Connection" static 192.168.30.77 255.255.255.0 192.168.30.2



But in the end both programmers didn't change anything when i check the settings under Ipv4.



Can anyone please help me with this?










share|improve this question

























  • Try "netsh interface show interface" and change address of an existing interface name rather than "Local Area Connection".

    – lx07
    Jan 26 at 15:59














0












0








0








I want to change the above without going to Network Sharing Center. So i used a batch file. I found this code but it only works for Wireless Network Connection but not for "Local Area Networks". I also tried to rename my connections before rerunning the script but it still does not change anything. The code is below



set connectionName="Local Area Connection"
set staticIP=192.168.247.2
set subnetMask=255.255.255.0
set defaultGateway=192.168.247.2
netsh interface ip set address %connectionName% static %staticIP% %subnetMask% %defaultGateway% 1

(the last sentence is in a single line)



I also tried to use a simpler code as shown below



netsh interface ip set address "Local Area Connection" static 192.168.30.77 255.255.255.0 192.168.30.2



But in the end both programmers didn't change anything when i check the settings under Ipv4.



Can anyone please help me with this?










share|improve this question
















I want to change the above without going to Network Sharing Center. So i used a batch file. I found this code but it only works for Wireless Network Connection but not for "Local Area Networks". I also tried to rename my connections before rerunning the script but it still does not change anything. The code is below



set connectionName="Local Area Connection"
set staticIP=192.168.247.2
set subnetMask=255.255.255.0
set defaultGateway=192.168.247.2
netsh interface ip set address %connectionName% static %staticIP% %subnetMask% %defaultGateway% 1

(the last sentence is in a single line)



I also tried to use a simpler code as shown below



netsh interface ip set address "Local Area Connection" static 192.168.30.77 255.255.255.0 192.168.30.2



But in the end both programmers didn't change anything when i check the settings under Ipv4.



Can anyone please help me with this?







networking batch-file






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 26 at 14:58







NightKnight

















asked Jan 26 at 10:24









NightKnightNightKnight

33




33













  • Try "netsh interface show interface" and change address of an existing interface name rather than "Local Area Connection".

    – lx07
    Jan 26 at 15:59



















  • Try "netsh interface show interface" and change address of an existing interface name rather than "Local Area Connection".

    – lx07
    Jan 26 at 15:59

















Try "netsh interface show interface" and change address of an existing interface name rather than "Local Area Connection".

– lx07
Jan 26 at 15:59





Try "netsh interface show interface" and change address of an existing interface name rather than "Local Area Connection".

– lx07
Jan 26 at 15:59










1 Answer
1






active

oldest

votes


















0














Open control panel, all control panel, network connections and rename your ethernet adapter by right clicking and selecting 'rename'.



Delete the old name and add "Local Area Connection" - Press enter.



Run script again.






share|improve this answer
























  • Hi, i did what you suggested but it doesn't seem to work

    – NightKnight
    Jan 26 at 14:58











  • It has to be exact including capitalisation - try eth0 instead and reflect that in the batch script - reboot after renaming too.

    – JohnnyVegas
    Jan 27 at 8:52











  • Yup, renaming it as eth0 works. Thanks for the help

    – NightKnight
    Jan 27 at 10:31











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1398678%2fchanging-of-ip-address-subnet-mask-default-gateway-on-a-local-area-network%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Open control panel, all control panel, network connections and rename your ethernet adapter by right clicking and selecting 'rename'.



Delete the old name and add "Local Area Connection" - Press enter.



Run script again.






share|improve this answer
























  • Hi, i did what you suggested but it doesn't seem to work

    – NightKnight
    Jan 26 at 14:58











  • It has to be exact including capitalisation - try eth0 instead and reflect that in the batch script - reboot after renaming too.

    – JohnnyVegas
    Jan 27 at 8:52











  • Yup, renaming it as eth0 works. Thanks for the help

    – NightKnight
    Jan 27 at 10:31
















0














Open control panel, all control panel, network connections and rename your ethernet adapter by right clicking and selecting 'rename'.



Delete the old name and add "Local Area Connection" - Press enter.



Run script again.






share|improve this answer
























  • Hi, i did what you suggested but it doesn't seem to work

    – NightKnight
    Jan 26 at 14:58











  • It has to be exact including capitalisation - try eth0 instead and reflect that in the batch script - reboot after renaming too.

    – JohnnyVegas
    Jan 27 at 8:52











  • Yup, renaming it as eth0 works. Thanks for the help

    – NightKnight
    Jan 27 at 10:31














0












0








0







Open control panel, all control panel, network connections and rename your ethernet adapter by right clicking and selecting 'rename'.



Delete the old name and add "Local Area Connection" - Press enter.



Run script again.






share|improve this answer













Open control panel, all control panel, network connections and rename your ethernet adapter by right clicking and selecting 'rename'.



Delete the old name and add "Local Area Connection" - Press enter.



Run script again.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 26 at 12:12









JohnnyVegasJohnnyVegas

2,4881815




2,4881815













  • Hi, i did what you suggested but it doesn't seem to work

    – NightKnight
    Jan 26 at 14:58











  • It has to be exact including capitalisation - try eth0 instead and reflect that in the batch script - reboot after renaming too.

    – JohnnyVegas
    Jan 27 at 8:52











  • Yup, renaming it as eth0 works. Thanks for the help

    – NightKnight
    Jan 27 at 10:31



















  • Hi, i did what you suggested but it doesn't seem to work

    – NightKnight
    Jan 26 at 14:58











  • It has to be exact including capitalisation - try eth0 instead and reflect that in the batch script - reboot after renaming too.

    – JohnnyVegas
    Jan 27 at 8:52











  • Yup, renaming it as eth0 works. Thanks for the help

    – NightKnight
    Jan 27 at 10:31

















Hi, i did what you suggested but it doesn't seem to work

– NightKnight
Jan 26 at 14:58





Hi, i did what you suggested but it doesn't seem to work

– NightKnight
Jan 26 at 14:58













It has to be exact including capitalisation - try eth0 instead and reflect that in the batch script - reboot after renaming too.

– JohnnyVegas
Jan 27 at 8:52





It has to be exact including capitalisation - try eth0 instead and reflect that in the batch script - reboot after renaming too.

– JohnnyVegas
Jan 27 at 8:52













Yup, renaming it as eth0 works. Thanks for the help

– NightKnight
Jan 27 at 10:31





Yup, renaming it as eth0 works. Thanks for the help

– NightKnight
Jan 27 at 10:31


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1398678%2fchanging-of-ip-address-subnet-mask-default-gateway-on-a-local-area-network%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

 ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕