View previous topic :: View next topic |
Author |
Message |
lslarry n00b
Joined: 06 Nov 2003 Posts: 5 Location: Moscow, RU
|
Posted: Tue Feb 14, 2006 12:13 pm Post subject: а каким образом eth гвоздями приби |
|
|
а точнее - как сказать, что нечто с unique id (irq, адрес, номер слота на шине, мак-адрес, еще чего-нибудь) у меня всегда должно быть, скажем, eth9?
чтобы при добавлении карточки в роутер оно их не перетасовывало.
p.s. вариант с загрузкой модулей в нужном порядке не проходит. |
|
Back to top |
|
|
hermes_jr l33t
Joined: 26 Feb 2004 Posts: 701 Location: Moscow, Russia
|
Posted: Tue Feb 14, 2006 12:34 pm Post subject: |
|
|
В /etc/conf.d/net в зависимости от мак-адреса можно переименовать девайсы
/etc/conf.d/net.example wrote: |
# OPTIONAL MODULES
# INTERFACE RENAMING
# There is no consistent device renaming scheme for Linux.
# The preferred way of naming devices is via the kernel module directly or
# by using udev (http://www.reactivated.net/udevrules.php)
# If you are unable to write udev rules, then we do provide a way of renaming
# the interface based on it's MAC address, but it is not optimal.
# Here is how to rename an interface whose MAC address is 00:11:22:33:44:55
# to foo1
#rename_001122334455="foo1"
# You can also do this based on current device name - although this is not
# recommended. Here we rename eth1 to foo2.
#rename_eth1="foo2"
|
Не знаю точно с какой версии baselayout (это ж всё с ним связано да?) появилось, но на всякий случай - у меня sys-apps/baselayout-1.12.0_pre15-r1 |
|
Back to top |
|
|
fank l33t
Joined: 16 Oct 2004 Posts: 794 Location: Minsk, Belarus
|
Posted: Tue Feb 14, 2006 3:37 pm Post subject: |
|
|
о, хороший хинт !
а как сделать то же самое, только для pppX?
буду должником по гроб ! |
|
Back to top |
|
|
lslarry n00b
Joined: 06 Nov 2003 Posts: 5 Location: Moscow, RU
|
Posted: Tue Feb 14, 2006 3:56 pm Post subject: /me ево забодал |
|
|
1) всем спасибо
2) вариант с netdev=irc,base_addr,ethnum параметрами к ядру не прокатил. уж не знаю почему
3) вариант с rename_mac в /etc/conf.d не прокатил
(подозреваю из-за отсутствия wireless-tools)
4) помогла его (пакета wireless-tools) установка и man iftab
5) при прописывании в iftab все становится шоколадно
6) ppp и прочие динамические линки он тоже прекрасно переименовывает |
|
Back to top |
|
|
fank l33t
Joined: 16 Oct 2004 Posts: 794 Location: Minsk, Belarus
|
Posted: Wed Feb 15, 2006 6:34 am Post subject: |
|
|
на основе чего будет переименование, если ppp интерфейс не имеет MAC адреса ?
собственно, мне и не нужно переименование как таковое
мне нужно, чтобы при дозвоне до определённого прова поднимался интерфейс с определённым именем |
|
Back to top |
|
|
lslarry n00b
Joined: 06 Nov 2003 Posts: 5 Location: Moscow, RU
|
Posted: Wed Feb 15, 2006 10:24 am Post subject: |
|
|
fank wrote: | на основе чего будет переименование, если ppp интерфейс не имеет MAC адреса ?
собственно, мне и не нужно переименование как таковое
мне нужно, чтобы при дозвоне до определённого прова поднимался интерфейс с определённым именем |
а вы, уважаемый, ман то четали не?
кроме собсно мака есь ище, цытирую
Quote: |
arp arp type
Matches the ARP Type (also called Link Type) of the interface with the specified ARP type. The ARP Type of
the interface can be shown using ifconfig( or ip(.
This selector is useful when a driver create multiple network interfaces for a single network card.
driver driver name
Matches the Driver Name of the interface with the specified driver name. The Driver Name of the interface
can be shown using ethtool -i(.
businfo bus information
Matches the Bus Information of the interface with the specified bus information. The Bus Information of
the interface can be shown using ethtool -i(.
firmware firmware revision
Matches the Firmware Revision of the interface with the firmware revision information. The Firmware Revi-
sion of the interface can be shown using ethtool -i(.
baseaddress base address
Matches the Base Address of the interface with the specified base address. The Base Address of the inter-
face can be shown using ifconfig(.
Because most cards use dynamic allocation of the Base Address, this selector is only useful for ISA and
EISA cards.
irq irq line
Matches the IRQ Line (interrupt) of the interface with the specified IRQ line. The IRQ Line of the inter-
face can be shown using ifconfig(.
Because there are IRQ Lines may be shared, this selector is usually not sufficient to uniquely identify an
interface.
iwproto wireless protocol
Matches the Wireless Protocol of the interface with the specified wireless protocol. The Wireless Protocol
of the interface can be shown using iwconfig(.
This selector is only supported on wireless interfaces and is not sufficient to uniquely identify an
interface.
pcmciaslot pcmcia slot
Matches the Pcmcia Socket number of the interface with the specified slot number. Pcmcia Socket number of
the interface can be shown using cardctl ident(.
This selector is usually only supported on 16 bits cards, for 32 bits cards it is advised to use the
selector businfo.
SYSFS{filename} value
Matches the sysfs attribute given by filename to the specified value. sysfs attributes of the interface
can be read in one of the directory in the directory /sys/class/net/. For example, the filename address
is the MAC address of the device and should be identical to the selector mac.
The sysfs filesystem is only supported with 2.6.X kernel and need to be mounted. sysfs selectors are not
as efficient as other selectors, therefore they should be avoided for maximum performance.
|
ну я если этого не хватает - никто не мешает в ifup-скрипте напрямую вызвать ifrename |
|
Back to top |
|
|
VoVaN l33t
Joined: 02 Jul 2003 Posts: 688 Location: The Netherlands
|
Posted: Wed Feb 15, 2006 3:46 pm Post subject: |
|
|
А как насчет udev rules, не пробовал? По-моему это лучший вариант... |
|
Back to top |
|
|
lslarry n00b
Joined: 06 Nov 2003 Posts: 5 Location: Moscow, RU
|
Posted: Wed Feb 15, 2006 4:00 pm Post subject: |
|
|
советуют, да. посмотрел. за 10 мин. не вкурил. нашел устраивающее решение.
но согласен, большие пацаны говорят удев - зе райт вей |
|
Back to top |
|
|
fank l33t
Joined: 16 Oct 2004 Posts: 794 Location: Minsk, Belarus
|
Posted: Thu Feb 16, 2006 9:21 am Post subject: |
|
|
Quote: | ppp0 Link encap:Point-to-Point Protocol
inet addr:x.x.x.x P-t-P:y.y.y.y Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1000 Metric:1
RX packets:1886385 errors:0 dropped:0 overruns:0 frame:0
TX packets:1648864 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
ppp1 Link encap:Point-to-Point Protocol
inet addr:x1.x1.x1.x1 P-t-P:y1.y1.y1.y1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1000 Metric:1
RX packets:1886385 errors:0 dropped:0 overruns:0 frame:0
TX packets:1648864 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3 |
итак, задача: первому ВСЕГДА назначить ppp0, второму - ppp1
на основе чего будет назначаться имя
ifup один на всё
arp arp type - одинаков (?)
driver driver name - какой у pptpclient и pppd?
businfo bus information - то же
firmware firmware revision - то же
....
SYSFS{filename} value - это единственный непонятный мне критерий, но, опять же, упоминается MAC
вообще-то, я уже вроде нашёл решение
в том же самом скрипте /etc/conf.d/net есть гораздо более просто вариант
Code: | link_ppp0="/dev/ttyS0" |
но мне ещё повезло, что у меня один интерфейс виртуальный, остальные "железные", а если б это, скажем, были 2 vpn клиента, то куда мне надо ifrename() впихнуть? |
|
Back to top |
|
|
ba l33t
Joined: 25 May 2003 Posts: 804
|
Posted: Mon Feb 20, 2006 8:24 pm Post subject: |
|
|
pppd можно указывать опцию unit n, где n - номер дефайса (pppn) который будет использовать данное соединение |
|
Back to top |
|
|
fank l33t
Joined: 16 Oct 2004 Posts: 794 Location: Minsk, Belarus
|
Posted: Tue Feb 21, 2006 7:40 am Post subject: |
|
|
Quote: | Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound connections. |
|
|
Back to top |
|
|
|