Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
а каким образом eth гвоздями прибить?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Russian
View previous topic :: View next topic  
Author Message
lslarry
n00b
n00b


Joined: 06 Nov 2003
Posts: 5
Location: Moscow, RU

PostPosted: Tue Feb 14, 2006 12:13 pm    Post subject: а каким образом eth гвоздями приби Reply with quote

а точнее - как сказать, что нечто с unique id (irq, адрес, номер слота на шине, мак-адрес, еще чего-нибудь) у меня всегда должно быть, скажем, eth9?
чтобы при добавлении карточки в роутер оно их не перетасовывало.

p.s. вариант с загрузкой модулей в нужном порядке не проходит.
Back to top
View user's profile Send private message
hermes_jr
l33t
l33t


Joined: 26 Feb 2004
Posts: 701
Location: Moscow, Russia

PostPosted: Tue Feb 14, 2006 12:34 pm    Post subject: Reply with quote

В /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
View user's profile Send private message
fank
l33t
l33t


Joined: 16 Oct 2004
Posts: 794
Location: Minsk, Belarus

PostPosted: Tue Feb 14, 2006 3:37 pm    Post subject: Reply with quote

о, хороший хинт !
а как сделать то же самое, только для pppX?
буду должником по гроб !
Back to top
View user's profile Send private message
lslarry
n00b
n00b


Joined: 06 Nov 2003
Posts: 5
Location: Moscow, RU

PostPosted: Tue Feb 14, 2006 3:56 pm    Post subject: /me ево забодал Reply with quote

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
View user's profile Send private message
fank
l33t
l33t


Joined: 16 Oct 2004
Posts: 794
Location: Minsk, Belarus

PostPosted: Wed Feb 15, 2006 6:34 am    Post subject: Reply with quote

на основе чего будет переименование, если ppp интерфейс не имеет MAC адреса 8O ?
собственно, мне и не нужно переименование как таковое
мне нужно, чтобы при дозвоне до определённого прова поднимался интерфейс с определённым именем
Back to top
View user's profile Send private message
lslarry
n00b
n00b


Joined: 06 Nov 2003
Posts: 5
Location: Moscow, RU

PostPosted: Wed Feb 15, 2006 10:24 am    Post subject: Reply with quote

fank wrote:
на основе чего будет переименование, если ppp интерфейс не имеет MAC адреса 8O ?
собственно, мне и не нужно переименование как таковое
мне нужно, чтобы при дозвоне до определённого прова поднимался интерфейс с определённым именем


а вы, уважаемый, ман то четали не?
кроме собсно мака есь ище, цытирую

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(8) or ip(8).
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(8).

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(8).

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(8).

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(8).
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(8).
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(8).
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(8).
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
View user's profile Send private message
VoVaN
l33t
l33t


Joined: 02 Jul 2003
Posts: 688
Location: The Netherlands

PostPosted: Wed Feb 15, 2006 3:46 pm    Post subject: Reply with quote

А как насчет udev rules, не пробовал? По-моему это лучший вариант...
Back to top
View user's profile Send private message
lslarry
n00b
n00b


Joined: 06 Nov 2003
Posts: 5
Location: Moscow, RU

PostPosted: Wed Feb 15, 2006 4:00 pm    Post subject: Reply with quote

советуют, да. посмотрел. за 10 мин. не вкурил. нашел устраивающее решение.
но согласен, большие пацаны говорят удев - зе райт вей
Back to top
View user's profile Send private message
fank
l33t
l33t


Joined: 16 Oct 2004
Posts: 794
Location: Minsk, Belarus

PostPosted: Thu Feb 16, 2006 9:21 am    Post subject: Reply with quote

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
View user's profile Send private message
ba
l33t
l33t


Joined: 25 May 2003
Posts: 804

PostPosted: Mon Feb 20, 2006 8:24 pm    Post subject: Reply with quote

pppd можно указывать опцию unit n, где n - номер дефайса (pppn) который будет использовать данное соединение
Back to top
View user's profile Send private message
fank
l33t
l33t


Joined: 16 Oct 2004
Posts: 794
Location: Minsk, Belarus

PostPosted: Tue Feb 21, 2006 7:40 am    Post subject: Reply with quote

Quote:
Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound connections.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Russian All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum