It would be great if there was a way to share the internet connectivity of a wifi interface with an ethernet interface so that the computer connected to the ethernet interface is able to get internet from the wifi. Now, before you say this isn't possible because current wifi standards don't accept a mac address that hasn't been authenticated, I have been able to do this on windows as well as other people: https://serverfault.com/questions/929081/how-can-i-enable-packet-forwarding-on-windows/929089#929089 https://www.monnit.com/support/know...internet-connection-with-an-ethernet-gateway/ (gui way) to configure interfaces. Note, they are not bridging, that is a separate thing that can be done on Windows, but bridging is not being done in order to do this.
What I gathered that needs to be done is that the host (Freebsd box with wifi and ethernet) needs to be set up as gateway (gateway_enable or net.inet.ip.forwarding=1), the ethernet interface needs to be assigned ip, that assigned ip is set as default gateway on the computer connected to the Freebsd box, NAT needs to be set up on the freebsd box, and mac address needs to be masqueraded or changed, and mac address needs to be changed/masked to the wifi address so that router won't reject connection.
Interfaces:
Freebsd
-wlan (wifi, ip from dhcp, access to router and external)
-re0 (ethernet, static ip 192.168.3.1)
Other machine:
-wlan (crap, wifi can access router (now by default as listed below), but hoping to bypass it)
-re0 (ethernet, static ip 192.168.3.5)
default destination is set to 192.168.3.1 gateway
I have spent most of my time on this trying to work with ipfw and I learned that matching with ip ip4/etc... commands strip the mac header ipfw (8) (PACKET FLOW) although I don't if that is just during command execution or actually modifying the packet so I don't know if mac changes to wireless or some other interface mac. My non-working ipfw.rules is modified from this tutorial: https://www.neelc.org/posts/freebsd-ipfw-nat/:
I don't get a difference with redirect_addr.
Help regarding this would be appreciated.
What I gathered that needs to be done is that the host (Freebsd box with wifi and ethernet) needs to be set up as gateway (gateway_enable or net.inet.ip.forwarding=1), the ethernet interface needs to be assigned ip, that assigned ip is set as default gateway on the computer connected to the Freebsd box, NAT needs to be set up on the freebsd box, and mac address needs to be masqueraded or changed, and mac address needs to be changed/masked to the wifi address so that router won't reject connection.
Interfaces:
Freebsd
-wlan (wifi, ip from dhcp, access to router and external)
-re0 (ethernet, static ip 192.168.3.1)
Other machine:
-wlan (crap, wifi can access router (now by default as listed below), but hoping to bypass it)
-re0 (ethernet, static ip 192.168.3.5)
default destination is set to 192.168.3.1 gateway
I have spent most of my time on this trying to work with ipfw and I learned that matching with ip ip4/etc... commands strip the mac header ipfw (8) (PACKET FLOW) although I don't if that is just during command execution or actually modifying the packet so I don't know if mac changes to wireless or some other interface mac. My non-working ipfw.rules is modified from this tutorial: https://www.neelc.org/posts/freebsd-ipfw-nat/:
Code:
#!/bin/sh
ipfw -q flush
ipfw nat 1 config if re0 if wlan0 #redirect_addr 192.168.3.1,192.168.3.5 192.168.1.41
ipfw add 100 nat 1 log ip4 from any to me in via re0
ipfw add 200 nat 1 log ip4 from 192.168.3.0/24 to any out via re0
ipfw add 300 nat 1 log ip4 from any to me in via wlan0
ipfw add 400 nat 1 log ip4 from 192.168.3.0/24 to any out via wlan0
ipfw add 500 allow log ip from any to any
Help regarding this would be appreciated.