Change font size
It is currently Thu May 23, 2013 9:03 am

Forum rules


Image



Post a new topicPost a reply Page 1 of 1   [ 6 posts ]
Author Message
 Post subject: Bash script Iptables for LAN sim on grid
PostPosted: Sat Nov 01, 2008 7:40 am 

Joined: Tue Aug 05, 2008 6:06 pm
Posts: 3
this is to get round the problem where you can not login from LAN to a grid-connected region from LAN.
192.168.1.100 is the IP of the server on the lan, the script and viewer was run from another box on the lan this will also work with viewer and server on same box.

Code:

#!/bin/bash

echo -n “Your external IP Address is:

WAN_IP="`wget www.whatismyip.com/automation/n09230945.asp -O - -q`"

echo $WAN_IP

echo  updating iptabs....

iptables -t nat -A OUTPUT --dst $WAN_IP -p tcp --dport 9000:9010 -j DNAT --to-destination 192.168.1.100
iptables -t nat -A OUTPUT --dst $WAN_IP -p udp --dport 9000:9010 -j DNAT --to-destination 192.168.1.100

echo done



Top
 Profile  
 
 Post subject: Re: Bash script Iptables for LAN sim on grid
PostPosted: Sat Jan 31, 2009 7:05 am 

Joined: Sat Jan 31, 2009 7:02 am
Posts: 4
hi, where do I insert this text?


Top
 Profile  
 
 Post subject: Re: Bash script Iptables for LAN sim on grid
PostPosted: Sat Jan 31, 2009 7:08 am 

Joined: Sat Jan 31, 2009 7:02 am
Posts: 4
I have a standalone Opensim, but when i configure the XML file for my external IP for other to access it over the net, i can't connect as I don't have Loopback on my router, would this script help and where do i insert it?

hope you can help

Gary


Top
 Profile  
 
 Post subject: Re: Bash script Iptables for LAN sim on grid
PostPosted: Sun Feb 01, 2009 9:58 am 
Furious Typer

Joined: Sat Jan 17, 2009 11:19 am
Posts: 88
You put this in on your servers SSH Console. You can use a program (thats Free) called Putty to connect to your server then do whatever you need to do to/with the server such as that script he showed ya..

Putty - http://www.chiark.greenend.org.uk/~sgta ... nload.html - Just go for the top one called, Putty.exe unless you have reason to choose otherwise. Put in your servers IP Address and your username and password of the OS when asked and then do the commands/scripts you want to do.

Jordy26


Top
 Profile  
 
 Post subject: Re: Bash script Iptables for LAN sim on grid
PostPosted: Sat May 28, 2011 3:37 am 

Joined: Thu May 26, 2011 6:13 pm
Posts: 6
Location: Aiseirigh, Resurrection
When running the echo, the return was:

Code:
iptables -t nat -A OUTPUT --dst $WAN_IP -p tcp --dport 9000:9010 -j DNAT --to-destination 192.168.0.25
Bad argument `tcp'
Try `iptables -h' or 'iptables --help' for more information.


Can anybody clarify por favor?

Gracias


Top
 Profile  
 
 Post subject: Re: Bash script Iptables for LAN sim on grid
PostPosted: Fri Jun 17, 2011 8:30 am 

Joined: Fri Aug 14, 2009 6:32 am
Posts: 2
Hi,

Ive been stuck by this as well - just looking at this and found the same error - but have tied it down now.

The issue is the line:

WAN_IP="`wget www.whatismyip.com/automation/n09230945.asp -O - -q`"

This is because the website www.whatismyip.com have changed their pages and this is no longer valid.

Try replacing it with:

WAN_IP="`wget -qO - icanhazip.com`"

That seems to work.

Good Luck!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 6 posts ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net