Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server to listen to a specific network interface #1581

Closed
4 tasks
andythinkiq opened this issue Nov 5, 2021 · 1 comment · Fixed by #1596
Closed
4 tasks

Server to listen to a specific network interface #1581

andythinkiq opened this issue Nov 5, 2021 · 1 comment · Fixed by #1596
Assignees
Milestone

Comments

@andythinkiq
Copy link

Type of Issue

  • [ x] Bug
  • Enhancement
  • Compliance
  • Question
  • Help wanted

Describe the Issue

We have a business requirement to set up a OPC UA Server that listen to port 443 on an Ubuntu box along with Apache. So we added a second network interface, configured Apache to use the first one, and set the OPC UA server to use listen to port 443 on the second NIC. For example,

    <BaseAddresses>
        <ua:String>opc.tcp://54.123.456.789:443/OpcUaServer</ua:String>
    </BaseAddresses>

The problem is that OPC Server ignores the IP address, or host name, and listens to 0.0.0.0:443. This conflicts with Apache.
The Start method in Stack\Opc.Ua.Core\Stack\Tcp\TcpTransportListener.cs does this when creating a socket:

    IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, port);
    m_listeningSocket = new Socket(endpoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

To Reproduce
Steps to reproduce the behavior:

  1. Set up a OPC UA Server on Ubuntu
  2. Change the BaseAddress in its Config.xml to a specific IP address
  3. Start the server
  4. From a terminal, run 'sudo netstat -tulpn | grep LISTEN'
  5. The result shows the OPC UA server is listening to 0.0.0.0:443 and :::443

Expected behavior
The OPC UA server should listen on the specified IP, not IPAddress.Any.

Environment (please complete the following information):

  • OS: Ubuntu 20.04
  • Development environment: Visual Studio 2019 16.11.2
  • Runtime: .NET Core 3.1
  • OPC Package Release Version: 1.4.365.48
  • Component: Opc.Ua.Core
  • Server: Standard Server
@mrsuciu mrsuciu self-assigned this Nov 8, 2021
@mrsuciu
Copy link
Contributor

mrsuciu commented Nov 15, 2021

Yes, binding to a specific interface is a missing feature but will be looked into soon.

mrsuciu added a commit that referenced this issue Nov 17, 2021
… specified instead of a hostname (#1596); should fix issue #1581

* Binding to a specific NIC is implicitly implied when an IP address is specified instead of a hostname; Removed the redundant flag BindToSpecifiedAddress.
@mregen mregen linked a pull request Nov 18, 2021 that will close this issue
@mregen mregen added this to the 1.4.367 milestone Dec 3, 2021
@mregen mregen closed this as completed Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants