Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Forum italiano (Italian) Risorse italiane (documentazione e tools)
  • Search

[HOW-TO] come dare un nome un nome alle schede di rete

Forum riservato alla documentazione in italiano.

Moderator: ago

Post Reply
  • Print view
Advanced search
4 posts • Page 1 of 1
Author
Message
leon_73
Guru
Guru
User avatar
Posts: 505
Joined: Thu Mar 13, 2003 2:08 pm
Location: Milano

[HOW-TO] come dare un nome un nome alle schede di rete

  • Quote

Post by leon_73 » Mon Oct 30, 2006 9:01 pm

Ciao a tutti,

da un po' tempo mi guardavo attorno su come stabilire "definitivamente" quale scheda e come definirla.
Questa e' la mia soluzione.

Prima di tutti vediamo un po che schede abbiamo a disposizione:

Code: Select all

 # ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:E0:81:55:CF:5F
          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)

eth1      Link encap:Ethernet  HWaddr 00:E0:81:55:CF:5E
          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)
          Interrupt:17 Base address:0x4000

eth2     Link encap:Ethernet  HWaddr 00:E0:81:55:CF:5D
          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)
          Interrupt:18 Base address:0xd000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  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:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
ok... ora per esempio decidiamo che la eth2 deve avere sempre lo stesso IP (192.168.1.1/24)

Cosa identifica univocamente una scheda di rete: IL MAC ADDRESS qui indicato anche come HWaddr
visto che questa e' la scheda che mi collega ad internet ho deciso che si chiamera' internet e per definirla cosi' useremo il comando /sbin/nameif.

configuriamo il file /etc/mactab

Code: Select all

~ # cat /etc/mactab
# /etc/mactab
internet 00:E0:81:55:CF:5D
non e' molto difficile mi sembra...

prossimo step e' quello di creare un semplice init script

Code: Select all

~ # cat /etc/init.d/nameif
#!/sbin/runscript

depend() {
        need localmount
}

start() {

        ebegin "Starting nameif"
        /sbin/nameif -c /etc/mactab
        eend $?

}

stop() {

        ebegin "Stopping nameif"
        killall nameif
        eend $?

}
ora diamogli i permessi di eseguibilita' e aggiungiamolo al boot

Code: Select all

~ # chmod 750 /etc/init.d/nameif
~ # rc-update add nameif boot
 * nameif added to runlevel boot
ok... ora non ci resta che configurare la nostra brava scheda di rete ...

Code: Select all

~ # cat /etc/conf.d/net.internet
config_internet=( "192.168.1.4/24" )
routes_internet=(
        "default via 192.168.1.1"               # IPv4 default route
)
~ # cp /etc/init.d/net.eth0 /etc/init.d/net.internet
~ # rc-update add net.internet default
 * net.internet added to runlevel default
Bene signori... il gioco e' fatto!!! riavviate, e come per magia avrete sempre la scheda eth2 rinominata in internet e con un bel IP fisso :-)

Spero che possa essere utile a qualcun'altro oltre a me

Leo
Top
comio
Advocate
Advocate
User avatar
Posts: 2191
Joined: Thu Jul 03, 2003 10:36 am
Location: Taranto

  • Quote

Post by comio » Tue Oct 31, 2006 4:52 pm

Io preferisco usare udev.

ciao

luigi
RTFM!!!!

e

http://www.comio.it
:)
Top
leon_73
Guru
Guru
User avatar
Posts: 505
Joined: Thu Mar 13, 2003 2:08 pm
Location: Milano

  • Quote

Post by leon_73 » Tue Oct 31, 2006 5:28 pm

comio wrote:Io preferisco usare udev.
ciao
luigi
Bhe... il bello dell OS e' la possibilita' di scegliere :-)

Leo
Top
noice
Guru
Guru
User avatar
Posts: 473
Joined: Mon Dec 05, 2005 2:46 pm
Location: italia, Ischia

  • Quote

Post by noice » Thu Nov 02, 2006 12:29 pm

comio wrote:Io preferisco usare udev.

ciao

luigi
anche io e se puo' essere utile http://www.reactivated.net/writing_udev_rules.html
una "guida" alle regole di udev :wink:
Top
Post Reply
  • Print view

4 posts • Page 1 of 1

Return to “Risorse italiane (documentazione e tools)”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic