# Question about static routes inside the PLC

**URL:** <https://community.br-automation.com/t/question-about-static-routes-inside-the-plc/2502>\
**Category:** B&R Software & Runtime\
**Created:** [March 11, 2024, 2:54pm UTC](https://community.br-automation.com/t/question-about-static-routes-inside-the-plc/2502 "2024-03-11T14:54:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roberto\_Beneduci](https://avatars.discourse-cdn.com/v4/letter/r/FF8800/32.png) [@Roberto\_Beneduci](https://community.br-automation.com/u/Roberto_Beneduci)\
**Post date:** [March 11, 2024, 2:54pm UTC](https://community.br-automation.com/t/question-about-static-routes-inside-the-plc/2502/1 "2024-03-11T14:54:07Z")

</div>

> [@A tiny network basics glossary](https://community.br-automation.com/t/a-tiny-network-basics-glossary/2462):
>
> Preamble Before you start reading, please let me point out: The following content is not “the complete knowledge about networks and services” (not even almost wink ), and it’s not intended to be. They’re dozens of thousands of websites out there, explaining that stuff much more in detail. I’m aware that almost everybody who’s reading this post already knows what’s a IP address, a subnet mask and so on, and has already used those things many, many times. They’re already some posts and very go…

Thankyou for sharing your knowledge @alexander.hefner!  
I have a question about static routes, in particular as regards the static route inside the PLC. You say that in the PLC route table the entry 192.168.200.0 — 255.255.255.0 — 192.168.200.200 must be added, in this route table the route 192.168.10.0 – 255.255.255.0 – 192.168.10.10 is needed too?

Thankyou in advance.

---

<div class="post-metadata">

**Author:** ![alexander.hefner](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/alexander.hefner/32/111_2.png) [@alexander.hefner](https://community.br-automation.com/u/alexander.hefner)\
**Post date:** [March 11, 2024, 6:07pm UTC](https://community.br-automation.com/t/question-about-static-routes-inside-the-plc/2502/2 "2024-03-11T18:07:09Z")

</div>

Hi Roberto,

yes, in general you’re totally right: a “backward route” is needed for responses from the remote network, or to initiate a outgoing communication from the remote network to the local one.

But as I tested the setup with two PLCs and my notebook, I was surprised that one static route was enough and the communication through the routing PLC in both directions already worked.  
So it seems that the backward route is automatically activated by the operating system and their interfaces setup , or I did a mistake while testing 😉

Unfortunately I ran out of time for a deeper investigation, but when I’m back from vacation I’ve alteady planned to have a second look into the topic.

Best regards!

---

<div class="post-metadata">

**Author:** ![austin.carpenter](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/austin.carpenter/32/1196_2.png) [@austin.carpenter](https://community.br-automation.com/u/austin.carpenter)\
**Post date:** [March 11, 2024, 8:40pm UTC](https://community.br-automation.com/t/question-about-static-routes-inside-the-plc/2502/3 "2024-03-11T20:40:21Z")

</div>

Hello Roberto,

Good catch in the static routing portion of the Network Basics post. While Alexander is on vacation, I’ll try to answer the question.

> I have a question about static routes, in particular as regards the static route inside the PLC. You say that in the PLC route table the entry 192.168.200.0 — 255.255.255.0 — 192.168.200.200 must be added, in this route table the route 192.168.10.0 – 255.255.255.0 – 192.168.10.10 is needed too?

The short answer is ‘no,’ because the PLC doesn’t need a static route to know to forward a packet to a known local interface. By the same token, the PLC doesn’t need the 192.168.200.0 — 255.255.255.0 — 192.168.200.200 entry because the PLC’s routing table already does it. If you look at a routing table within Windows (Command Prompt: route print), you will see that there already exists routing tables for forwarding a local network packet to the appropriate interface. The same exists in B&R PLCs.  
 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/5/5f2080884383f1643262d65bd02c84a4fd26274a.png)

Let me try to break down what is happening in the example:

> Static route inside the notebook (in first network, 192.168.10.123)  
> **192.168.200.0 — 255.255.255.0 — 192.168.10.10**

The static route inside the notebook tells the notebook to send all packets destined for the 192.168.200.0 network to the PLC at 192.168.10.10. The packet looks as follows:  
_Source: 192.168.10.123 (notebook)  
Destination: 192.168.200.10 (device)  
Send to: 192.168.10.10 (PLC)_

Since the notebook has a plan to reach 192.168.10.10 through the 192.168.10.123 interface, this packet will be sent to the PLC directly.

The PLC receives the packet and realizes that the packet is not for its address (despite being the recipient). The PLC then passes the packet through its routing table. Since the PLC has an interface in the 192.168.200.0 network, then it has a plan to send the packet along its way. The packet is sent out of the 192.168.200.200 interface to the device at 192.168.200.10.

> Static route inside the machines network device (in second network, 192.168.200.10)  
> **192.168.10.0 — 255.255.255.0 — 192.168.200.200**

With the static route on the device, the return packet swaps the source and destination:  
_Source: 192.168.200.10 (device)  
Destination: 192.168.10.123 (notebook)  
Send to: 192.168.200.200 (PLC)_

The PLC receives the packet from the device and notes that it is not the destination address. It puts the packet through its routing table and determines that it can send the packet out on the 192.168.10.0/24 network to reach the destination.

In short, you don’t need a static route if you have an interface on that network. Since the PLC has an interface in both networks, it doesn’t need a static route. Static routes are very useful for separating out the ‘send to’ and ‘destination’ fields so you can route between networks.
