Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 28
Hello, Im using CentOS 6 in my computer and i want to have some servers. when i open my server it works in all my computers but only with this ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    May 2012
    Posts
    115

    External IP PROBLEM


    Hello,

    Im using CentOS 6 in my computer and i want to have some servers.

    when i open my server it works in all my computers but only with this ip: 192.168.1.66:25567 but i want my external ip working....


    The ports in the router are open the ifconfig in my linux is this:

    Code:
    [root@localhost joaogl]# ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:26:2D:61:6F:8E  
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
              Interrupt:16 
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:14 errors:0 dropped:0 overruns:0 frame:0
              TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:928 (928.0 b)  TX bytes:928 (928.0 b)
    
    wlan0     Link encap:Ethernet  HWaddr 70:1A:04:40:C3:45  
              inet addr:192.168.1.66  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::721a:4ff:fe40:c345/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:783 errors:0 dropped:0 overruns:0 frame:0
              TX packets:455 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:260660 (254.5 KiB)  TX bytes:114755 (112.0 KiB)
    and my iptables are:


    Code:
    # Generated by iptables-save v1.4.7 on Mon May  7 02:49:01 2012
    *nat
    :PREROUTING ACCEPT [15:1327]
    :POSTROUTING ACCEPT [15:1327]
    :OUTPUT ACCEPT [0:0]
    -A PREROUTING -i eth0 -p udp -m udp --dport 6112 -j DNAT --to-destination 192.168.1.66:6112
    -A PREROUTING -i eth0 -p tcp -m tcp --dport 6112 -j DNAT --to-destination 192.168.1.66:6112
    -A POSTROUTING -o eth0 -j MASQUERADE
    COMMIT
    *filter
    :INPUT ACCEPT [308:24483]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [0:0]
    -A INPUT -s 192.168.1.66 -j ACCEPT
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 31222 -j ACCEPT
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 25567 -j ACCEPT
    -A INPUT -p udp -m state --state NEW -m udp --dport 25567 -j ACCEPT
    -A INPUT -p udp -m state --state NEW -m udp --dport 25566 -j ACCEPT
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 25566 -j ACCEPT
    -A INPUT -i eth0 -p udp -m state --state NEW -m udp --dport 9987 -j ACCEPT
    -A INPUT -i eth0 -p tcp -m state --state NEW -m tcp --dport 9987 -j ACCEPT
    -A INPUT -p udp -m state --state NEW -m udp --dport 9987 -j ACCEPT
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 9987 -j ACCEPT
    -A INPUT -i lo -p udp -m state --state NEW -m udp --dport 9987 -j ACCEPT
    -A INPUT -i lo -p tcp -m state --state NEW -m tcp --dport 9987 -j ACCEPT
    -A INPUT -i eth0 -p udp -m state --state NEW -m udp --dport 9987 -j ACCEPT
    -A INPUT -i eth0 -p tcp -m state --state NEW -m tcp --dport 9987 -j ACCEPT
    -A INPUT -p udp -m state --state NEW -m udp --dport 30033 -j ACCEPT
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 30033 -j ACCEPT
    -A INPUT -p udp -m state --state NEW -m udp --dport 10011 -j ACCEPT
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 10011 -j ACCEPT
    -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
    -A FORWARD -i eth0 -o eth0 -j ACCEPT
    -A FORWARD -d 192.168.1.66 -i wlan0 -p tcp -m tcp --dport 6112 -j ACCEPT
    -A FORWARD -d 192.168.1.66 -i wlan0 -p udp -m udp --dport 6112 -j ACCEPT
    COMMIT
    # Completed on Mon May  7 02:49:01 2012
    what is wrong here?.....


    I just want to open the ports(25567, 9987, etc...) but i dont know why they doesnt work........ THey are working but only on EtherNet... I dont know why.....

    Is like:

    I can use 192.168.1.66:25567 but on 85.246.12.1:25567 it doesnt

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    is your CentOS 6 computer behind a wireless router that is providing your internet access (via Verizon or some other ISP)?

    if so, you have to enable the port-forwarding on that device, so that external requests inbound (on port 25567, for example) can get passed thru to the NATted private ip address (192.168.1.66, e.g.).

    hopefully, you have the login rights to the device, in order to make these changes. how to do port forwarding, etc. should be documented in the manual of the device, or you should be able to figure it out. if you give us the model of the router, we can try to help you look it up, too.

  3. #3
    Linux Newbie
    Join Date
    May 2012
    Posts
    115
    my router is THOMSON TG784 but i thin the ports are correctly opended there... becouse my other computer serever are working and i just opened the ports for linux the same way....

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by Joaogl View Post
    my other computer serever are working and i just opened the ports for linux the same way....
    I don't understand that, can you explain in more detail what is working?

    Anyway, download the Setup and User Guide TG784 for your language at the THOMSON/Technicolor website. Look at section 7.2, "Assigning a service to a Computer". It is also known as port-forwarding. Have you done this yet?

  5. #5
    Linux Newbie
    Join Date
    May 2012
    Posts
    115
    ~I have a lot of computers here..
    My computer(Windows) the servers are working....
    My Linux(CentOS6) have all the servers but doesnt work....

    Problem:

    I can use the internal ip to enter on the server but for example if you want to enter on the server you have to use external ip wich is not working...


    Router:

    I have All the ports open there. i think the problem is in the linux and not in the router becouse linux i dont know how to use yet but the router i know..

  6. #6
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by Joaogl View Post
    I can use the internal ip to enter on the server but for example if you want to enter on the server you have to use external ip wich is not working...
    Okay, you are saying your Linux box is running some service on some port, and you want to access that service from other machines on the internet, is that right? If you are behind a wireless router running NAT (network address translation, which provides multiple privately addresses machines the ability to share a single public IP address) then you must use port forwarding.

    You are saying that your Windows servers are working: does this mean that you have some service listening on some port on the Windows box that is accessible from the internet? If so, what service/port? and did you have to do anything on the router to allow it?

    You keep saying that the ports on the router are all open. I think that is unlikely. Even if all ports were open, they would still need to point to some internal server port, or else a service on the router itself would be listening on that port.

    As a test, try to nmap your public ip address and see what ports you see. First make sure it is your public ip address (you don't want to piss off some other person). you can get it from checkip.dyndns.org. then do:

    Code:
    nmap -n <public_ip_address>
    that will scan the internet-facing, public ip address of your router.

  7. #7
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Can yoi give us a network diagram so we can see how you are connected? This would help a lot. also if you are using interface eth0 from your paste above it doesn't have an ip address.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  8. #8
    Linux Newbie
    Join Date
    May 2012
    Posts
    115
    Ok lets do it


    First both computers are connected via Wirless router is THOMSON TG784.

    Ports on the linux open in the router:

    Code:
    UDP 22
    UDP 25567
    TCP 22
    TCP 25567
    25567 - Minecraft Server
    22 - SSH

    Ports on the Windows open in the router:

    Code:
    TCP	25565
    UDP	25565
    25565 - Minecraft Server

    Now if i open Minecraft server on the two computers this is what will happen:

    I sent the ip 85.245.83.31:25565 and 85.245.83.31:25567 to one friend.
    The first one(Windows) works but the second(Linux) doesnt...

    But if i do 192.168.1.66:25565 and 192.168.1.66:25567 it works but only for me...



    My iptables has you can see on the first post:


    Code:
    -A INPUT -m state --state NEW -n tcp -p tcp --dport 22 -j ACCEPT
    -A INPUT -m state --state NEW -n udp -p udp --dport 22 -j ACCEPT
    -A INPUT -m state --state NEW -n tcp -p tcp --dport 25567 -j ACCEPT
    -A INPUT -m state --state NEW -n udp -p udp --dport 25567 -j 
     ACCEPT

    And when i put:

    Code:
    nmap -n 85.245.83.31
    it says

    Code:
    Starting Nmap 5.21 ( http://nmap.org ) at 2012-05-26 11:02 WEST
    Nmap scan report for 85.245.83.31
    Host is up (0.0079s latency).
    Not show: 994 filtred ports
    PORT      STATE  SERVICE
    21/tcp     open     ftp
    23/tcp     open     telnet
    80/tcp     open     http
    443/tcp    open    https
    1723/tcp  open     pptp
    8000/tcp  open     http-alt
    
    Nmap done: 1 IP address (1 host up) scanned in 4.50 seconds
    Its all i think...

  9. #9
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Try scanning the MC ports specifically:
    Code:
    nmap -p 25565,25567 <public_ip_address>
    I would also try disabling iptables on your Linux box temporarily, until you are sure the requests are getting thru your router.

  10. #10
    Linux Newbie
    Join Date
    May 2012
    Posts
    115
    Code:
    [root@localhost joaogl]# nmap -p 25565,25567 85.245.83.31
    
    Starting Nmap 5.21 ( http://nmap.org ) at 2012-05-26 22:12 WEST
    Nmap scan report for dsldevice.lan (85.245.83.31)
    Host is up (0.0032s latency).
    PORT      STATE    SERVICE
    25565/tcp open     unknown
    25567/tcp filtered unknown
    
    Nmap done: 1 IP address (1 host up) scanned in 1.34 seconds
    [root@localhost joaogl]#

Page 1 of 3 1 2 3 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •