You get a bonus - 1 coin for daily activity. Now you have 1 coin

Port Forwarding Does Not Work

Practice




I have a network 192.168.1.0

there's a gateway, for example 192.168.1.50

there's a computer with linux 192.168.1.200
it has a specific server program installed with working ports for example 1000 and 1001

inside the local network these ports are listened
but on the internet they are not heard. what is the reason? and how to fix it?

what linux build do you have?

how do I find out the version and build? and what are they in general?)))

the distributions are:
6) OpenSUSE ( www.opensuse.org ) – free distribution, a version of SUSE. Manufacturer – Novell. Large amount of software and convenient installation.

5) Freespire ( www.freespire.org ). Previously known as Lindows. Support for it can be obtained for just $49.95. A convenient distribution for beginners.

4) Slackware ( www.slackware.org ). More of a true Unix than Linux in pure form, for lovers of extremes and settings


3) Fedora Core ( www.fedoraproject.org ). Free version of Red Hat.

2) Mandriva ( www.mandriva.com ). Former Mandrake. Convenient Linux for everyone. Also has paid tech support. Available in a 1-disk version.

1) Ubuntu ( www.ubuntu.com ). Excellent choice.. especially for beginners. Growing popularity, plenty of software and ease of use. Also available on 1 disk.

and how do I find out which distribution I have?

LOOK through MC at the file ets/issue

I don't have that(((

cat /etc/*release* try this to see the distribution version

root@qqqq:/proc/sys/net/ipv4/conf/eth0# cat /etc/*release*

cat: /etc/*release*: No such file or directory

it doesn't work(((

so it's not debians and not ubuntu

then what is it? ::biggrin24.gif::

enter uname -a

root@qqqqq:/proc/sys/net/ipv4# uname -a

Linux qqqqq 2.6.21.5-smp #2 SMP Tue Jun 19 14:58:11 CDT 2007 i686 Intel(R) Celeron(R) CPU

looks like slack
enter lsb_release -a

command not found
::dry.gif::

but the kernel is quite old
enter cat /etc/slackware-version
if it's slack then it will show

slackware 12.0.0

did you try setting up port forwarding on the router (gateway)?

there should be a port forwarding menu
ip port in port out
192.168.1.200 1000 1000
192.168.1.200 1001 1001

yes I added it in the router's advanced menu, but nothing helps

tried telnet 192.168.1.200 1000 - works
tried telnet external.ip 1000 - does NOT work ::cry.gif::

did you call the internet provider? maybe they block some ports?


for example port 25 sometimes to prevent spam mailing
or UDP ports to prevent torrent load
you have TCP ports, right?

yes I called - they say they don't block anything, and TCP?, tried opening on the router to the external internet under different ports - nothing helped((

ip port in port out
192.168.1.200 1000 10
192.168.1.200 1001 11

ip port in port out
192.168.1.200 1000 60000
192.168.1.200 1001 60001

can you look at what the default gateway is on the linux machine?
with the route command?

root@qqqqqq:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 202 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.1.67 UG 202 0 0 eth0

so it turns out to be the wrong gateway?

yes, try changing it

Edit the configuration file /etc/network/interfaces, for example like this:
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.254
auto eth0

I don't have ubuntu, and there is no such file...

aah, right
then like this

route del default
route add gw 192.168.4.4

route- to check

thanks, it works......... but after reboot everything stays as it was(((((((((((((
have to change the gateway ip again

On slack the network settings are stored in the file /etc/rc.d/rc.inet1.conf

IPADDR[0]="192.168.1.200
NETMASK[0]="255.255.255.0
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
GATEWAY="192.168.1.50"

ooooooooo thank you, now everything works as it should ::bb.gif::

by the way, one should distinguish between port forwarding and port redirection)))

forwarding - on the external ip the port is heard from the server located in the local network under a different number

and redirection - under the same one

there are several features of port forwarding and redirection

1. Each subscriber's computer is connected to the provider's equipment without intermediaries. With this scheme, all computers have direct access to the internet and white IP addresses. A subscriber can run any internet servers/services on their computer.
But even with this scheme, the provider can limit the use of the connection's capabilities and the subscriber will only be able to be a client: use websites, download files, play online games, and other client programs.

2. gray ip address (behind the provider's NAT).
With this scheme, subscribers can only be a client: use websites, download files, play online games. It is not possible to run any internet service server on their own computer.
Ranges of gray addresses:

10. 0. 0. 0 - 10. 255.255.255
172. 16. 0. 0 - 172. 31.255.255
192.168. 0. 0 - 192.168.255.255

But still, the subscriber can ask the provider to forward the ports that will be used by the service running on the subscriber's computer.

3. Your NAT. The address is white but you have your own local network with other "gray ip addresses"

in this case the routers belong to the subscribers.

With this scheme, all of the subscriber's computers are combined into a local network and all have access to the internet.

Despite the fact that the computers' addresses fall within the gray ranges, they are no longer gray, since the subscriber has full access to the router and can set up port forwarding.
A NAT router can set up port forwarding: when a connection is made to the router on a specific port, it forwards the packets to one of the machines. Usually ports are forwarded manually, by configuring the router, but there are also mechanisms for automatic port forwarding: UPnP and STUN.
The provider may also impose its own restrictions on the use of the channel

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Diagnostics, maintenance and repair of electronic and radio equipment"

Terms: Diagnostics, maintenance and repair of electronic and radio equipment