1. When making a thread, please tag your thread accordingly using the menu to the left of the textfield where you name your thread where applicable. Server Advertisements and Mod Releases should be contained to their respective subforums.

Server Help [SOLVED] Can't LAN on linux x64 (mineOS)

Discussion in 'Multiplayer' started by tweedyjm, Aug 5, 2015.

  1. tweedyjm

    tweedyjm Void-Bound Voyager

    system:
    dell PE 2950 (III) dual L5410 32GB ram
    MineOS x64 (turnkey linux; debian wheezy 7) 8GB allocated for whole VM

    I have setup mineOS (20GB VM) on an ESXi 5.5 host
    minecraft works fine, starts, stops, allows connections, I can use the shell and the webgui to see it, and the ESXi console shows it running properly.

    However, when trying to connect to the Starbound server over LAN, I get the "Join failed! Error connecting to: x.x.x.x:21025"
    This happens in the 32bit server and the 64bit
    libraries have been added to run 32bit files in the x64 OS (the code for wheezy 7 in particular according to steam)

    dpkg --add-architecture i386
    apt-get update
    apt-get install lib32gcc1


    "gameServerBind" : "*" is already set in sbboot.config & starbound.config
    I've double checked my ifconfig to confirm that the ip address isn't being contrary (as it works just fine for the MC server)

    I've followed the "How To: Linux Dedicated Server Setup" on r/starbound. I've managed to use an amalgam of the scripts provided in that post to start the server with steam, got 100% download on the SteamCMD and the starbound server itself. Starbound server launches in screen fine and I can see that it doesn't throw world errors, yet I cannot connect over LAN.
    I ran the starbound force update before launching the server, and checked the server log in /giraffe_storage and confirmed its running:

    Server Version 'Beta v. Spirited Giraffe - Update 5' Revision: b121429b907d2919c3f1d5e25303c5bb571ed61a Protocol: 679


    I think I've tried most of the fixes that are suggested within the forums. I'm at a loss on what to try now. I know it looks like a short novel has been provided but I figured I'd provide all details rather than being vague.
     
    Dunto likes this.
  2. Dunto

    Dunto Guest

    Post a copy of you server's log (starbound's log). The line you posted above doesn't mean anything other than the version, you'll see that long before it's ready to accept connections.

    Do you have any entries in iptables? ("iptables -L -v").
     
  3. tweedyjm

    tweedyjm Void-Bound Voyager

    intentionally blank for getting to "link posting" quota[DOUBLEPOST=1438753413][/DOUBLEPOST]another intentional blank for quota[DOUBLEPOST=1438753612][/DOUBLEPOST]


    Start logging at: 2015-08-04 04:56:26.550
    [04:56:26.550] Info: Star::Root using bootstrap file '/home/starbound/server/linux64/sbboot.config'
    [04:56:26.550] Info: Star::Root using storage directory '/home/starbound/server/giraffe_storage'
    [04:56:26.550] Info: Preparing Star::Root...
    [04:56:26.551] Info: Loading Configuration with config file: 'starbound.config'
    [04:56:26.551] Info: Creating default Star::Configuration
    [04:56:26.551] Info: Writing Star::Configuration to './../giraffe_storage/starbound.config'
    [04:56:26.552] Info: Initializing Star::Root with 2 assets sources
    [04:56:26.552] Info: Done preparing Star::Root.
    [04:56:26.552] Info: Fully loading Star::Root...
    [04:56:26.553] Info: Loading Assets
    [04:56:26.553] Info: Loading Star::Assets from: '../assets/packed.pak'
    [04:56:26.553] Info: Loading Star::Assets from: '../assets/user'
    [04:56:26.555] Info: Loading NameGenerator
    [04:56:26.555] Info: Loading ObjectDatabase
    [04:56:26.555] Info: Loading PlantDatabase
    [04:56:26.555] Info: Loading ProjectileDatabase
    [04:56:26.555] Info: Loading MonsterDatabase
    [04:56:26.555] Info: Loading NpcDatabase
    [04:56:26.555] Info: Loading PlayerFactory
    [04:56:26.898] Info: Done loading Assets
    [04:56:26.935] Info: Loading EntityFactory
    [04:56:27.028] Info: Done loading NameGenerator
    [04:56:27.029] Info: Loading ItemDatabase
    [04:56:27.036] Info: Done loading PlayerFactory
    [04:56:27.037] Info: Loading MaterialDatabase
    [04:56:27.037] Info: Loading ParticleDatabase
    [04:56:27.716] Info: Done loading ParticleDatabase
    [04:56:28.305] Info: Done loading PlantDatabase
    [04:56:28.330] Info: Loading TerrainDatabase
    [04:56:28.516] Info: Done loading TerrainDatabase
    [04:56:28.535] Info: Loading BiomeDatabase
    [04:56:28.624] Info: Done loading NpcDatabase
    [04:56:28.625] Info: Loading LiquidsDatabase
    [04:56:29.540] Info: Done loading ProjectileDatabase
    [04:56:29.541] Info: Loading StatusEffectDatabase
    [04:56:29.580] Info: Done loading BiomeDatabase
    [04:56:29.581] Info: Loading DamageDatabase
    [04:56:29.694] Info: Done loading StatusEffectDatabase
    [04:56:29.719] Info: Loading EffectSourceDatabase
    [04:56:29.925] Info: Done loading EffectSourceDatabase
    [04:56:29.925] Info: Loading FunctionDatabase
    [04:56:29.942] Info: Done loading FunctionDatabase
    [04:56:29.971] Info: Loading TreasureDatabase
    [04:56:30.415] Info: Done loading TreasureDatabase
    [04:56:30.415] Info: Loading DungeonDefinitions
    [04:56:30.848] Info: Done loading MaterialDatabase
    [04:56:30.857] Info: Loading EmoteProcessor
    [04:56:30.874] Info: Done loading ObjectDatabase
    [04:56:30.874] Info: Loading SpeciesDatabase
    [04:56:30.883] Info: Done loading LiquidsDatabase
    [04:56:30.883] Info: Loading ImageMetadataDatabase
    [04:56:30.883] Info: Done loading ImageMetadataDatabase
    [04:56:30.883] Info: Loading VersioningDatabase
    [04:56:30.914] Info: Done loading VersioningDatabase
    [04:56:30.915] Info: Loading QuestTemplateDatabase
    [04:56:30.921] Info: Done loading EmoteProcessor
    [04:56:30.922] Info: Loading AiDatabase
    [04:56:30.985] Info: Done loading SpeciesDatabase
    [04:56:31.000] Info: Loading TechDatabase
    [04:56:31.052] Info: Done loading TechDatabase
    [04:56:31.053] Info: Loading CodexDatabase
    [04:56:31.055] Info: Done loading QuestTemplateDatabase
    [04:56:31.078] Info: Done loading AiDatabase
    [04:56:31.091] Info: Done loading DamageDatabase
    [04:56:31.150] Info: Done loading MonsterDatabase
    [04:56:31.167] Info: Done loading EntityFactory
    [04:56:31.243] Info: Done loading CodexDatabase
    [04:56:49.348] Info: Done loading ItemDatabase
    [04:56:55.247] Info: Done loading DungeonDefinitions
    [04:56:55.322] Info: Done fully loading Star::Root
    [04:56:55.323] Info: Server Version 'Beta v. Spirited Giraffe - Update 5' Revision: b121429b907d2919c3f1d5e25303c5bb571ed61a Protocol: 679
    [04:56:55.323] Info: Scanning for router for portforwarding
    [04:56:55.323] Info: Done scanning for router for portforwarding
    [04:56:55.323] Info: UniverseServer: Creating universe storage directory
    [04:56:55.325] Info: UniverseServer: Acquiring universe lock file
    [04:56:55.415] Info: UniverseServer: Loading settings
    [04:56:55.415] Info: UniverseServer: Finding starter world
    [04:57:05.584] Info: UniverseServer: Creating celestial world -602146445:-447619405:-180003583:7:5
    [04:57:05.932] Info: Placing dungeon naturalcave
    [04:57:05.932] Info: Generating dungeon naturalcave (NOT FORCED)
    [04:57:05.939] Info: Placing dungeon at (417, 900)
    [04:57:06.844] Warn: Failed to place dungeon object: prisongirderv direction: 1 position: (471, 860)
    [04:57:08.689] Info: UniverseServer: Starting UniverseServer with UUID: 48ddd04401f7489d6b3a8014ae132dd1
    [04:57:18.700] Info: UniverseServer: Stopping world CelestialWorld:-602146445:-447619405:-180003583:7:5 due to inactivity
    [04:57:18.800] Info: UniverseServer: World thread has stopped due to inactivity, removing world CelestialWorld:-602146445:-447619405:-180003583:7:5
    starbound@core server/giraffe_storage$



    As far as setting iptable rules, I haven't done that. I followed the "how to" on r/starbound pretty closely and am at a loss.
     
    Dunto likes this.
  4. Dunto

    Dunto Guest

    Everything in your log looks OK. Post a copy of your starbound.config (remove passwords as needed).

    Do you mean you have no rules whatsoever or that you haven't added a rule for Starbound to your existing chain(s)? No rules means all traffic can pass, not adding a rule to an existing chain is likely to block you out.
     
  5. tweedyjm

    tweedyjm Void-Bound Voyager


    starbound@core server/giraffe_storage$ cat starbound.config
    {
    "allowAdminCommands" : true,
    "allowAdminCommandsFromAnyone" : false,
    "allowAnonymousConnections" : true,
    "anonymousConnectionsAreAdmin" : false,
    "audioChannelSeparation" : [ -25, 25 ],
    "audioChannels" : 2,
    "bannedIPs" : [ ],
    "bannedUuids" : [ ],
    "bindings" : {
    "CameraShift" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "RCtrl"
    }, {
    "mods" : [ ],
    "type" : "key",
    "value" : "LCtrl"
    } ],
    "ChatBegin" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Return"
    } ],
    "ChatBeginCommand" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "/"
    } ],
    "ChatNextLine" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Down"
    } ],
    "ChatPageDown" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "PageDown"
    } ],
    "ChatPageUp" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "PageUp"
    } ],
    "ChatPreviousLine" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Up"
    } ],
    "ChatSendLine" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Return"
    } ],
    "ChatStop" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Esc"
    } ],
    "CinematicNext" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Right"
    }, {
    "mods" : [ ],
    "type" : "key",
    "value" : "Return"
    } ],
    "CinematicSkip" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Esc"
    } ],
    "CockpitDown" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "S"
    }, {
    "mods" : [ ],
    "type" : "key",
    "value" : "Down"
    } ],
    "CockpitLeft" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Left"
    }, {
    "mods" : [ ],
    "type" : "key",
    "value" : "A"
    } ],
    "CockpitRight" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Right"
    }, {
    "mods" : [ ],
    "type" : "key",
    "value" : "D"
    } ],
    "CockpitUp" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "W"
    }, {
    "mods" : [ ],
    "type" : "key",
    "value" : "Up"
    } ],
    "EmoteAnnoyed" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Right"
    } ],
    "EmoteBlabbering" : [ {
    "mods" : [ "LCtrl", "LShift" ],
    "type" : "key",
    "value" : "Right"
    } ],
    "EmoteBlink" : [ {
    "mods" : [ "LCtrl" ],
    "type" : "key",
    "value" : "Up"
    } ],
    "EmoteEat" : [ {
    "mods" : [ "LCtrl", "LShift" ],
    "type" : "key",
    "value" : "Down"
    } ],
    "EmoteHappy" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Up"
    } ],
    "EmoteLaugh" : [ {
    "mods" : [ "LCtrl" ],
    "type" : "key",
    "value" : "Left"
    } ],
    "EmoteNeutral" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Left"
    } ],
    "EmoteOh" : [ {
    "mods" : [ "LCtrl" ],
    "type" : "key",
    "value" : "Right"
    } ],
    "EmoteOooh" : [ {
    "mods" : [ "LCtrl" ],
    "type" : "key",
    "value" : "Down"
    } ],
    "EmoteSad" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Down"
    } ],
    "EmoteShouting" : [ {
    "mods" : [ "LCtrl", "LAlt" ],
    "type" : "key",
    "value" : "Up"
    } ],
    "EmoteSleep" : [ {
    "mods" : [ "LCtrl", "LShift" ],
    "type" : "key",
    "value" : "Left"
    } ],
    "EmoteWink" : [ {
    "mods" : [ "LCtrl", "LShift" ],
    "type" : "key",
    "value" : "Up"
    } ],
    "EssentialBar1" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "R"
    } ],
    "EssentialBar2" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "T"
    } ],
    "EssentialBar3" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Y"
    } ],
    "GuiClose" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Esc"
    } ],
    "GuiShifting" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "RShift"
    }, {
    "mods" : [ ],
    "type" : "key",
    "value" : "LShift"
    } ],
    "InterfaceBar1" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "1"
    } ],
    "InterfaceBar10" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "0"
    } ],
    "InterfaceBar2" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "2"
    } ],
    "InterfaceBar3" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "3"
    } ],
    "InterfaceBar4" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "4"
    } ],
    "InterfaceBar5" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "5"
    } ],
    "InterfaceBar6" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "6"
    } ],
    "InterfaceBar7" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "7"
    } ],
    "InterfaceBar8" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "8"
    } ],
    "InterfaceBar9" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "9"
    } ],
    "InterfaceBarNPos" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "-"
    }, {
    "mods" : [ ],
    "type" : "key",
    "value" : "`"
    } ],
    "InterfaceCodex" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "L"
    } ],
    "InterfaceCrafting" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "C"
    } ],
    "InterfaceDeselectHands" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "X"
    } ],
    "InterfaceEscapeMenu" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Esc"
    } ],
    "InterfaceHideHud" : [ {
    "mods" : [ "LAlt" ],
    "type" : "key",
    "value" : "Z"
    } ],
    "InterfaceInspectCursor" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "N"
    } ],
    "InterfaceInventory" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "I"
    } ],
    "InterfaceQuest" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "J"
    } ],
    "InterfaceRepeatCommand" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "P"
    } ],
    "InterfaceShowHelp" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "F1"
    } ],
    "InterfaceSwapHands" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Z"
    } ],
    "InterfaceToggleFullscreen" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "F11"
    } ],
    "KeybindingCancel" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Esc"
    } ],
    "KeybindingClear" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Del"
    }, {
    "mods" : [ ],
    "type" : "key",
    "value" : "Backspace"
    } ],
    "PlayerDown" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "S"
    } ],
    "PlayerDropItem" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Q"
    } ],
    "PlayerInteract" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "E"
    } ],
    "PlayerJump" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Space"
    } ],
    "PlayerLeft" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "A"
    } ],
    "PlayerRight" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "D"
    } ],
    "PlayerShifting" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "RShift"
    }, {
    "mods" : [ ],
    "type" : "key",
    "value" : "LShift"
    } ],
    "PlayerTechAction1" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "F"
    } ],
    "PlayerTechAction2" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "G"
    } ],
    "PlayerTechAction3" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "H"
    } ],
    "PlayerUp" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "W"
    } ],
    "ShowLabels" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "RAlt"
    }, {
    "mods" : [ ],
    "type" : "key",
    "value" : "LAlt"
    } ],
    "TitleBack" : [ {
    "mods" : [ ],
    "type" : "key",
    "value" : "Esc"
    } ]
    },
    "checkAssetsDigest" : false,
    "clearPlayerFiles" : false,
    "clearUniverseFiles" : false,
    "configurationVersion" : 420,
    "crafting.filterHaveMaterials" : false,
    "fullscreen" : false,
    "fullscreenResolution" : [ 1920, 1080 ],
    "gameServerBind" : "*",
    "gameServerPort" : 21025,
    "maxFrameSkip" : 10,
    "maxPlayers" : 8,
    "maximized" : true,
    "maximizedResolution" : [ 1000, 600 ],
    "musicVol" : 100,
    "playerBackupFileCount" : 3,
    "queryServerBind" : "*",
    "queryServerPort" : 21025,
    "rconServerBind" : "*",
    "rconServerPassword" : "",
    "rconServerPort" : 21026,
    "rconServerTimeout" : 1000,
    "renderSleep" : true,
    "runQueryServer" : false,
    "runRconServer" : false,
    "sampleRate" : 44100,
    "serverName" : "A Starbound Server",
    "serverUsers" : {
    },
    "sfxVol" : 100,
    "speechBubbles" : true,
    "title.connectionString" : "",
    "upnpPortForwarding" : true,
    "vsync" : true,
    "windowTitle" : "Starbound - Beta",
    "windowedResolution" : [ 1000, 600 ],
    "zoomLevel" : 3
    }starbound@core server/giraffe_storage$



    I have not done anything with/to iptable at all. is there something you want me to try?
     
    Dunto likes this.
  6. Dunto

    Dunto Guest

    Looks fine to me. At this point we're down to checking network configuration(s). I assume you checked that you can ping the server IP from the client? If you have netcat installed on the client, you can try connecting with that ("nc <server_ip> 21025"). You should see your connection attempt on the server console and netcat should spit out a couple of symbols (the server's initial message to the client) if everything is working right with the network and server.
     
  7. tweedyjm

    tweedyjm Void-Bound Voyager

    i'm ashamed to admit, that I had not pinged from this machine or others to the mineOS server.
    I guess I just assumed that because I could get onto the minecraft server from a minecraft client that I was connecting.
    I've just pinged from this machine and a linuxmint desktop and it cannot reach the mineOS, however, the mineos can ping everyone else.
    also, i can sftp to the mineOS. just cannot ping. what is happening here?[DOUBLEPOST=1438791227][/DOUBLEPOST]i think i've just worked out the problem in my head. is it likely that mineOS by default locks down all ports not essential to running a minecraft server. and the reason i can ping from mineOS but cannot ping TO mineOS is because those ports are closed, does this sound about right?



    starbound@core server/giraffe_storage$ netstat -a
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State
    tcp 0 0 localhost:mysql *:* LISTEN
    tcp 0 0 *:netbios-ssn *:* LISTEN
    tcp 0 0 *:http-alt *:* LISTEN
    tcp 0 0 *:ssh *:* LISTEN
    tcp 0 0 *:microsoft-ds *:* LISTEN
    tcp 0 0 *:12320 *:* LISTEN
    tcp 0 0 *:21025 *:* LISTEN
    tcp 0 0 *:12321 *:* LISTEN
    tcp 0 64 192.168.1.129:ssh 192.168.1.108:53969 ESTABLISHED
    tcp 0 0 192.168.1.129:12320 192.168.1.108:53962 ESTABLISHED
    tcp 0 0 192.168.1.129:ssh 192.168.1.108:54422 ESTABLISHED
    tcp6 0 0 [::]:netbios-ssn [::]:* LISTEN
    tcp6 0 0 [::]:ssh [::]:* LISTEN
    tcp6 0 0 [::]:25565 [::]:* LISTEN
    tcp6 0 0 [::]:microsoft-ds [::]:* LISTEN
    udp 0 0 *:12321 *:*
    udp 0 0 192.168.1.25:netbios-ns *:*
    udp 0 0 192.168.1.12:netbios-ns *:*
    udp 0 0 *:netbios-ns *:*
    udp 0 0 192.168.1.2:netbios-dgm *:*
    udp 0 0 192.168.1.1:netbios-dgm *:*
    udp 0 0 *:netbios-dgm *:*
    Active UNIX domain sockets (servers and established)
    Proto RefCnt Flags Type State I-Node Path
    unix 2 [ ACC ] STREAM LISTENING 5403 /var/run/acpid.socket
    unix 2 [ ACC ] STREAM LISTENING 5795 /var/run/mysqld/mysqld.sock
    unix 8 [ ] DGRAM 5338 /dev/log
    unix 2 [ ACC ] SEQPACKET LISTENING 3299 /run/udev/control
    unix 2 [ ACC ] STREAM LISTENING 5366 /var/run/samba/unexpected
    unix 3 [ ] STREAM CONNECTED 41777
    unix 3 [ ] STREAM CONNECTED 41776
    unix 2 [ ] DGRAM 41752
    unix 2 [ ] STREAM CONNECTED 40547
    unix 3 [ ] STREAM CONNECTED 6826
    unix 3 [ ] STREAM CONNECTED 6825
    unix 2 [ ] DGRAM 6803
    unix 2 [ ] DGRAM 6578
    unix 2 [ ] STREAM CONNECTED 6508
    unix 2 [ ] DGRAM 6286
    unix 3 [ ] STREAM CONNECTED 5781
    unix 3 [ ] STREAM CONNECTED 5780
    unix 2 [ ] DGRAM 5715
    unix 2 [ ] DGRAM 5400
    unix 3 [ ] DGRAM 3306
    unix 3 [ ] DGRAM 3305




    root@core ~# iptables -L
    Chain INPUT (policy DROP)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere
    ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
    ACCEPT tcp -- anywhere anywhere tcp dpt:http
    ACCEPT tcp -- anywhere anywhere tcp dpt:http-alt
    ACCEPT tcp -- anywhere anywhere tcp dpt:12320
    ACCEPT tcp -- anywhere anywhere tcp dpt:12321
    ACCEPT tcp -- anywhere anywhere tcp dpt:25565
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
    Chain FORWARD (policy ACCEPT)
    target prot opt source destination
    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination





    I got it to work. Thank you for pointing me in the right direction. here is a list of the iptables edits I made (for future help to others)


    iptables -A INPUT -p tcp -m tcp --dport 21025 -j ACCEPT

    iptables -A INPUT -p tcp -m tcp --dport 7777 -j ACCEPT

    iptables -A INPUT -p icmp --icmp-type 8 -s 0/0 -d 192.168.1.129 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT

    iptables -A OUTPUT -p icmp --icmp-type 0 -s 192.168.1.129 -d 0/0 -m state --state ESTABLISHED,RELATED -j ACCEPT

    iptables -A OUTPUT -p icmp --icmp-type 8 -s 192.168.1.129 -d 0/0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT

    iptables -A INPUT -p icmp --icmp-type 0 -s 0/0 -d 192.168.1.129 -m state --state ESTABLISHED,RELATED -j ACCEPT

    iptables-save > /etc/iptables-rules

    iptables-restore < /etc/iptables-rules


    In my case, the server is currently at 192.168.1.129, so if anyone has problems pinging, you'd substitue my IP address for yours.
     
    Last edited: Aug 5, 2015
    Dunto likes this.
  8. Dunto

    Dunto Guest

    Glad you got it working. :)

    I'd suggest making sure your new iptables rules stick properly after a reboot, normally they don't persist unless you have something like iptables-persistent installed which loads the rules on startup. Note that if it is indeed iptables-persistent (the common one on Debian which you said your distro was based off of), the rules aren't saved on shutdown so you'll have to update your rule lists either manually or by running "dpkg-reconfigure iptables-persistent" to trigger the installation script again which allows you to dump the current rules to the file it loads them from on startup. You could also edit them manually if you wish, I believe they live in /etc/iptables-persistent/ as two rule files (one IPv4 and one IPv6). This assumes the default paths/names though, so if you manually created those /etc/iptables-rules file(s) you'll likely need to update the default files as well.

    (As a side note, the default behavior of iptables is to allow traffic that doesn't match a rule, which is why in most online sample rule chains you'll see a final rule dropping all traffic. I didn't see such a rule in your list so you may want to verify it's dropping unknown traffic properly.)
     
  9. tweedyjm

    tweedyjm Void-Bound Voyager

    Well, nobody is awake or on the server right now, so I restarted it to see what would happen. It looks like my iptables are intact:

    root@core ~# iptables -L
    Chain INPUT (policy DROP)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere
    ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
    ACCEPT tcp -- anywhere anywhere tcp dpt:http
    ACCEPT tcp -- anywhere anywhere tcp dpt:http-alt
    ACCEPT tcp -- anywhere anywhere tcp dpt:12320
    ACCEPT tcp -- anywhere anywhere tcp dpt:12321
    ACCEPT tcp -- anywhere anywhere tcp dpt:25565
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
    ACCEPT tcp -- anywhere anywhere tcp dpt:21025
    ACCEPT tcp -- anywhere anywhere tcp dpt:7777
    ACCEPT icmp -- anywhere 192.168.1.129 icmp echo-request state NEW,RELATED,ESTABLISHED
    ACCEPT icmp -- anywhere 192.168.1.129 icmp echo-reply state RELATED,ESTABLISHED
    Chain FORWARD (policy ACCEPT)
    target prot opt source destination
    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT icmp -- 192.168.1.129 anywhere icmp echo-reply state RELATED,ESTABLISHED
    ACCEPT icmp -- 192.168.1.129 anywhere icmp echo-request state NEW,RELATED,ESTABLISHED

    this is right after the restart. I couldn't ping the server at all before, and now with the icmp protocol in place to echo back and forth. Everything seems to be right as rain.

    Thanks again for getting me to think. I'm a network engineer or at least that's what my schooling and job tell me. I was radically embarrassed when I started thinking about the problem after you said "network issue".
     
    Dunto likes this.
  10. Dunto

    Dunto Guest

    A few things I noticed from your iptables config:
    - You've got an "ACCEPT all -- anywhere anywhere" which will allow all traffic, regardless of the rules below it.
    - "ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED" will match traffic from established connections and will match a lot of your incoming traffic.
    - You don't have a loopback interface rule.

    Obviously #1 could be an issue if you're expecting any kind of filtering to be taking place. #2 and #3 are related to how iptables works; all traffic is checked against the first rule, if it matches then the specified action (ACCEPT, DROP, REJECT, etc) is taken and processing stops there, if it doesn't match that rule it's checked with the next rule down and so on. In order to keep processing time to a minimum for iptables you'll want to place rules that you know will match a large portion of your (legitimate) traffic at the top of the list so that unnecessary checking of rules is avoided. For example, I usually see an order along these lines:
    - Accept all loopback traffic (some programs use local sockets for inter-program communication, like PHP connections to local MySQL server, having this first means you won't waste extra time processing local socket traffic).
    - Drop all INVALID traffic (to stop processing of invalid (possibly spoofed) packets).
    - Accept all RELATED,ESTABLISHED traffic (since the initial NEW has to match another rule for the connection to be successfully initiated, this will match currently open connections).
    - Accept authorized port & protocol connections (since the rule above matches already established connections this would really only match NEW connections but you don't have to specify the NEW state unless you feel like being verbose).
    - Drop all the rest (only if you have the default behavior set to ACCEPT (on a lot of systems I've seen this is the default setting), looks as though yours is set to DROP so this shouldn't be necessary).
    The order is ultimately up to your of course, these are just suggestions.

    Your default OUTPUT chain behavior is ACCEPT, so if you want to filter outbound traffic (technically it's the Right Thing to do, just can be annoying depending on what services you're running and how they need to connect to the outside world) you'll need to either change the default behavior of that chain or add a rule to the end (since the rules are processed in order, obviously you don't want a drop-all rule first as it would match everything and therefore drop everything). Note that if you lock down your outbound chain you won't be able to pull down updates or do much else without adding more rules first (it's quite easy to lock yourself out by accidentally blocking SSH traffic as well, so make sure your changes aren't saved to the startup-loaded files until you test them first, that way you can always reboot to get back to a known-good state).

    There's several good sources of info if you're interested (being a network engineer you have the knowledge to make use of the advanced features), http://www.iptables.info/en/iptables-contents.html seems like a decent reference and I've had good results with the man pages as well (between all of them they cover quite a bit).

    Also, you may want to look into fail2ban. Since iptables changes are loaded and used immediately, you can dynamically alter your firewall through scripts or other methods instantly. Fail2ban makes use of this by monitoring log files for failed login attempts and adding a rule to temporarily drop traffic from their IPs if too many failures are detected (out-of-the-box only monitors SSH, but you can enable sections of the configs to monitor Apache and many other logs, quite configurable). If this is a public-facing server I highly recommend this or something similar to cut down on the hacking attempts (most are usually automated scripts that give up if they can't reach the host, which would be the case if you started dropping their traffic).

    Sorry for all the rambling and sentences within sentences. I hope some of that was clear enough to be helpful. :p
     
    Last edited by a moderator: Aug 7, 2015

Share This Page