Fabiano..

Apenas um detalhe..

Na linha que inicia com #!/bin/bash, substitua por #!/bin/sh

Um abraço

Bohrer



On Jan 4, 2008 12:04 AM, Bohrer <[EMAIL PROTECTED]> wrote:

> Fabiano
>
> Todos os procedimentos abaixo devem ser executados como root.. [ sudo su ]
>
> Basta criar um arquivo dentro de /usr/sbin chamado por exemplo rede..
>
> cd /usr/sbin
> > rede
>
> Depois, dê permissão de execução para este arquivo..
>
> chmod 755 rede
>
> Depois cole o conteúdo abaixo no arquivo, adaptando para cada rede
> diferente..
>
> # =-=-=-=
>
> #!/bin/bash
>
> cmd=${0##*/}
>
> msg="\n\tUso: $cmd [1] [2] [3]\n\t\t1 = Rede 1\n\t\t2 = Rede 2\n\t\t3 =
> Rede 3\n"
>
> # =-=-=-=-=-=-=-=-=-=-=
> if [ $# -lt 1 ]; then
>     echo $msg
>     exit 0
> fi
> # =-=-=-=-=-=-=-=-=-=-=
>
> # =-=-=-=-=-=-=-=-=-=-=
> if [ $1 = "3" ]; then
>     ifconfig eth0 192.168.1.3 netmask 255.255.255.0
>     route add default gw 192.168.1.1
>     echo "nameserver 200.184.26.4 " > /etc/resolv.conf
> # =-=-=-=-=-=-=-=-=-=-=
>
> # =-=-=-=-=-=-=-=-=-=-=
> elif [ $1 = "2" ]; then
>     ifconfig eth0 10.5.97.2 netmask 255.255.255.252
>     route add default gw 10.5.97.1
>     echo "nameserver 200.184.26.4" > /etc/resolv.conf
> # =-=-=-=-=-=-=-=-=-=-=
>
> # =-=-=-=-=-=-=-=-=-=-=
> elif [ $1 = "1" ]; then
>     ifconfig eth0 10.3.5.77 netmask 255.255.0.0
>     route add default gw 10.3.0.1
>     echo "nameserver 10.3.0.12" > /etc/resolv.conf
> # =-=-=-=-=-=-=-=-=-=-=
>
> # =-=-=-=-=-=-=-=-=-=-=
> else
>     echo "Invalid Number" $msg
>     exit 0
> fi
> # =-=-=-=-=-=-=-=-=-=-=
>
> # =-=-=-=
>
> Basta agora adaptar à sua realidade e ir ao terminal e como root, digitar
> rede e o parametro [ 1, 2 ou 3 ] de acordo com a configuração escolhida..
>
> Espero que ajude.. em caso de dúvidas, entre em contato..
>
> Um abraço
>
> Bohrer
>
>
>
>
> On Jan 3, 2008 8:13 AM, Davis Cabral - Listas <[EMAIL PROTECTED]>
> wrote:
>
> > Fabiano Fonseca escreveu:
> > > Qual é o arquivo de configuração da rede?
> > >
> > Procura mais informações sobre como usar o comando ifconfig (wired) e
> > iwconfig (wifi).
> >
> > []
> >
> > Davis
> >
> > --
> > Interessado em aprender mais sobre o Ubuntu em português?
> > http://wiki.ubuntu-br.org/ComeceAqui  -
> > ubuntu-br mailing list
> > ubuntu-br@lists.ubuntu.com
> > https://lists.ubuntu.com/mailman/listinfo/ubuntu-br
> >
>
>
>
> --
> Fernando Bohrer
> Linux Registered User # 431341
> Ubuntu Registered User # 17430
> Linux Professional Institute Certification Level 1 - [LPIC-1]




-- 
Fernando Bohrer
Linux Registered User # 431341
Ubuntu Registered User # 17430
Linux Professional Institute Certification Level 1 - [LPIC-1]
-- 
Interessado em aprender mais sobre o Ubuntu em português?
http://wiki.ubuntu-br.org/ComeceAqui  -
ubuntu-br mailing list
ubuntu-br@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-br

Responder a