Redirect packets -- Ipfw & iptables

Joined
Jul 23, 2010
Messages
3
Reaction score
0
Points
1
Hello,

I'd like to play a MMORPG supposed to be run on windows
I decided to use crossover-games.
I installed the game without any problems. When I attempt a connection to the game server, it's impossible to connect.

I made some searches about this issue, and I learned that the game does not connect to the right address. (iftop is great if you want to monitor your networks data-flows).

I've found a work-around but it's only for iptables.
Here is the iptables chain I have to use.

Code:
iptables -t nat -A OUTPUT -d (FAKE IP ADDRESS) -j DNAT --to (REAL IP ADDRESS)
That means, redirects packets that destination is FAKE IP ADDRESS to REAL IP ADDRESS.

I made some searches about ipfw, MAC OS X firewall and Natd, the routing table. I have not been successful. Natd does redirects only addresses in the local network.

I do not know how to translate the iptables chain above to a rule for ipfw.

Can you help me for this issue?
Thank you.
 
Joined
Sep 30, 2007
Messages
9,962
Reaction score
1,235
Points
113
Location
The Republic of Neptune
Your Mac's Specs
2019 iMac 27"; 2020 M1 MacBook Air; macOS up-to-date... always.
Crossover is very limited in the supported games, and the extent to which they even function. You are much better off looking for help on their forums. Each game in their compatibility database... supported or not... has its own forum where advocates share tips and advice. The solution you need may even be there already.
Compatibility - Browse Applications by Name - CodeWeavers
 
OP
S
Joined
Jul 23, 2010
Messages
3
Reaction score
0
Points
1
I've already checked their forums and this was their workaround. I have to find some way to direct the ip packets from one ip to another.
 
Joined
Jul 25, 2010
Messages
2
Reaction score
0
Points
1
Solution

I've ran into a similar problem on Midgard Chronicles: - the game uses 3 ports, 6900, 6121 and 5121. On Wine in Linux and OS X, the IP address resolves to something bogus. The way I worked around it:

Code:
ipfw add divert natd ip from any to any src-port 5121-6900 
ipfw add divert natd ip from any to any dst-port 5121-6900 
natd -interface en1 -target_address 255.255.255.255 -alias_address 173.203.210.155 -reverse

The first two lines add rules to ipfw to forward packets between ports 5121-6900 to port natd (8668). The last line starts up natd, which translates the destination address in the packets for everything going through it to the IP of the game server.

I don't think this is an elegant way to do it - I just poked around ipfw and natd's man pages for a while. The solution works well enough for me, you may want to pretty it up and stick it in a shell script or something. Good luck! :)
 
OP
S
Joined
Jul 23, 2010
Messages
3
Reaction score
0
Points
1
I tried it and it came up with this.



natd: Unable to bind divert socket.: Address already in use
 
Joined
Jul 25, 2010
Messages
2
Reaction score
0
Points
1
Try:

Code:
killall -9 natd

Forgot that part. That's the nasty bit. I think that'll kill your file sharing, but run this before the natd command.

If you've added the firewall rules twice, use "ipfw list" and "ipfw del" to view & delete the rules respectively. Like "ipfw del 100" would remove rule 00100.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top