Solved Sharing network connection and assigning ips

I am having an issue configuring my home network. I was hoping that others may be able to provide some guidance.

I have a phone that is tethered with USB on eu0 and I get an IP with "dhclient eu0"

I have several systems connected via gigabit switch and I would like to share the internet connection with them via my Ethernet port and assign ips to each.

I have not figured out how to do that part yet. I've found many discussions and topics on this matter however nothing I have found has worked.

Any advice would be appreciated.
 
So what have you got?

A phone.

A gigabit switch with machines plugged into the ports.

One connection out?

No mention of FreeBSD yet - guessing you have one FreeBSD machine and you want to use that?
 
All machines are either on FreeBSD or OpenBSD. I have one machine for the phone, a thin client. 3 desktops, 4 laptops and likely more in the future. Likely many more. But all will be FreeBSD or OpenBSD. The majority are FreeBSD. I have only used OpenBSD when I hit a hardware limitation with FreeBSD.
 
Yes, but (sorry if I'm being dumb) what are you trying to achieve?

Do you want one FreeBSD or OpenBSD machine to be a gateway? So one port on that machine you have your outgoing connection then on another port you are plugged into the switch (along with all the other machines)?

The other machines will go via the switch to your gateway BSD machine out to the internet?

Is that what you mean?

Where does the phone fit into this?
 
Yes that is exactly correct. The phone is an Android phone running tmux with dropbear and I ssh tunnel into the phone on each machine. So the thin client only hosts the phone connection. If I don't have a system between the phone and the network the tunnel doesn't properly route into dropbear.

I would like the gigabit port on the thin client (phone machine) to provide addresses and internet to the other machines connected to the switch.

EDIT: The phone only provides internet. I really don't want to use Linux to do this part of the job. That's how I used to have it set up. I'm trying to replace all my Linux systems with BSD. So I just need BSD to do this job.
 
Does this describe your situation?
Code:
   Y antenna (for phone with cellular mobile data plan)
   |
   |                                 +------+
+-----+         +-------+            |      |----->  Ethernet
|Phone|===USB===|FreeBSD|--Ethernet--|Switch|----->  ports to
+-----+   ue0   +-------+            |      |----->  internal hosts
                                     +------+
If so, the phone is being used in the same way as most cellular mobile Internet appliances (mobile/modem/router). It's an extremely common situation.

[Using terms like "thin client" confuses the discussion. All that matters is whether the machine is physical or virtual and what operating system it runs.]
 
Lovely chart. No, the thin client is a hardware device. I believe it's an HP t610 dual core AMD chip based system. The phone plugs into it's USB port and the gigabit port, on the HP, plugs into the switch. The chart you made is pretty much it. I called the device, hp device, a thin client because that's how it's marketed.

After the switch are all my other systems that need internet.
 
No, it's running FreeBSD. It used to be running Linux but I'm replacing all my Linux with BSD. But I'm having issues having BSD do the job that this little machine was doing with Linux. I was regretfully using a GUI and that required no understanding of networking on my part. So now I'm trying to figure it out and have proven that I have no idea how to set it up.
 
To clarify the HP "thin client" computer is running FreeBSD and is connected to the phone for internet.

I want to share that internet out of the gigabit port, on the HP running FreeBSD.

There are many other machines connected to a switch and that switch is connected to the HP that is connected to the phone.

Phone > HP(FreeBSD) > switch > FreeBSD/OpenBSD systems that need some internet and some IP addresses
 
I'm completely unfamiliar with most of those terms, nat, subnet, ipfw, pf. But I will search them out in the handbook.
 
There's lots of guides out there on how to do a simple bastion host (the "FreeBSD" box in my diagram above). This one looks fairly close to your circumstances.

I have to wonder exactly why you want to use a phone instead of a dedicated cellular mobile appliance designed specifically for the job, such as a Huawei B818.

It's not that I trust appliances. I don't. And I'm not specifically recommending Huawei. But I'm curious as to why you would choose the phone.
 
Setting gateway_enable="yes" in /etc/rc.conf will turn your machine into a gateway/router, i.e. it will then forward packets from one interface to another.

In order to hand out IP addresses to machines on your local network, you need to run a dhcp server. There are various choices like net/isc-dhcp44-server or net/kea.

NAT is built into most if not all available firewalls and is required to translate all your internal network addresses to the single public IP that gets assigned on your internet connection.
 
There's lots of guides out there on how to do a simple bastion host (the "FreeBSD" box in my diagram above). This one looks fairly close to your circumstances.

I have to wonder exactly why you want to use a phone instead of a dedicated cellular mobile appliance designed specifically for the job, such as a Huawei B818.

It's not that I trust appliances. I don't. And I'm not specifically recommending Huawei. But I'm curious as to why you would choose the phone.
The reason for the phone is the unlimited data plan. I use an ssh tunnel but the packets show as coming from a tethered devices even when tunneled unless routed through a host machine first. This, for reasons I don't understand but discovered through trial and error, allows the tunnel to connect my devices and use the phone data rather than tethered data. I don't know if this is necessarily against the providers terms when technically the traffic is coming from an application on the phone, dropbear.

Anyway, that's the reason I'm using a phone. And it's not a current model it's an older model as this method no longer works on recent models.
 
Setting gateway_enable="yes" in /etc/rc.conf will turn your machine into a gateway/router, i.e. it will then forward packets from one interface to another.

In order to hand out IP addresses to machines on your local network, you need to run a dhcp server. There are various choices like net/isc-dhcp44-server or net/kea.

NAT is built into most if not all available firewalls and is required to translate all your internal network addresses to the single public IP that gets assigned on your internet connection.
Thanks I will give these programs a try on my system.
 
The reason for the phone is the unlimited data plan.
I would expect that the SIM card used in the phone is what has the unlimited data plan, and you could use that SIM in any cellular mobile device -- like an appliance designed specifically to be an Internet gateway.
 
I am having an issue configuring my home network. I was hoping that others may be able to provide some guidance.

I have a phone that is tethered with USB on eu0 and I get an IP with "dhclient eu0"

I have several systems connected via gigabit switch and I would like to share the internet connection with them via my Ethernet port and assign ips to each.

I have not figured out how to do that part yet. I've found many discussions and topics on this matter however nothing I have found has worked.

Any advice would be appreciated.
I have a number of systems running FreeBSD and found that I didn't need a fixed broadband connection to have Internet connection on the LAN when I discovered I could provide this using rndis via a phone. I used pfSense as my Internet gateway, defining ue0 as my WAN after enabling USB thethering on the phone. I was amazed at how simple it was. Of course you can do it with basic FreeBSD, but it's a bit more complicated.
 
I would expect that the SIM card used in the phone is what has the unlimited data plan, and you could use that SIM in any cellular mobile device -- like an appliance designed specifically to be an Internet gateway.
Yes it's the sim. But on the phone I am running tmux and dropbear as the ssh server. And tethered connections have a data cap. So I just use data from the phone app that has no data cap.
 
I finally gave up and just hooked everything into a router. But then I found that net/py-shuttle apparently doesn't like going from FreeBSD to Android. It gave me some long error. Long story short I've decided to pay for a dedicated ISP rather than fiddle with this any longer. 😆
 
I tried again and got this setup working again. I decided to use a BeeLink mini pc with Linux to route the network out to the FreeBSD machines. I never figured that part out with FreeBSD. So it's tucked away behind the switch. And for some reason in order to get py39-sshuttle to work I have to manually type in "kldload pf" before I run the script to tunnel into the phone. But, it's working! Finally. I just have to continue figuring out how to replace the little Linux box now. :D
 
Something interesting is happening on the connection now. This is the basic setup (phone running dropbear) --> (computer routing out the internet connection) --> (Switch) --> (Other systems connected to switch). Once I have a system connected to the switch and routed through the tunnel I am able to connect other devices to the wifi hotspot and tunnel into dropbear for internet access. But, if I don't have a system connected with cat cable and tunneled first, I am unable to tunnel over wifi. Very strange. But very cool too. I've never been able to get the wifi to tunnel in. But now I can if I do it in that order. Very strange. lol
 
Back
Top