2
Good day,
I am attempting to replicate a setup I have between a router and an Ubuntu PC, and have the same setup working on my MacBook (10.6, Snow Leopard).
First, I have a router that has a USB port. When I plug it into my Ubuntu PC, it creates an RNDIS connection, allowing me to connect to the router over the USB cable via an IP connection. When I plug it into my computer via USB, it gets assigned an IP address of 172.16.84.1, and a new adapter appears when I type ifconfig
. I can then SSH into the device via ssh admin@172.16.84.1
.
When I log in to the device, I flush the routes, then create the default route:
admin@localhost> route -f
admin@localhost> route add default 172.16.84.2
Now, in my Ubuntu machine, I use iptables to enable IP masquerading:
root@Valhalla> sudo iptables -t nat -A POSTROUTING -s 172.16.84.2 -j MASQUERADE
Once this is all done, the router has internet access over the USB connection to my PC.
I am trying to replicate this exact setup on my MacBook now (Snow Leopard), but iptables
does not exist for OSX, not even a Macports version exists. I have scoured through other questions on StackOverflow that cover the usage of the ipfw
command, which apparently works as a drop-in replacement for iptables
. However, the syntax is significantly different, and I'm pretty much lost.
Does anyone with some experience with ipfw
have some suggestions on how I could accomplish this and create a NAT connection via IP masquerading like I could with my Ubuntu PC?
Thank you for your assistance.
I'm not familiar with the term "bearded way". What does that mean? I'm looking for a programmatic non-GUI approach. – Cloud – 2012-12-14T15:05:46.480
"bearded" is a joke to say "for real men that has a beard" :-) for the non-GUI approach, you can use the link I gave you. In that link, they even show you how you can set things up using the UI, and then print the rules to be able to replay them later on. – zmo – 2012-12-14T15:51:31.043