+ Responder ao Tópico



  1. #1

    Padrão Static ip RH5 num funciona

    Boa tarde galera. sempre utilizei debian e versões antigas do rh, mais agora instalei o rh5 aqui e quando coloco ip statico nele da isso:

    vo no diretorio /etc/sysconfig/network/devices abro arquivo da eth0 e edito como abaixo so pra ver se muda.

    DEVICE = eth0
    ONBOOT = yes
    BOOTPROTO = static
    IPADDR = 192.168.0.2
    NETMASK = 255.255.255.0
    NETWORK = 192.168.0.0
    BROADCAST = 192.168.0.255
    GATEWAY = 192.168.0.1

    me retorna isso

    [root@localhost network-scripts]# /etc/init.d/network restart
    ifcfg-eth0: line 3: DEVICE: command not found
    ifcfg-eth0: line 4: ONBOOT: command not found
    ifcfg-eth0: line 5: BOOTPROTO: command not found
    ifcfg-eth0: line 6: IPADDR: command not found
    ifcfg-eth0: line 7: NETMASK: command not found
    ifcfg-eth0: line 8: NETWORK: command not found
    ifcfg-eth0: line 9: BROADCAST: command not found
    ifcfg-eth0: line 10: GATEWAY: command not found
    Shutting down interface eth0: ifcfg-eth0: line 3: DEVICE: command not found
    ifcfg-eth0: line 4: ONBOOT: command not found
    ifcfg-eth0: line 5: BOOTPROTO: command not found
    ifcfg-eth0: line 6: IPADDR: command not found
    ifcfg-eth0: line 7: NETMASK: command not found
    ifcfg-eth0: line 8: NETWORK: command not found
    ifcfg-eth0: line 9: BROADCAST: command not found
    ifcfg-eth0: line 10: GATEWAY: command not found
    ifcfg-eth0: line 3: DEVICE: command not found
    ifcfg-eth0: line 4: ONBOOT: command not found
    ifcfg-eth0: line 5: BOOTPROTO: command not found
    ifcfg-eth0: line 6: IPADDR: command not found
    ifcfg-eth0: line 7: NETMASK: command not found
    ifcfg-eth0: line 8: NETWORK: command not found
    ifcfg-eth0: line 9: BROADCAST: command not found
    ifcfg-eth0: line 10: GATEWAY: command not found
    ifcfg-eth0: line 3: DEVICE: command not found
    ifcfg-eth0: line 4: ONBOOT: command not found
    ifcfg-eth0: line 5: BOOTPROTO: command not found
    ifcfg-eth0: line 6: IPADDR: command not found
    ifcfg-eth0: line 7: NETMASK: command not found
    ifcfg-eth0: line 8: NETWORK: command not found
    ifcfg-eth0: line 9: BROADCAST: command not found
    ifcfg-eth0: line 10: GATEWAY: command not found
    [ OK ]
    Shutting down loopback interface: [ OK ]
    Bringing up loopback interface: [ OK ]
    Bringing up interface eth0: ifcfg-eth0: line 3: DEVICE: command not found
    ifcfg-eth0: line 4: ONBOOT: command not found
    ifcfg-eth0: line 5: BOOTPROTO: command not found
    ifcfg-eth0: line 6: IPADDR: command not found
    ifcfg-eth0: line 7: NETMASK: command not found
    ifcfg-eth0: line 8: NETWORK: command not found
    ifcfg-eth0: line 9: BROADCAST: command not found
    ifcfg-eth0: line 10: GATEWAY: command not found
    ifcfg-eth0: line 3: DEVICE: command not found
    ifcfg-eth0: line 4: ONBOOT: command not found
    ifcfg-eth0: line 5: BOOTPROTO: command not found
    ifcfg-eth0: line 6: IPADDR: command not found
    ifcfg-eth0: line 7: NETMASK: command not found
    ifcfg-eth0: line 8: NETWORK: command not found
    ifcfg-eth0: line 9: BROADCAST: command not found
    ifcfg-eth0: line 10: GATEWAY: command not found
    Usage: grep [OPTION]... PATTERN [FILE]...
    Try `grep --help' for more information.
    Usage: grep [OPTION]... PATTERN [FILE]...
    Try `grep --help' for more information.
    ifcfg-eth0: line 3: DEVICE: command not found
    ifcfg-eth0: line 4: ONBOOT: command not found
    ifcfg-eth0: line 5: BOOTPROTO: command not found
    ifcfg-eth0: line 6: IPADDR: command not found
    ifcfg-eth0: line 7: NETMASK: command not found
    ifcfg-eth0: line 8: NETWORK: command not found
    ifcfg-eth0: line 9: BROADCAST: command not found
    ifcfg-eth0: line 10: GATEWAY: command not found
    Missing config file ifcfg-ifcfg-eth0.
    [ OK ]
    [root@localhost network-scripts]#

    Já aconteceu com alguem isso ?

  2. #2

    Padrão

    comigo nunca aconteceu não mas,
    ao que me parece ... ( parece )
    deve ser por que não "deve" estar especificado o enterpretador do script ai...
    tipo...

    #!/bin/sbin
    no topo do arquivo
    ou sabe quando vc vai criar um script e coloca o enterpretador. tipo:

    #!/bin/bash

    num será isso ???

    todo caso brother, se eu não me engano o redhat5 não tem o comando "linuxconf" ???
    ou se eu não me engano...
    da pra vc fazer atraves do comando

    netconf

    faz tempo q num uso redhat mas ve ai...

  3. #3

    Padrão

    Cara.. Você tá fazendo isso em um CentOS ou um RHEL (Red Hat Enterprise Linux) 5?

    Se for para alterar uma configuração IP, você deve procurar o seguinte arquivo:

    /etc/sysconfig/network-scripts/ifcfg-ethX, onde X é a sua plca de rede, assim:

    /etc/sysconfig/network-scripts/ifcfg-eth0

    E aí você pode por essas configurações que você listou acima...

    DEVICE = eth0
    ONBOOT = yes
    BOOTPROTO = static
    IPADDR = 192.168.0.2
    NETMASK = 255.255.255.0
    NETWORK = 192.168.0.0
    BROADCAST = 192.168.0.255
    GATEWAY = 192.168.0.1
    Depois, reinicia o serviço de rede pra ver o que acontece...

    [root@localhost ~]# service network restart
    No arquivo que você citou, você pode configurar os seguintes itens:

    28.1.22. /etc/sysconfig/network - CentOS.org:
    http://www.centos.org/docs/5/html/5....g-network.html

    14.2.1. Ethernet Interfaces - CentOS.org:
    http://www.centos.org/docs/5/html/5....aces-eth0.html

    Tem um arquivo que lista todos os parâmetros de configuração disponíveis no seu sistema, ele fica em /usr/share/doc/initscripts-<versão>/sysconfig.txt.

    É uma boa dar uma olhada nele!

    Espero ter ajudado!

    Vitor
    Última edição por vstrabello; 28-03-2009 às 13:48.