LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-10-2005, 02:12 PM   #1
hgb
Member
 
Registered: Jun 2004
Distribution: Mandrake 10, SUSE 10.x, DEbian
Posts: 125

Rep: Reputation: 15
Another time dynamic DNS


I have been reading for thread related to this one, but aparently I dont been able to find a solution... :S.

OK, I have SUSE 10, it have installed Apache2, and I was trying to make virtual host, but I read that they need REAL DNS names from the source that Im following.

I have been experimenting:

In start-> system-> YaST control -> net devices -> NET device (is a ethernet card... perhaps not correct translation):

I have a static IP 192.168.254. 10 (for my PC, say PC1) but I also have added EXTRA IPs for the ethernet card with the option "advanced": 192.168.254. 11, 192.168.254. 12, and 192.168.254. 13, with the respectice alias: a11, a12, a13.

The router have a range of DHCP for dinamic numbers inside the LAN, those previous numbers are outside such range.

In start-> system-> YaST control -> net services -> names of PC (perhaps not correct translation):

I can add names for those new IPs, like once (192.168.254. 11), doce (192.168.254. 12), trece (192.168.254. 13), and if I write in my browser one of them once, doce or trece they work OK. I have other computer here (say PC2), if I try access once, doce or trece from that computer, the pages are not displayed... and that I have understoo that is because PC2 dosent know the names that I have gived in PC1 for thos names, and yes, I can access the direct addresses (192.168.254. 11, 192.168.254. 12, and 192.168.254. 13) from PC2 that are catched(?) in the LAN by the extra IPs assignated to the ethernet card.

NOW If I delete such names in PC1, I cant no longer access those numbers with the names... and that is good (no more name assigned locally to those LAN IPs), is like the behaviour ofPC2 that dosent know or have a name for the IP.




Now, what is the problem if I can access my server from the LAN with direct numbers and with names in the PC1?, the point is that I whant to use selfhost.com for my dynamic DNS and be able to access my PC from outside worl.



Before I will say how I enter to access the configuration page of my router (a speed stream 5200).

I type in my browser: http://192.168.254.254/ (I guess that is the LAN IP of the configuration page inside the router hardware/software), it request login info, I type user and pass, and all is OK.

It is configured like a router.

Tought the two computers PC1 and PC2 that are connected have static IP (LAN) configuration, I have set the router for have a DHCP range for serve if sometime-someday another PC is connected.

Now, I after add, the router in the Current Port Forwarding Configuration have with others:
Code:
 TCP	8080	192.168.254. 10
I also have been in start-> system-> YaST control ->users and security -> firewall and have opened at the external 8080.


I have finded trought a question here this page: http://www.dslwebserver.com/ and I have used the tools there http://www.myserver.org/portsniff.asp

Code:
IRC	Port 7000	Unable to detect server on this port.
	Alt HTTP	Port 8080	Server detected and it is publicly accessible. Your ISP is not blocking port 8080.**
All other ports including the default 80 is blocked.


And that is OK.



However, when I setup my account at selfhost.com, when opening myaccount.selfhost.com, it redirect me to my public address (WAN) and therefore to the configuration page of my router .

If I type myaccount.selfhost.com:8080 (because the default that I guess is where selfhost send the request @80 port), there is a message that say "request connection refused".


Hope you have the idea of what is happening, see that I have the port forward 8080 to 192.168.254. 10 and I also have opened the port in the software firewall of SUSE, also http://www.myserver.org/portsniff.asp is able to say that there is 8080 opened.

From dslwebserver, I have finded other page http://www.dnsstuff.com/ I have made a trace (tought I dont know what exactly is I get the idea), and say me at the end of analysis:


Tought it dont let me enter myaccount.selfhost.com:80 or myaccount.selfhost.com:8080 it will acept myaccount.selfhost.com (see that is not my page.. :P)
Quote:
Analysis:
Number of hops: 17
Last hop responding to ICMP: 12, UDP: 12, TCP: 13.
There appears to be a firewall at MY_PUBLIC_IP (hop 13) that blocks ICMP (ping) packets.
There appears to be a firewall at MY_PUBLIC_IP (hop 13) that blocks unwanted UDP packets.
There appears to be a firewall at (hop 14) that blocks unwanted TCP packets.
MY_PUBLIC_IP is the same IP that I obtain from: http://www.whatismyip.com/



I also put here the output of a little program that I do for dump some etc files (if you whant the dump of other file say me), the code of my little program is at end.

Finala thing, I run apache like: /usr/sbin/apache2ctl -f /apache_start/httpd.conf -k restart Im following this tutorial:http://www-uxsup.csx.cam.ac.uk/~jw35...html/c486.html

Quote:
###############STARTING DUMP OF SOME /etc/ files###############



/--=====[/etc/host.conf]
order hosts, bind
multi on


\--=====[/etc/host.conf]

/--=====[/etc/HOSTNAME]
linux.site

\--=====[/etc/HOSTNAME]

/--=====[/etc/hosts]

127.0.0.1 localhost

::1 localhost ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts

\--=====[/etc/hosts]

/--=====[/etc/hosts.allow]



\--=====[/etc/hosts.allow]

/--=====[/etc/hosts.deny]

http-rman : ALL EXCEPT LOCAL


\--=====[/etc/hosts.deny]

/--=====[/etc/hosts.equiv]


\--=====[/etc/hosts.equiv]

/--=====[/etc/hosts.lpd]


\--=====[/etc/hosts.lpd]

/--=====[/etc/hosts.YaST2save]

127.0.0.1 localhost

::1 localhost ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
192.168.254.10 obp.selfhost.com
192.168.254.11 once
192.168.254.12 doce
192.168.254.13 trece

\--=====[/etc/hosts.YaST2save]



###############STARTING DUMP OF SOME apache CONF ###############



/--=====[/apache_start/httpd.conf]
Listen 8080

User my_user
Group users_users

ServerRoot /apache_start/sites
Options None



NameVirtualHost *

<VirtualHost 192.168.254.10>
ServerName obp.selfhost.com
DocumentRoot /apache_start/sites/uno
</VirtualHost>

<VirtualHost 192.168.254.11>
ServerName once
DocumentRoot /apache_start/sites/uno
</VirtualHost>

<VirtualHost 192.168.254.12>
ServerName doce
DocumentRoot /apache_start/sites/dos
</VirtualHost>

<VirtualHost 192.168.254.13>
ServerName trece
DocumentRoot /apache_start/sites/tres
</VirtualHost>

LoadModule mime_module /usr/lib/apache2-prefork/mod_mime.so
TypesConfig /etc/apache2/mime.types
DefaultType text/plain

\--=====[/apache_start/httpd.conf]
Code:
#include <stdio.h>
#include <string.h>


char *etcDir = "/etc/";
char *etcFiles[] = { "host.conf", "HOSTNAME", "hosts","hosts.allow", "hosts.deny", "hosts.equiv", "hosts.lpd", "hosts.YaST2save", "\0"};

char *apacheConfDir = "/apache_start/";
char *apacheConfFiles[] = {"httpd.conf", "\0"};

#define MAX_BUFFER 1024
int main(int argCount, char *argStringList[]){
	int i=0, lenOfCurDir=0;
	char fString[MAX_BUFFER*2];

	lenOfCurDir= strlen(etcDir);
	system("clear");printf("\n\n\n###############STARTING DUMP OF SOME /etc/ files###############\n\n\n");
	while( strlen(etcFiles[i]) != 0){
		sprintf(fString, "\n/--=====[%s%s]\n", etcDir, etcFiles[i]);
		printf(fString);
		sprintf(fString, "cat %s%s| grep \"#\" -v", etcDir, etcFiles[i]);
		system(fString);
		sprintf(fString, "\n\\--=====[%s%s]\n", etcDir, etcFiles[i]);
		printf(fString);
		i++;
	}

	printf("\n\n\n###############STARTING DUMP OF SOME apache CONF ###############\n\n\n");
	i = 0;
	while( strlen(apacheConfFiles[i]) != 0){
		sprintf(fString, "\n/--=====[%s%s]\n", apacheConfDir, apacheConfFiles[i]);
		printf(fString);
		sprintf(fString, "cat %s%s| grep \"#\" -v", apacheConfDir, apacheConfFiles[i]);
		system(fString);
		sprintf(fString, "\n\\--=====[%s%s]\n", apacheConfDir, apacheConfFiles[i]);
		printf(fString);
		i++;
	}
	return 0;
}
Hope you dont mind about the large post .









I have watched that when myuser.selfhost.com is redirecting me to the public IP if I hit escape in the log form, then here is what Im able to see... and I see that the server is NetPort Software 1.1 wich mean that is the http server of the router... :S, and not Apache or some like that the ones that is answering...

Quote:
HTTP/1.1 200 OK
Server: NetPort Software 1.1
Content-type: text/html
Expires:0

<HTML><SCRIPT>location.href="userfail.htm";</SCRIPT></HTML>





Have a nice day or night.

Last edited by hgb; 11-10-2005 at 03:23 PM.
 
Old 11-10-2005, 04:40 PM   #2
hgb
Member
 
Registered: Jun 2004
Distribution: Mandrake 10, SUSE 10.x, DEbian
Posts: 125

Original Poster
Rep: Reputation: 15
Only the hint that I finded another test see that I have replaced my public IP with whatismyip.com/ ...

http://btfaq.com/natcheck.pl for check my port forwaring configuration (apart from the scan in the previous post).

I only enter my port 8080 and a invalid hash like "askdjfahsdkfjashdfkajsfksdfhsa"
Quote:
Attempting connect to: whatismyip.com/ port 8080
Fail!
The connection was successful but a timeout occured reading or writing the BitTorrent client data.
If I enter 8081 wich is not forwared and added to external firewall..
Quote:
Attempting connect to: whatismyip.com/ port 8081
Fail!
Unable to connect. This likely means you need to adjust your port forwarding configuration, or there is no client running on that port.
If I enter 80 aka the public IP configuration page...
Quote:
Attempting connect to: whatismyip.com/ port 80
Fail!
Unable to connect. This likely means you need to adjust your port forwarding configuration, or there is no client running on that port.
















Here is the output of trace route repacing my ip with xxx

Code:
Hop	T1	T2	T3	Best	Graph	IP	Hostname	Dist	TTL	Ctry	Time
1	1	7	21	0.7 ms 	
 	 
	66.36.240.2 AS0
IANA-RSVD-0	 c-vl102-d1.acc.dca2.hopone.net.	 	255	US	Unknown: 84e0c353
2	1	0	2	0.7 ms [+0ms]	
 	 
	66.36.224.227 AS0
IANA-RSVD-0	 ge5-0.core2.dca2.hopone.net.	 0 miles [+0] 	254	US	Unknown: 84bd773b
3	1	1	1	1.4 ms [+0ms]	
 	 
	66.36.224.34 AS0
IANA-RSVD-0	 ge2-0-241.core1.iad1.hopone.net.	 0 miles [+0] 	253	US	Unknown: 81958dc8
4	10	2	11	2.4 ms [+1ms]	
 	 
	207.228.224.189 AS0
IANA-RSVD-0	 pos5-1.core2.dca1.hopone.net.	 0 miles [+0] 	252	US	Unknown: 81b09b5c
5	3	21	3	3.1 ms [+0ms]	
 	 
	65.207.95.197 AS0
IANA-RSVD-0	 500.pos5-1.gw3.dca8.alter.net.	 0 miles [+0] 	251	US	Unix: 7:22:31.105
6	3	3	3	3.7 ms [+0ms]	
 	 
	152.63.37.30 AS0
IANA-RSVD-0	 0.so-4-0-0.xl1.dca8.alter.net.	 0 miles [+0] 	249	US	Unix: 7:22:31.252
7	61	47	47	46 ms [+43ms]	
 	 
	152.63.99.34 AS0
IANA-RSVD-0	 0.so-4-0-0.xl1.sat1.alter.net.	 0 miles [+0] 	248	US	Unix: 7:22:31.371
8	100	52	46	46 ms [+0ms]	
 	 
	152.63.97.193 AS702
AS702	 210.at-7-0-0.gw3.sat1.alter.net.	 0 miles [+0] 	247	US	Unix: 7:22:31.446
9	79	55	56	55 ms [+8ms]	
 	 
	157.130.132.246 AS0
IANA-RSVD-0	 telmex-gw.customer.alter.net.	 0 miles [+0] 	247	US	Unix: 7:22:28.698
10	76	79	71	71 ms [+16ms]	
 	 
	200.38.209.58 AS4134
CHINANET-BACKBONE	 bb-mex-vallejo-10-pos6-2.uninet.net.mx.	 0 miles [+0] 	246	MX	Unix: 7:22:28.779
11	171	140	133	110 ms [+38ms]	
 	 
	200.38.132.161 AS3132
LACNIC-3132	 inet-mex-centralsanjuan-9-pos9-0.uninet.net.mx.	 0 miles [+0] 	245	MX	Unix: 7:22:28.905
12	305	110	115	110 ms [+0ms]	
 	 
	148.223.241.9 AS0
IANA-RSVD-0	 dsl-mex-sanjuan-5-g0-1-1.uninet-ide.com.mx.	 0 miles [+0] 	237	MX	Unix: 7:22:28.973
13	*	*	252	217 ms [+107ms]	
 	 
	xxx.xxx.xx.xxx AS0
IANA-RSVD-0	 dsl-xxx-xxx-xx-xxx.prod-infinitum.com.mx.	 0 miles [+0] 	10	MX	[Router did not respond]
14	*	*	217	217 ms [+0ms]	
 	 
	xxx.xxx.xx.xxx AS0
IANA-RSVD-0	 
[Reached Destination]dsl-xxx-xxx-xx-xxx.prod-infinitum.com.mx.	 0 miles [+0] 	108	MX	[Router did not respond]
15	 	 	 	 	 	 	 	 	 	 	 
16	 	 	 	 	 	 	 	 	 	 	 
17	 	 	 	 	 	 	 	 	 	 	 
18	 	 	 	 	 	 	 	 	 	 	 
19	 	 	 	 	 	 	 	 	 	 	 
20	 	 	 	 	 	 	 	 	 	 	 

Analysis:
Number of hops: 14
Last hop responding to ICMP: 12, UDP: 12, TCP: 14.
There appears to be a firewall at xxx.xxx.xx.xxx (hop 13) that blocks ICMP (ping) packets.
There appears to be a firewall at xxx.xxx.xx.xxx (hop 13) that blocks unwanted UDP packets.


Hope you can help me, any ideas, hints?

Last edited by hgb; 11-11-2005 at 02:08 AM.
 
Old 11-11-2005, 01:06 PM   #3
hgb
Member
 
Registered: Jun 2004
Distribution: Mandrake 10, SUSE 10.x, DEbian
Posts: 125

Original Poster
Rep: Reputation: 15
I think I found the solution....


http://forum.portforward.com/YaBB.cg...num=1116587665

I have tested my page with babelfish, and return two errores, 403 for the page and after that say the error encountered is 149.

But I also hav tryied with google translation, and like you guess... YES, the page is translated, that mean google can access it, that mean that the forwaring to my local LAN static IP is working, and that Apache2 is running OK.




Waht the problem was???, like in the page i found the solution, probably my router dosent have loopiing

Quote:
And actually- it WILL NOT work this way.



You CAN NOT test a server by trying to log into the EXTERNAL (or “Public”) IP address (the WAN interface) from a computer that is located on the INTERNAL (or “Private”) side of the router.




The router simply WILL NOT pass the connection attempt through from the Local LAN side OUT to the External WAN side of the router, then BACK IN to the Local LAN side, to the server.

This is called a “loopback” and most of the small routers used for home networks don’t have loopback testing implemented.




That is all I guess. You can test your server in that way, because internal is internal, external external, and the router will not route out and then route in , tha is.. it will not loopback.
 
Old 11-11-2005, 05:56 PM   #4
hgb
Member
 
Registered: Jun 2004
Distribution: Mandrake 10, SUSE 10.x, DEbian
Posts: 125

Original Poster
Rep: Reputation: 15
I have done a little PHP script that will allow you to test remotely your site, that mean, you not need ask other persons to watch it, and that you dont need translate your page ...

The default configuration is:

port:8080
host: yourPublicIP (the one you obtain with whatismyip.com/ )
path: /index.html

Code:
<?php
	$path = $_REQUEST['path'];
	$port = $_REQUEST['port'];
	$host = $_REQUEST['host'];
	if (getenv(HTTP_X_FORWARDED_FOR)) {
		$ip = getenv(HTTP_X_FORWARDED_FOR);
	} else {
		$ip = getenv(REMOTE_ADDR);
	}
	if (empty ($path)) $path = "/index.html";
	if (empty ($port)) $port = 8080;
	if( empty ($host)) $host = $ip;


	$fpSock = fsockopen( $host , $port, $errno, $errstr, 5);
	if (!$fpSock) {
		echo "<br /><br /><br /><br />-------------------------<br />
			\n$errstr ($errno)
			<br /><br /><br /><br />-------------------------<br />\n\n";
	} else {
		$out = "GET $path HTTP/1.1\r\n";
		$out .= "Host: $ip\r\n";
		$out .= "Connection: Close\r\n\r\n";

		fwrite($fpSock, $out);
echo "<br /><br /><br /><br />-------------------------<br />\n\n";
		while (!feof($fpSock)) {
			echo fgets($fpSock, 128);
		}
		fclose($fpSock);
	}
?>

I have setup the script at I have setup the script at http://obp.host.sk/getpage.php

You can override the default values, that is the way Im using it for test my own host.

http://obp.host.sk/getpage.php?port=...=google.com.mx


Like I have test, you can also try to connect to a FTP, but that will only cause to hang and wait for the timeout... that mean, you can now test with this script if the internet can seeyour http or ftp .





By the way, the echos of <br />s is because the page there put the banner and I need see the output more clearly without need to close the bannerm they are not necesary.

Last edited by hgb; 11-11-2005 at 05:59 PM.
 
Old 11-12-2005, 12:36 PM   #5
hgb
Member
 
Registered: Jun 2004
Distribution: Mandrake 10, SUSE 10.x, DEbian
Posts: 125

Original Poster
Rep: Reputation: 15
I have watched a little error I forgot replace a "$ip" ocurrence by "$host", here is the correct thing...

By the way, also I delete the ugly br's and add some hr's
Code:
<?php
$path = $_REQUEST['path'];
$port = $_REQUEST['port'];
$host = $_REQUEST['host'];
if (getenv(HTTP_X_FORWARDED_FOR)) {
$ip = getenv(HTTP_X_FORWARDED_FOR);
} else {
$ip = getenv(REMOTE_ADDR);
}
if (empty ($path)) $path = "/index.html";
if (empty ($port)) $port = 8080;
if( empty ($host)) $host = $ip;


$fpSock = fsockopen( $host , $port, $errno, $errstr, 5);
if (!$fpSock) {
echo "<hr />
\n$errstr ($errno)
<hr />\n\n";
} else {
$out = "GET $path HTTP/1.1\r\n";
//$out .= "Host: $ip\r\n";
$out .= "Host: $host\r\n";
$out .= "Connection: Close\r\n\r\n";
echo "<hr />\n\n";
echo $out;
fwrite($fpSock, $out);
echo "<hr />\n\n";
while (!feof($fpSock)) {
echo fgets($fpSock, 128);
}
fclose($fpSock);
}
?>

See how google.com.mx redirect you to www.google.com.mx

http://obp.host.sk/getpage.php?port=...=google.com.mx



The first lines are the REQUEST after the horizontal rule.

What follow is the answer from the server.

Last edited by hgb; 11-12-2005 at 12:41 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic DNS exy123 Linux - Software 1 09-22-2005 01:25 AM
Dynamic IP - DNS? Terra Niux Linux - Newbie 9 12-06-2004 01:39 PM
Dynamic DNS willhawes Mandriva 10 06-21-2004 04:36 AM
Dynamic DNS pyfsapple Linux - Networking 7 05-08-2003 08:05 PM
dynamic DNS linowes Linux - Networking 8 02-21-2003 03:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration