Centos IP Konfigürasyonu – Statik IP Ayarları

Linux Centos uzerinde statik IP konfigurasyonu asagidaki sekilde yapilandirilabilir.

1-Network ayarlarimiz icin network-scripts bolumune girelim.

[root@ugurengin ~]# cd /etc/sysconfig/network-scripts
[root@ugurengin network-scripts]# ls -l
total 256
-rw-r--r-- 1 root root   254 Nov 13  2008 ifcfg-lo
-rw-r--r-- 1 root root   101 Jul 22 04:37 ifcfg-venet0
-rw-r--r-- 1 root root    73 Jul 22 04:37 ifcfg-venet0:0

ifcfg-venet0 network dosyasini  kopyalarak sunucu uzerinde birden fazla  IP adresi olusturabiliriz.

Oncelikle sunucu uzerindeki mevcut  network yapisina goz atalim.

[root@ugurengin network-scripts]# cat ifcfg-venet0:0
DEVICE=venet0:0
ONBOOT=yes
IPADDR=64.186.129.110
NETMASK=255.255.255.255

2.IP ‘yi eklemek icin ifcfg-venet0:0 dosyasini kopyaliyorum.

[root@ugurengin network-scripts]# cp /etc/sysconfig/network-scripts/ifcfg-venet0:0 /etc/sysconfig/network-scripts/ifcfg-venet0:1

Yeni ekleyecegim IP adresi icin dosyam > “ifcfg-venet0:1“  isimli dosyayı açıp yeni bir etrn interface giriyorum.

[root@ugurengin network-scripts]# vi ifcfg-venet0:1
DEVICE=venet0:1
ONBOOT=yes
IPADDR=64.186.129.111
NETMASK=255.255.255.255

Subnetmask  bolumu hariç ,  yeni IP adresini ‘IPADDR’ parametresi ile  dosya icerisine ekliyorum.
DEVICE=venet0:0 olan bolumu yeni IP adresi ekleyecegim icin ’1′ olarak guncelledim.

Ayarlarımızı etkinlestirilmesi icin konsolda network’u restart edelim,

[root@ugurengin network-scripts]# service network restart Shutting down interface venet0:                            [  OK  ] Shutting down loopback interface:                      [  OK  ]
Bringing up loopback interface:                          [  OK  ]
Bringing up interface venet0:  SIOCADDRT: Network is unreachable
SIOCADDRT: Network is unreachable
SIOCADDRT: Network is unreachable                 [  OK  ]

Sisteme adet 1 yeni IP adresi ekledik, eger sunucunuz da Plesk Panel varsa yonetici kısmında ‘IP Addresses’  bolumune erisip eklediginiz IP adresini gorebilirsiniz. Yeni eklenen IP adresini ister paylasimli (Share),  isterseniz sabit olarak(Statik) tek domaine atayabilirsiniz.

“ifcfg-venet0:x dosyası kopyalanip birden fazla IP sunucu uzerine eklenebilir.

Ornegini asagidaki resimde gorebilirsiniz.

Simdi  kontrol edelim , eger ilgili islemleri hatasız yaptıysanız eklenileni yeni IP adresini goruyor olmalisiniz.

[root@ugurengin network-scripts]# ifconfig

venet0:1 Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

inet addr:64.186.129.111 P-t-P:64.186.129.111

Bcast:64.186.129.111 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

- Dmesg komutu ile de ilgili interface’nin up/down durumu kontrol edilebilir.

 


Share on Facebook
Leave a comment

2 Comments.

  1. bu güzel bilgileri paylaştığınız için teşekkür ederim.

  2. Wow i was looking for this informattion only and i have got great knowledge from our post.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>