How to run server behind firewall?
Moderator: OpenTTD Developers
How to run server behind firewall?
I'm trying to run a dedicated OpenTTD server behind a firewall with NAT. My inside address is 192.168.0.3, and this is the only address which OpenTTD can detect. I *think* it announces this address to the public server list too. Since no one can connect to my local IP, no one can connect to my game.
I've tried to set the IP address to my external address in the cfg-file, but then the server won't start.
I can configure the firewall myself, so opening ports isn't a problem, but I can't turn off NAT.
I've tried to set the IP address to my external address in the cfg-file, but then the server won't start.
I can configure the firewall myself, so opening ports isn't a problem, but I can't turn off NAT.
---
Real mail address: fredrik bob ramsberg.net (but @ instead of bob)
Real mail address: fredrik bob ramsberg.net (but @ instead of bob)
How about port forwarding?
Have you tried port forwarding?
You can open a port on your firewall and then forward it to OTTD server
You can open a port on your firewall and then forward it to OTTD server

4AM? Push forward!!
Did that. The port forwarding works fine.
The problem is that when I launch OpenTTD dedicated server, it detects the server machine's IP address, and since the machine is on a LAN with a firewall and NAT (Network Address Translation), it finds only the machine's local address, which is 192.168.0.3. OpenTTD then advertises the game and tells everybody to connect to 192.168.0.3. Since this isn't my public IP address, no one can connect. So my question is: How can I tell OpenTTD to advertise a different IP address than the one it detects?
The problem is that when I launch OpenTTD dedicated server, it detects the server machine's IP address, and since the machine is on a LAN with a firewall and NAT (Network Address Translation), it finds only the machine's local address, which is 192.168.0.3. OpenTTD then advertises the game and tells everybody to connect to 192.168.0.3. Since this isn't my public IP address, no one can connect. So my question is: How can I tell OpenTTD to advertise a different IP address than the one it detects?
---
Real mail address: fredrik bob ramsberg.net (but @ instead of bob)
Real mail address: fredrik bob ramsberg.net (but @ instead of bob)
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
if you forwarded it correctly it should work. basicly what it does is anything coming in on that port, adressed either to your PC, or to your router, will go directly to your computer. works for me. you'll likely need to farward both the TCP and UDP ports. if you only forward TCP it doesn't work.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
You're right!
The UDP port forwarding was exactly what was missing!
After reading the following in the docs, I was certain I didn't need UDP forwarding:
"OpenTTD has a function which can detect LAN-servers. This is done via UDP. At the moment you select LAN-mode on the server, the server also starts an UDP-listener. When a client on the same LAN presses Find Server in LAN-mode, it sends an UDP-broadcast. This is one of the best things UDP has: broadcast. The server receives it, and sends his game_info back to the client. This way the client can discover a server on the local LAN. This is the only place where UDP is used."
( http://wiki.openttd.org/index.php/Network_Protocol )
Anyway, it's solved now. Thanks a bunch!
The UDP port forwarding was exactly what was missing!
After reading the following in the docs, I was certain I didn't need UDP forwarding:
"OpenTTD has a function which can detect LAN-servers. This is done via UDP. At the moment you select LAN-mode on the server, the server also starts an UDP-listener. When a client on the same LAN presses Find Server in LAN-mode, it sends an UDP-broadcast. This is one of the best things UDP has: broadcast. The server receives it, and sends his game_info back to the client. This way the client can discover a server on the local LAN. This is the only place where UDP is used."
( http://wiki.openttd.org/index.php/Network_Protocol )
Anyway, it's solved now. Thanks a bunch!
---
Real mail address: fredrik bob ramsberg.net (but @ instead of bob)
Real mail address: fredrik bob ramsberg.net (but @ instead of bob)
- lucaspiller
- Tycoon
- Posts: 1228
- Joined: 18 Apr 2004 20:27
You shouldn't need to forward the UDP ports, I dunno really why that has solved anything but heh. The proper way of fixing this would be to set "connect_to_ip" in the config, but for me it has just worked automatically without changing anythng. Ah well, if it works for you don't change it. 

No longer active here, but you can still reach me via email: luca[at]stackednotion[dot]com
I can't quite understand why I have to open up for UDP traffic either, but there is indeed a note about it in the docs:
"What port does OpenTTD use?
the default port is 3979, but you can change it to anything you like when you start a server. If you set up your own server behind a router, you need to forward both TCP and UDP on that port.
communication with the master-server goes via port 3979 over UDP (outbound only) "
( http://wiki.openttd.org/index.php/FAQ_multiplayer )
I had already set connect_to_ip to my public address, and that didn't seem to change anything.
"What port does OpenTTD use?
the default port is 3979, but you can change it to anything you like when you start a server. If you set up your own server behind a router, you need to forward both TCP and UDP on that port.
communication with the master-server goes via port 3979 over UDP (outbound only) "
( http://wiki.openttd.org/index.php/FAQ_multiplayer )
I had already set connect_to_ip to my public address, and that didn't seem to change anything.
---
Real mail address: fredrik bob ramsberg.net (but @ instead of bob)
Real mail address: fredrik bob ramsberg.net (but @ instead of bob)
Who is online
Users browsing this forum: No registered users and 1 guest