<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Cannot change default gateway from code</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ae7cd7effb/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ae7cd7effb/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/ae7cd7effb/</id><updated>2021-11-15T07:59:09.193000Z</updated><subtitle>Recent posts to Cannot change default gateway from code</subtitle><entry><title>Cannot change default gateway from code</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ae7cd7effb/?limit=25#1ab0" rel="alternate"/><published>2021-11-15T07:59:09.193000Z</published><updated>2021-11-15T07:59:09.193000Z</updated><author><name>mrbrave</name><uri>https://forge.codesys.com/u/mrbrave/</uri></author><id>https://forge.codesys.com64606aff00000ba9a14b2c217138d64f507bf53e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks &lt;a class="user-mention" href="/u/jcarter/"&gt;@jcarter&lt;/a&gt;! I will try this aswell.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Cannot change default gateway from code</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ae7cd7effb/?limit=25#5988" rel="alternate"/><published>2021-11-10T18:52:38.880000Z</published><updated>2021-11-10T18:52:38.880000Z</updated><author><name>jcarter</name><uri>https://forge.codesys.com/u/jcarter/</uri></author><id>https://forge.codesys.comba06e551ba31ece979af98f40adbe29a27d3b4c4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have this exact same issue, I ended up adding in SysSockSetDefaultGateway("eth0",Gateway) after the UpdateConfiguredIPSettings to get around it&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Cannot change default gateway from code</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ae7cd7effb/?limit=25#4950" rel="alternate"/><published>2021-09-01T13:50:28.428000Z</published><updated>2021-09-01T13:50:28.428000Z</updated><author><name>mrbrave</name><uri>https://forge.codesys.com/u/mrbrave/</uri></author><id>https://forge.codesys.comf88ae7a74fd014699e839d03e2a7a16eb3c56f08</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;I am experiencing some problems when trying to change IP-address, subnet mask and default gateway using Codesys standard method "UpdateConfiguredIpSettings". The IP and netmask is updated when the code is executed, but the gateway cannot be changed. I have attached a picture of the running code. And a gif showing displaying the problem.&lt;/p&gt;
&lt;p&gt;Any ideas on what I can try? Am I missing a configuration parameter in the .cfg file or is there any other Linux background setting I need to change?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I am using codesys 3.16.3 together with the 4.0.0.0 runtime on a raspberry Pi CM3 based PLC. Network config is done in /etc/network/interfaces.d/*.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The options "Adjust operating system settings" is checked under the Ethernet device.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I have the following configuration in the CODESYSControl_User.cfg file:&lt;br/&gt;
&lt;span&gt;[SysCom]&lt;/span&gt;&lt;br/&gt;
    Linux.Devicefile=/dev/ttyUSB&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[CmpBlkDrvCom]&lt;/span&gt;&lt;br/&gt;
;Com.0.Name=MyCom&lt;br/&gt;
;Com.0.Baudrate=115200&lt;br/&gt;
;Com.0.Port=3&lt;br/&gt;
;Com.0.EnableAutoAddressing=1&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[SysProcess]&lt;/span&gt;&lt;br/&gt;
Command=AllowAll&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[CmpApp]&lt;/span&gt;&lt;br/&gt;
Bootproject.RetainMismatch.Init=1&lt;br/&gt;
Application.1=Application&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[CmpRasPi]&lt;/span&gt;&lt;br/&gt;
Architecture=armv7l&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[SysSocket]&lt;/span&gt;&lt;br/&gt;
Adapter.0.Name="br_extmodbus"&lt;br/&gt;
Adapter.0.EnableSetIpAndMask=1&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[CmpSocketCanDrv]&lt;/span&gt;&lt;br/&gt;
ScriptPath=/opt/codesys/scripts/&lt;br/&gt;
ScriptName=rts_set_baud.sh&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;BR,&lt;br/&gt;
Simon&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>