LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 05-15-2011, 11:02 PM   #1
iPatch
LQ Newbie
 
Registered: Oct 2009
Posts: 18

Rep: Reputation: 9
Networking 101 WAN IP and private IP


Alright, I recently just upgraded from humble Linux user to confused Linux admin of my own virtual Linux server. When I issue the ifconfig command I get following output.

Code:
venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:1.2.3.4  P-t-P:1.2.3.4  Bcast:1.2.3.4  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
The WAN IP of the interface is not really 1.2.3.4 I just changed that IP for security reasons.

What I am trying to figure out, is it possible to assign a private IP address to the same interface or can I only have one IP address per interface. I understand I have a mask of /32 so I am not going to be able to subnet the address to create any more addresses, so I assume I am stuck with the WAN IP (public IP) that I have, and just need to deal with it.

The reason I ask this is because I have been reading through several DNS/BIND tutorials/walk-throughs, and a lot of them specify setting up a intranet access with 192.168.1.1 address for the local DNS server, but since I am connecting to the sever via SSH I figure I do not need a private IP address.

Any thoughts?
 
Old 05-16-2011, 12:24 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
What was your purpose for setting up bind ? ...
 
Old 05-16-2011, 11:31 AM   #3
iPatch
LQ Newbie
 
Registered: Oct 2009
Posts: 18

Original Poster
Rep: Reputation: 9
Quote:
Originally Posted by kbp View Post
What was your purpose for setting up bind ? ...
So I could host a website, and SSH into the box without having to type the WAN IP.
 
Old 05-16-2011, 11:58 AM   #4
manyrootsofallevil
Member
 
Registered: Dec 2010
Distribution: Red Hat, Kubuntu
Posts: 130

Rep: Reputation: 14
Quote:
Originally Posted by iPatch View Post
So I could host a website, and SSH into the box without having to type the WAN IP.
you can always add a second ip address to the interface

ifconfig interface add 192.168.1.1. 255.255.255.0

Assuming that your private network is 192.168.1.0

Note that this will disappear after a reboot, so make sure that you make the change permanent, if this is what you actually want.

easiest way is to make a copy of the current interface file, e.g. ifcfg-eth0. Rename it to ifcfg-eth0:0 and then change the device name to the file name and the ip address/netmask in ifcfg-eth0:0 to what you need.

Hope this helps

edit

You probably want venet0:1 as you already have :0. Not familiar with your distro I'm afraid.

Also, you'll only be able to access the private ip if you are already in that network 192.168.1.0 (or if there is routing/NATing to this network)

Last edited by manyrootsofallevil; 05-16-2011 at 12:07 PM.
 
Old 05-16-2011, 07:03 PM   #5
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
As it's hosted you won't be able to use private addresses without a vpn of some kind, I'd just add an entry in c:\windows\system32\drivers\etc\hosts to ssh. To host a website you'll need a domain registered, most registrars will host the dns for you as well if requested.

Last edited by kbp; 05-16-2011 at 07:05 PM.
 
Old 05-16-2011, 07:18 PM   #6
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian PPC/i386/AMD64 6/7, Vista, XP , WIN7, Server 03/08
Posts: 1,287

Rep: Reputation: 97
Or use a dns service like dyndns, no-ip etc.... You don't need to set up BIND on your own server to do DNS you would really only do that on your own internal network.
 
  


Reply

Tags
ifconfig, ip, network, networking


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Linux Networking 101 : any good guides ? Gzou Linux - Networking 1 01-24-2007 11:10 AM
LXer: Networking 101: Understanding Tunneling LXer Syndicated Linux News 0 08-04-2006 12:33 PM
LXer: Networking 101: Understanding iBGP LXer Syndicated Linux News 0 07-06-2006 06:03 AM
Networking 101 WeNdeL Linux - Networking 3 12-10-2002 06:31 PM
Linux Networking 101 question CyberNet Linux - Networking 3 11-12-2002 06:53 AM


All times are GMT -5. The time now is 09:52 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration