unRAID to handle 2 different subnets


Recommended Posts

In setting up pfSense I now have a setup where by which I can run unRAID on potentially 2 different subnets => VPN or clear net.

 

In my go file I have a script which will determine (at boot) what the IP of the router is (based on which port in the router it is plugged into) and set an ip address accordingly. That works fine.

 

e.g. if router IP (e.g. plugged into clear net port) = 192.168.1.1 then set IP 192.168.1.2 OR if router IP (e.g. plugged into VPN port) = 192.168.123.1 then set static IP 192.168.123.2

 

What id like to be able to do though is deal with this when the system is ON so I don't have to reboot it every time I need to switch between clear net and VPN ports.

 

So, does anyone know what script would I have to edit (to include the code I already have in the go file) to capture the change in port while the system is running and set the IP address accordingly.

 

I guess I am looking for the script which runs on this change event (e.g. when I execute rc.inet1 restart OR when the cable is just jacked out of one port and plugged into another) and I can set the unRAID static IP accordingly.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.