LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-24-2007, 07:31 AM   #1
thok
LQ Newbie
 
Registered: Oct 2007
Distribution: CentOS 4.x
Posts: 12

Rep: Reputation: 0
add ip to linux server


how can i add ip address to linux web server ?
 
Old 10-24-2007, 08:08 AM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
in Debian based distros you can create a sub-interface as follows..

Code:
it-etch:~# cat /etc/network/interfaces
# 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
auto eth0
iface eth0 inet static
address 192.168.0.4
netmask 255.255.255.0
gateway 192.168.0.1
network 192.168.0.0
broadcast 192.168.0.255

auto eth0:1
iface eth0:1 inet static
address 10.90.90.1
netmask 255.255.255.0
network 10.90.90.0
broadcast 10.90.90.255
Code:
it-etch:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:1A:A0:08:67:08
          inet addr:192.168.0.4  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21a:a0ff:fe08:6708/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5695635 errors:0 dropped:0 overruns:0 frame:0
          TX packets:338259 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:944543446 (900.7 MiB)  TX bytes:36835014 (35.1 MiB)
          Interrupt:201

eth0:1    Link encap:Ethernet  HWaddr 00:1A:A0:08:67:08
          inet addr:10.90.90.1  Bcast:10.90.90.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:201
You should add your distro to your profile, to help insure the information you get is most relevant to your distro..
 
Old 10-24-2007, 08:10 AM   #3
thok
LQ Newbie
 
Registered: Oct 2007
Distribution: CentOS 4.x
Posts: 12

Original Poster
Rep: Reputation: 0
it is actually centos 4.x

it is actually a web server which has already one ip address configured. now i have bought 4 ip addresses and i want to add those ip address to be used on the server ...

is above info still valid for this situation ?

Last edited by thok; 10-24-2007 at 08:14 AM.
 
Old 10-24-2007, 08:17 AM   #4
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
For Centos this link is probably more relevant: http://www.servepath.com/support/redhat_ip_config.htm
 
Old 10-24-2007, 08:28 AM   #5
thok
LQ Newbie
 
Registered: Oct 2007
Distribution: CentOS 4.x
Posts: 12

Original Poster
Rep: Reputation: 0
thnaks for help ... i must have come to this forum earlier....


so this is the info in my eth0


IPADDR=72.232.47.66
NETMASK=255.255.255.248


What would be subnet mask if i want to 72.232.47.67 to my server ?
 
Old 10-24-2007, 09:47 AM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Looks like the subnet would be the same...


Code:
it-etch:~# ipcalc 72.232.47.66/29
Address:   72.232.47.66         01001000.11101000.00101111.01000 010
Netmask:   255.255.255.248 = 29 11111111.11111111.11111111.11111 000
Wildcard:  0.0.0.7              00000000.00000000.00000000.00000 111
=>
Network:   72.232.47.64/29      01001000.11101000.00101111.01000 000
HostMin:   72.232.47.65         01001000.11101000.00101111.01000 001
HostMax:   72.232.47.70         01001000.11101000.00101111.01000 110
Broadcast: 72.232.47.71         01001000.11101000.00101111.01000 111
Hosts/Net: 6                     Class A
 
  


Reply


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
How to add users to linux server Dglass Linux - Newbie 2 09-19-2007 04:58 PM
add windows drivers to linux print server jhayes Linux - Networking 5 02-01-2007 10:42 AM
How to add a windows print server to Linux? jon_k Linux - General 3 12-01-2005 03:22 PM
Add new resolutions to X server librano MEPIS 4 07-22-2005 09:02 PM
Newbie... Add server to network? nwilcox Linux - Newbie 3 10-31-2004 06:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:49 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