2

My ISP provider is charging very high for Static IP for port forwarding. So I decided to disconnect the internet cable connected to ISP router/modem, and connect to Ethernet port of Raspberry Pi4. I would like to convert Raspberry Pi4 as internet router. And make the home network by connecting a USB 3 to RJ45 adapter. Connect the RJ45 adapter to a unmanaged L2switch and Connect home devices like TV, printer etc (network diagram shown below). With this setup I provide static IP for Pi4 and control the traffic into my home network. i.e I can construct my own VPN or NAS etc. Ultimately I do not have to pay for static ip to ISP provider, I do not have to pay for VPN service provider etc. Is it possible.If yes, plz suggest the way. If No, plz suggest how to make it to achieve the Goal.

| internet cable |------->| Pi 4 |....| USB 3 (in Pi4) to RJ45| ----->| L2 switch |--->| printer,TV |

5
  • 2
    I don't understand your need for a static IP or port forwarding unless you are operating, e.g. a public web server from your network. Otherwise, the "outside" address is unimportant since it originates connections, but does not receive unsolicited inputs. Printer, TV, etc. should be very happy with RFC-1918 reserved addresses. Your ISP's router ought to include a DHCP server that will assign those addresses for you. Commented May 2 at 14:35
  • I need to access the resources in my home network from outside. And now a days my data / documents size is getting increased. Hence I have to go for NAS by connecting a hard disk to one of the USB port in Pi 4. For all these, i need to port forward, which is possible only with static IP. Internet provider provides Dynamic IP (PPPoE). Every month charges for static IP is very high. So i am thinking to construct my own router using Pi4 and assign a static IP for the public. I am looking for help to construct Pi as router with the functionalities described above. Commented May 4 at 10:41
  • Did you check this? ionos.com/digitalguide/server/configuration/… Commented May 4 at 12:13
  • @newtonraj OK, you're serving files and perhaps other resources. You don't mention a country or ISP, but I'm in the United States and the router supplied by AT&T explicitly provides for port forwarding with a dynamic IP address. I use No-IP to provide DNS services for my dynamic IP address. That's all I need. If I needed broader access to services at home, I think I'd look into a VPN concentrator. Commented May 5 at 1:31
  • 1
    In India, Port Forwarding is provided along with Static IP only. It is not provided along with Dynamic IP. By referring some of the Youtube I constructed VPN server with PI4 (using Wireguard), DNS service etc, unfortunately i could not do the last step, i.e port forwarding (51820). Finally VPN didnt work. So I have decided to construct my own router and VPN server using RPi4 Commented May 9 at 7:20

1 Answer 1

0

First, let me say that this seems to be turning out to be a networking question, and so may get closed or moved. Let me try anyway.

Port forwarding and static IP are two separate concepts.

Port forwarding directs incoming packets with specific destination port numbers to a specific inside address. For example, an incoming packet for port 443 could be directed to a web server. Port forwarding needs to happen at the edge device, often a router or gateway provided by your Internet service provider. In the United States at least, most ISP router/gateways provide for port forwarding. If a packet intended for a particular port can't get through that edge device, it will never reach an internal router that may have port forwarding enabled.

You obviously know about static IP since you're paying for one. For others, it is a registered IP address that does not change, and so can be set up in a DNS server. It is the right tool for the job for public servers. However, for access to a home network, where a small delay is acceptable from time to time, a dynamic DNS service is a possible alternative. A service within your network monitors the IP address supplied by your ISP and, when it changes, notifies a dynamic DNS service provider. When your IP address changes, there could be a small delay in propagation of the changed DNS entry. My home network has an address in the ddns.net domain supplied by No-IP. There are other dynamic DNS providers. Most require a small annual payment.

Once you have access to your home network from outside, it is possible to use a Raspberry Pi as a VPN concentrator. You connect from outside to the VPN concentrator and from that point you appear to be on your home network. A search will find information on this.

Dire warning! Opening your home network to outside access can be very dangerous. Protecting it is beyond the scope of this answer and off-topic for the Raspberry Pi community, but I'd be remiss not to include the warning.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.