DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, I am trying to open some ports for port forwarding. I believe I need a static IP address for this. Something like 192.168.1.x. How can I see if I currently have one or not. If not, how do I set it?
I have read that /etc/network/interfaces needs to be edited. Not sure what needs to be changed though. Here is my current file.
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
So then, using the example above, I would use 192.168.0.42 as the address to forward the port to? Do I have to do anything with the network, netmask, broadcast, or gateway?
Yes I am trying to set up port forwarding on a router. I am trying to do it on my debian machine and don't know the equivalent command for "ipconfig". How do I find my debian's ip address? Do I have to set the static ip address? 192.168.1.???
I am confused because I want other computers from outside my network to connect to it. So I thought I had to use my public ip. But I now believe that I use the debian's IP address and the outside computers connect using the public ip and then the router directs them to the debian machine. Is that right?
Last edited by scotty2024; 10-13-2010 at 11:22 PM.
Yes I am trying to set up port forwarding on a router. I am trying to do it on my debian machine and don't know the equivalent command for "ipconfig". How do I find my debian's ip address? Do I have to set the static ip address? 192.168.1.???
I am confused because I want other computers from outside my network to connect to it. So I thought I had to use my public ip. But I now believe that I use the debian's IP address and the outside computers connect using the public ip and then the router directs them to the debian machine. Is that right?
ifconfig
Yes, you have to set a static IP (unless you have a sophisticated router that accepts DNS name requests from DHCP clients and can do port forwarding by DNS name -- but let's keep this simple).
ionrivera has given the file name and sample contents to set a static IP. You need to use an editor to, er, edit it. vi is popular but nano is simpler; there are others. The file should be editable only by root.
Only your public IP is visible from the Internet so, yes, you must use port forwarding on the router to route incoming packets to the debian machine on your LAN. It is more secure to forward only the ports that need forwarding such as 80 for HTTP.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.