LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-25-2012, 04:43 AM   #1
velvetbulldozer
LQ Newbie
 
Registered: Feb 2012
Posts: 14

Rep: Reputation: Disabled
Centos 6.2 set static IP


Hi folks,
I am continuing with the learning in my Linux Lab. So far I have done the following:
- Installed Centos 6.2
- Configured Samba both via command line and Swat (that was tricky)
- Built a Raid 5 array + Lvm
- Set up shared directories
- Installed a dlna server (tvmobili) all tvs see the Linux server
Next step is to allow the Macs in the house to gain acces to the linux. Anyone knows how to do that...?
I wanted to ask you which of these files is the one to set a static ip(os centos 6.2):

-rw-r--r--. 1 root root 254 Oct 7 17:01 ifcfg-lo
lrwxrwxrwx. 1 root root 20 Dec 16 07:09 ifdown -> ../../../sbin/ifdown
-rwxr-xr-x. 1 root root 627 Oct 7 17:01 ifdown-bnep
-rwxr-xr-x. 1 root root 5569 Oct 7 17:01 ifdown-eth
-rwxr-xr-x. 1 root root 781 Oct 7 17:01 ifdown-ippp
-rwxr-xr-x. 1 root root 4168 Oct 7 17:01 ifdown-ipv6
lrwxrwxrwx. 1 root root 11 Dec 16 07:09 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root 1481 Oct 7 17:01 ifdown-post
-rwxr-xr-x. 1 root root 1064 Oct 7 17:01 ifdown-ppp
-rwxr-xr-x. 1 root root 651 Oct 7 17:01 ifdown-routes
-rwxr-xr-x. 1 root root 1370 Oct 7 17:01 ifdown-sit
-rwxr-xr-x. 1 root root 1434 Oct 7 17:01 ifdown-tunnel
lrwxrwxrwx. 1 root root 18 Dec 16 07:09 ifup -> ../../../sbin/ifup
-rwxr-xr-x. 1 root root 13445 Oct 7 17:01 ifup-aliases
-rwxr-xr-x. 1 root root 859 Oct 7 17:01 ifup-bnep
-rwxr-xr-x. 1 root root 10456 Oct 7 17:01 ifup-eth
-rwxr-xr-x. 1 root root 11971 Oct 7 17:01 ifup-ippp
-rwxr-xr-x. 1 root root 10683 Oct 7 17:01 ifup-ipv6
lrwxrwxrwx. 1 root root 9 Dec 16 07:09 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root 727 Oct 7 17:01 ifup-plip
-rwxr-xr-x. 1 root root 954 Oct 7 17:01 ifup-plusb
-rwxr-xr-x. 1 root root 2364 Oct 7 17:01 ifup-post
-rwxr-xr-x. 1 root root 4154 Oct 7 17:01 ifup-ppp
-rwxr-xr-x. 1 root root 1712 Oct 7 17:01 ifup-routes
-rwxr-xr-x. 1 root root 3499 Oct 7 17:01 ifup-sit
-rwxr-xr-x. 1 root root 2488 Oct 7 17:01 ifup-tunnel
-rwxr-xr-x. 1 root root 3770 Oct 7 17:01 ifup-wireless
-rwxr-xr-x. 1 root root 4623 Oct 7 17:01 init.ipv6-global
-rwxr-xr-x. 1 root root 1125 Oct 7 17:01 net.hotplug
-rw-r--r--. 1 root root 11736 Oct 7 17:01 network-functions
-rw-r--r--. 1 root root 29853 Oct 7 17:01 network-functions-ipv6

Thanks,
Dan
 
Old 02-25-2012, 05:48 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
none of those files are relevant. Settings for your first ethernet nic would be in /etc/sysconfig/network-scripts/ifcfg-eth0 you can use the system-config-network tool to manage it. If you have Network Manager running, I would suggest you disable it, as it will cause conflist between the conventional way to manage server addresses.
 
Old 02-25-2012, 05:13 PM   #3
velvetbulldozer
LQ Newbie
 
Registered: Feb 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
no such file....

Thanks Chris, but I have no such file in that particular directory. The system-config-network tool gave no choices of configuration; it was empty so to speak.
Perhaps in centos 6.2 they placed that info somewhere else.
Dan

Quote:
Originally Posted by acid_kewpie View Post
none of those files are relevant. Settings for your first ethernet nic would be in /etc/sysconfig/network-scripts/ifcfg-eth0 you can use the system-config-network tool to manage it. If you have Network Manager running, I would suggest you disable it, as it will cause conflist between the conventional way to manage server addresses.
 
Old 02-25-2012, 05:15 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
do you have a network connection in the first place? It seems very odd to be doing this AFTER configuring SaMBa...? what does "ifconfig -a" say? No eth0 listed there says there's no valid driver or no hardware found.
 
Old 02-25-2012, 10:09 PM   #5
vp0619520
Member
 
Registered: Jan 2012
Posts: 55

Rep: Reputation: Disabled
Hi,I use the same system,but I found the file /etc/sysconfig/network-scripts/ifcfg-eth0.I think you can use the command:'ifconfig -a',and check the output ,I think you just have not install the driver of your NIC correctly.
 
Old 02-26-2012, 05:20 AM   #6
velvetbulldozer
LQ Newbie
 
Registered: Feb 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
more....

Hi, the network is working fine and the drivers are installed. I configured samba with the 104 ip given by the dhcp but now i want to set it static. In the /etc/sysconfig/network-scripts/ directory there is a file called ifcfg-lo. See the contents below, but I think this one refers to the localhost.

DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback

This is the contents of ifconfig -a:

eth0 Link encap:Ethernet HWaddr 00:24:BE:BC:1D:1A
inet addr:192.168.100.104 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::224:beff:febc:1d1a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:584078934 errors:0 dropped:2519095 overruns:0 frame:0
TX packets:269580947 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:712243443428 (663.3 GiB) TX bytes:355112425508 (330.7 GiB)
Interrupt:18

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:593700 errors:0 dropped:0 overruns:0 frame:0
TX packets:593700 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:113487887 (108.2 MiB) TX bytes:113487887 (108.2 MiB)

wlan0 Link encap:Ethernet HWaddr 00:23:14:23:31:8C
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

[root@linux network-scripts]#



Quote:
Originally Posted by vp0619520 View Post
Hi,I use the same system,but I found the file /etc/sysconfig/network-scripts/ifcfg-eth0.I think you can use the command:'ifconfig -a',and check the output ,I think you just have not install the driver of your NIC correctly.
 
Old 02-26-2012, 07:32 AM   #7
vp0619520
Member
 
Registered: Jan 2012
Posts: 55

Rep: Reputation: Disabled
I see.I think you can build a file named ifcfg-eth0 in that directory.And add the following statement:
Code:
      DEVICE=eth0
      IPADDR='youraddr'
      NETMASK='yournetmask'
      NETWORK='yournetwork'
      ONBOOT=yes
Save it.Then,use the command
Code:
# service network restart
,and see the output.I think that will enable the eth0.You can also reboot your computer to check whether it is working correctly.
 
  


Reply

Tags
centos, ip, static



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
CentOS in one VirtualBox, Windows in another - can I set up Samba in the CentOS VB? ismism Linux - Newbie 10 08-08-2010 03:34 PM
[SOLVED] installing centos 5.3 with static ip? windstory Linux - Newbie 4 10-12-2009 08:55 PM
CentOS DHCP to Static mitchell2345 Linux - Networking 5 11-01-2008 10:38 AM
How to set up static IP/Broadband Router on CentOS to use Internet? linux_related Linux - Networking 23 09-19-2007 01:01 AM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:55 PM.

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