Skip to content

Network gateway does not work after reboot

Hi there!

I have been using a PLCnext AXC F 3152 and I have had some trouble with setting the default gateway for different network interfaces. I want to configure one interface to be used in production and another interface to be used in my development environment. This way I can switch between the environments easily. These are my two networks:

Production: 192.168.1.0/24

Develeopment: 192.168.178.0/24

For the production environment, I can keep the default options for the first interface. Everything works well out of the box here.

However for my development environment, I need to change the network configuration. I have done that through the web interface where I set the static IP address, subnet and gateway. After rebooting however, the gateway is not persisted. The web interface reports the gateway address 0.0.0.0. When I check the routing table via the route command, only the first gateway is listed (192.168.1.1). This also means that I don't have internet connection in my development environment.

I can get internet access again by executing the following:

sudo route add default gw 192.168.178.1 lan3

This new gateway route is also reported in the output of the route command. However, this is not persisted after a reboot. After rebooting, the entry in the routing table is gone again. This means that I have to execute this command each time that I reboot the system.

I would expect that setting the gateway via the web interface works and the settings are persisted even after a reboot.

My software version: 2022.0.8 LTS

Best regards, Florian

Comments

  • edited November 2022

    Hello  Florian,

    please note, on the System only one Gateway can be supported. Please delete the not used Gateways e.g. in PLCnEng via "Online Parameters" and verify the Gateway setting in WBM or "network" data on the PLC.

    The adding of additional IP route should be executed during start up process of PLC. If you agree, we can proceed the needed steps togheter.

    Thanks!

    BR Eduard

  • Hi Eduard,

    thanks for your reply. This means that I am not able to switch between development and production environment without reconfiguring my network each time.

    As a workaround, I have configured my production network to use the IP range 192.168.1.0/24.

    The system is now productive and I don't want to change anything at the moment but thanks for the offer!

    Best regards, Florian

  • Hello Florian, 

    Ok, thanks for your feedback!

    Generally, it is possible to provide network telegrams between the diffrent IP-Subnets e.g. via nating or routing. The three subnet's of AXCF3152 are separated by default, if the user would like to change this setting, it is necessary to start a routing/nating configuration during start up process of PLC (the script will be executed automatically by start up).

    BR Eduard

  • Hello BR Eduard,

    As far as I understand, F3152 only allows us to provide a single gateway for a port. Because in one of our applications, we wanted to use different gateways for X1 and X2 ports. However, the gateway for the X2 port gets erased with each reboot.

    Additionally, I want to ask this as well.

    When we implement a redundancy application with the X2 port, don't we have the chance to read the field via Modbus through the X1 port?

    In other words, can't we establish different communications from different ports?


  • Hello!

    You can try to add scrip to location "/etc/network/if-ud.d/" or similar, to make script launched on certain event conditions of the network interfaces.

    In *.sh file add line "sudo route add default gw 192.168.178.1 lan3" (as you noted previously). Also, probably you have to modify sudoers file, to let launch route command as superuser without password request. It will provide additional configuration of network at statrtup of plc.

  • Hello oft.11,

    please find the answers to your questions below:

    Q: As far as I understand, F3152 only allows us to provide a single gateway for a port. Because in one of our applications, we wanted to use different gateways for X1 and X2 ports. However, the gateway for the X2 port gets erased with each reboot.

    A: Normally on the Linux OS only one Gateway will be used. If the configured standart-gateway e.g. for "lan1" on AXCF3152 will be found, then the configured gateways for "lan2" and "lan3" will be ignored.

    There are descriptions on how multiple gateways can be configured. These are not supported by phoenix contact. When you use the configuration, you are responsible for testing and managing the solution:

    Two Default Gateways on One System - Thomas-Krenn-Wiki-en

    To load the additional routing table on controller by startup, you can use the .sh script as suggested by Oleksandr. For this setting you need the root-rights, please find the description "Setting a root user password" under following link: User rights (plcnext.help).

    BR Eduard

Sign In or Register to comment.