Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running a linux web/ftp server

Status
Not open for further replies.

estesflyer

Programmer
Dec 19, 2000
284
US
How do I find out the actual IP address for my linux box on an LAN? I don't want a network IP, but an internet IP.

I was thinking that maybe adding a port number @ the end of the router IP would direct people outside the network to the linux server, but how would I know which port it is?

TIA

- Rusty - Rusty
 
Hi,

Not absolutely sure what you're trying to do here. You can see the IP addresses of all your interfaces by doing :

/sbin/ifconfig

If you mean to forward external requests to another machine on the lan then you can use nat. For example, using iptables for 2.4 series kernels :

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to 192.168.1.1

The above example would take all input arriving on interface eth1 (-i eth1) of protocol tcp (-p tcp) with a destination port of 80 (--dport 80) and re-direct it to IP address 192.168.1.1 . You can make it more or less specfic if you wish.

Hope this helps

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top