[FX-Server][Tutorial] How To Setup FX-Server On Linux - From Start To Finish

Can you provide sudo iptables -nvL to us please ?

Hi I had the same issue yesterday, my solution was to get rid of ufw and use iptables directly instead. For some reason ufw blocked every new allow rule I had made. I reset ufw and iptables then added the rules I had set before, so nothing really changed firewall wise I guess.

I’d rather not show what ports are exposed on my server, but know this. I’m extremely competent when it comes to networking, and I can assure you there are no DROP or REJECT prior to these rules in the chains that would be overriding them.

pkts bytes target     prot opt in     out     source               destination
707 41244 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:30120
263 11517 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:30120

I tried it using the default server.cfg from OP and everything loaded up fine, but same issue. It makes sense that if it’s listening, but nothing is showing in the console and no responses are being sent to the client, that it would be an issue between the server and the internet… let me know if you think of anything else. I’ll keep playing with it.

I did not have rules that denied or rejected the 30120 port. But ufw still blocked it; check https://askubuntu.com/a/541687

“Finally, one of the less friendly aspects of ufw is how the deny rules usually trump allow rules. For example, you cannot set everything to deny and then set ports to allow. All ports will still be blocked.”

I excepted you are using a virtualbox for dev and so it doesn’t matter showing iptables, but if it’s a real server, you’re right !

After, a good way to test is disable ufw and iptables, like this you will know more about, but if it’s a real server, you better shouldn’t doing that. I recommand to install a virtualbox server for developpement :wink:

1 Like

Imgur

Can we agree now that it’s not a firewall issue?

I’m a noob firewall wise on ubuntu, learned yesterday ufw is just a simplified interface to write iptables rules. These rules probably still are effective. I removed ufw, flushed the iptables rules, rewrote them so they blocked everything but some specific ports, opened the port for fivem, and it worked. I did the same as the screenshot you just sent. had the same issue.

I’m not sure too that execute ufw disable, disable iptables too. (i’m using gentoo)

Iptables stays active I think, so you have to flush it and set iptables -P INPUT ACCEPT to really test

Edit : just confirming you NuWa :slight_smile:

That’s like literally what I just said. Am I invisible or some shit?

I understand what ufw is, that is why I like it. I will take your word for it and give it a try. Honestly, I hope I don’t waste a bunch of time doing this for it not to work lol

I use ufw because I am lazy. I can admit that, but this has never been an issue for any other server/service I have hosted.

Anyways I will report back my findings.

I thought that it would be implied that I flushed the chains before testing that. I did. It didn’t change anything.

Try iptables -F then iptables -Z

# ufw disable && iptables -F && iptables -Z
Firewall stopped and disabled on system startup

# iptables -nvL
Chain INPUT (policy ACCEPT 399 packets, 52159 bytes)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain OUTPUT (policy ACCEPT 332 packets, 32497 bytes)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-after-forward (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-after-input (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-after-logging-forward (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-after-logging-input (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-after-logging-output (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-after-output (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-before-forward (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-before-input (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-before-logging-forward (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-before-logging-input (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-before-logging-output (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-before-output (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-reject-forward (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-reject-input (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-reject-output (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-track-forward (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-track-input (0 references)
 pkts bytes target     prot opt in     out     source               destination                                                                                                  

Chain ufw-track-output (0 references)
 pkts bytes target     prot opt in     out     source               destination

Same problem.
You cannot expose a server any more than this configuration. Default ACCEPT, no rules, and DMZ’d. Still nothing.

1 Like

I keep getring this after setup failed to get instance for guid and hangs on “sending heartbeat” any idea why ?

1 Like

I’m having the same exact problem, and so is someone else. It’s not just you and we’re trying to figure out why. Will try to remember to reply you if we figure it out for sure.

1 Like

This,

And this,

Are normal and do not indicate any errors. The server will work fine providing you followed the wiki.

i followed the wiki but the server wont start up

http://imgur.com/I13ufDf

Did you pass the server configuration into the shell script? path/to/run.sh +exec server.cfg

Basically, no matter where your folders are, you should have two folders. One contains the server software (fx-server) and the other contains the configuration and resources (fx-server-data). It doesn’t matter where they are, as long as you KNOW where they are. They are just separated for the purpose of updating the server software without affecting your resources/config.

You could have your server in /server/fivem/fx-server and your resources/config in /home/something/something/darkside/fx-server-data

As long as you go into the data folder, and call the run.sh from the software folder, plugging in the configuration, it should work fine. The example here would look like this:

# /server/fivem/fx-server/run.sh +exec /home/something/something/darkside/fx-server-data/server.cfg

I did follow the wiki. The server doesn’t work fine.

I host several other servers that work fine. I have 15 years of experience doing this. The log shows that the server is running fine. lsof shows the server is listening on the correct ports. The root user is running the server process, so it’s not a permissions issue. I cert-sync’d as requested in step 3 with no issues. I completely disabled the firewall and fully exposed my server and STILL cannot get a query from fx on fivem. I even tried a bone stock server.cfg with nothing but the rcon password changed to something else simple only to protect it. Go back and look at my previous replies, I have covered every inch of what could be happening on my end.

I don’t know what else to do at this point. The server isn’t replying to queries.

1 Like

I unfortunately don’t know how to fix the problem. This might be better suited for someone who has experience with a similar setup to yours. I can’t imagine why it wouldn’t work if you followed all the steps.

Have you considered putting a bug report or posting in the technical difficulties forum? I have it working fine on my stock ubuntu, and others have got it working as well.