question

RutujaMestri-5056 avatar image
0 Votes"
RutujaMestri-5056 asked LimitlessTechnology-2700 answered

Ip restriction on live streaming ingest url is not working. Can i get a sample example for it?

Hi @XavierPouyat-MSFT,

I have added Ip restriction for ingest and preview url while creating live event as below.

//code for ip address restriction
IPRange allAllowIPRange = new(
name: "AllowAll",
address: "(my ip address on which OBS is installed)",
subnetPrefixLength: 30
);


// Create the LiveEvent input IP access control object
// this will control the IP that the encoder is running on and restrict access to only that encoder IP range.
LiveEventInputAccessControl liveEventInputAccess = new LiveEventInputAccessControl(
ip: new IPAccessControl(
allow: new IPRange[]
{
// re-use the same range here for the sample, but in production you can lock this
// down to the ip range for your on-premises live encoder, laptop, or device that is sending
// the live stream
allAllowIPRange
})
);

             // Create the LiveEvent Preview IP access control object. 
             // This will restrict which clients can view the preview endpoint
             LiveEventPreview liveEventPreview = new LiveEventPreview()
             {
                 AccessControl = new LiveEventPreviewAccessControl(
                 ip: new IPAccessControl(
                 allow: new IPRange[]
                 {
                      // re-use the same range here for the sample, but in production you can lock this to the IPs of your 
                     // devices that would be monitoring the live preview. 
                     allAllowIPRange
                 }))
             };


I used my machine's IP address on which OBS studio was installed. I was able to stream ingest url using my IP address. But in order to check whether it restricts other IP addresses I connected to VPN to change my IP address. Then I tried testing the streaming again by launching the OBS studio and started the streaming ideally it should restrict. Also I tried "start streaming" in OBS from another machine in that case too I was able to view the live streaming ideally it should restrict other IP addresses. I wanted to know whether I am missing any thing. I have even added IP address and subnet prefix length.


I also wanted to know whether I can allow only specific multiple IP addresses instead on IP range?

windows-server
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

XavierPouyat-MSFT avatar image
0 Votes"
XavierPouyat-MSFT answered XavierPouyat-MSFT commented

Hello,

This is surprising. Can you try to setup a subnet of 24 ?
subnetPrefixLength: 24

Are you sure that your VPN connection is used for all the ongoing traffic ? May be your internet traffic still goes through the same IP address ?

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you very much @XavierPouyat-MSFT, it is working by setting subnet prefix length as 24. I have tested it using other machines and used hotspot to change Ip address it is working but it is strange that it is not working when I am connecting to VPN. May I also know the reason why subnet prefix length 30 is not working as i got this value using online tools available on internet.





,

0 Votes 0 ·

You are right, /30 should work too. As you say, there are online calculators. If the error persist, you should open a support ticket in the Azure portal.

1 Vote 1 ·
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hello RutujaMestri,

Try subnetPrefixLength: 24, which will help you out.

For customers migrating from Media Services v2 APIs, the live event entity replaces Channel in v2, and live output replaces the program.

When you create a live event, a primary and secondary input endpoint is created that you can use to send a live signal from a remote encoder. The remote live encoder sends the contribution feed to that input endpoint using either the RTMP or Smooth Streaming (fragmented-MP4) input protocol.

For more ideas on the subject do follow the below link

https://docs.microsoft.com/en-us/azure/media-services/latest/live-event-outputs-concept

Hope this answers all your queries, if not please do repost back.
If an Answer is helpful, please click "Accept Answer" and upvote it : )

Regards,

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.