# iptables port forwarding to a PS3 [unneeded]

## jonnevers

I've been using Gentoo on my server for years, doing NAT and all sorts of wonderful things. its a machine of beauty actually and gentoo provides exactly the kind of control i need over it.

then i got my PS3 and this game called GRID, which has online play. the problem is GRID disconnects a lot (I mean a lot, can't even get into an online game most of the time before being disconnected). The manual sez that port 3074 needs to be open and port forwarded to the PS3 for it to work properly. So I've been searching the internet trying to get the proper iptables rules needed to make this game not disconnect... I've had some luck with the rules below but it still disconnects frequently and I wanted to see if the gurus here had suggestions.

```
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 3074 -j DNAT --to 192.168.0.84:3074

iptables -t nat -A PREROUTING -p udp -i eth0 --dport 3074 -j DNAT --to 192.168.0.84:3074

iptables -A FORWARD -i eth0 -o eth1 -p tcp --dport 3074 -j ACCEPT

iptables -A FORWARD -i eth0 -o eth1 -p udp --dport 3074 -j ACCEPT
```

so here is the network's topographical layout:

```
{internet} <---> [(eth0: DHCP'd IP address)[Gentoo w/ iptables providing NAT](eth1:192.168.0.1)] <---> [(192.168.0.84)[Playstation3]]
```

Last edited by jonnevers on Thu Jul 31, 2008 12:08 pm; edited 1 time in total

----------

## Hu

That looks reasonable.  Have you checked whether removing those rules makes the behavior worse?

Since the disconnects are so reliable, you could run a packet sniffer like net-analyzer/tcpdump to check if any traffic is arriving that the iptables rules are not forwarding.

----------

## Erulabs

jonnevers:

I have almost exactly the same setup. I had the GRID demo and havn't noticed any dropping (with the online play) quite yet.

I'm running Iptables on Gentoo in the same way. I would say your best bet is what Hu pointed out - monitoring the network while its happening. For the record im not forwarding any ports and do not get dropped out. I also have sustained 5/10% packet loss.

----------

## jonnevers

well, turns out that the disconnects were the result of an overly split cable line. My house was put on its own drop to the wire on the pole and I've only been disconnected once since!

and I flushed my rules (after the line was fixed) and the game continued to play properly online, so the explicit port forwarding doesn't seem to be necessary.

but my rules were working (some of them  :Smile: ):

```
host user # iptables -t nat -L -v

Chain PREROUTING (policy ACCEPT 40583 packets, 4702K bytes)

 pkts bytes target     prot opt in     out     source destination

    0     0 DNAT tcp  --  eth0   any     anywhere anywhere tcp dpt:xbox to:192.168.0.84:3074

  142  8094 DNAT udp  --  eth0   any     anywhere anywhere udp dpt:xbox to:192.168.0.84:3074

Chain FORWARD (policy ACCEPT 1816K packets, 821M bytes)

 pkts bytes target     prot opt in     out     source destination

    0     0 ACCEPT     tcp  --  eth0   eth1    anywhere anywhere   tcp dpt:xbox

 517K   50M ACCEPT     udp  --  eth0   eth1    anywhere anywhere  udp dpt:xbox

    0     0 ACCEPT     tcp  --  eth0   any     anywhere 192.168.0.84  tcp dpt:xbox
```

----------

