LinuxForum.Fans
Тема

Смена МАС-адреса, /etc/conf.d/net

Автор: raven_cler 15 сообщений 6041 просмотров
#231153

Доброго времени суток.
Соответственно, выполнил:
[console]# ln -s /etc/init.d/net.lo /etc/init.d/net.eth0
# rc-update add net.eth0 default[/console]
Заполнил /etc/conf.d/net:

text
mac_eth0="00:0e:a6:c8:92:21"
config_eth0="175.25.88.78/24"
routes_eth0="default via 172.25.88.1"

И никакой реакции. ifconfig -a показывает прежний MAC-адрес, lspci сетевую карту видит.
Версия openrc - 0.9.8.
Как всё-таки настроить? Через ifconfig eth0 hw ether 00:0e:a6:c8:92:21 всё прекрасно меняется.
При загрузке говорится только "Brinding up interface lo", опять же, о eth0 не слова.
Ещё в ifconfig появился странный интерфейс sit0.
Как решить данную проблему?

#231157

Ещё в ifconfig появился странный интерфейс sit0.

echo 'blacklist ipv6' | sudo tee -a /etc/modprobe.d/blacklist.conf

И никакой реакции.

вы конечно же перезагрузили /etc/init.d/network ?

#231158

ах да, забыл, emerge macchanger

#231164
riso написал:
echo 'blacklist ipv6' | sudo tee -a /etc/modprobe.d/blacklist.conf

Ок, попробуем.

riso написал:
вы конечно же перезагрузили /etc/init.d/network ?

Нет. Я перезагрузил машину.

riso написал:
ах да, забыл, emerge macchanger

Ок, сейчас попробую все вышесказанное и отпишусь.

#231177

Ага. Странный интерфейс пропал. Однако МАС-адрес всё равно не меняется. Хотя при запуске /etc/init.d/net.eth0 вручную всё работает... Видимо что-то с openrc. Но что??? С учетом того, что net.eth0 находится в списке, а metalog, который добавлен туда точно так же, прекрасно запускается О.о

#231182

как костыль, могу посоветовать использовать /etc/local.d/, README прочтите. Это аналог rc.local. Вообще все должно работать. проверьте еще раз

#231191

Покажите полностью файлы /etc/conf.d/net и /etc/rc.conf

#231271
Lupo Alberto написал:
Покажите полностью файлы /etc/conf.d/net и /etc/rc.conf

/etc/conf.d/net

text
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /usr/share/doc/openrc/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
mac_eth0="00:0e:a6:c8:92:21"
config_eth0="175.25.88.78/24"
routes_eth0="default via 172.25.88.1"

/etc/rc.conf :

text
# Global OpenRC configuration settings

# Set rc_interactive to "YES" and you'll be able to press the I key during # boot so you can choose to start specific services. Set to "NO" to disable # this feature. #rc_interactive="YES"

# If we need to drop to a shell, you can specify it here. # If not specified we use $SHELL, otherwise the one specified in /etc/passwd, # otherwise /bin/sh # Linux users could specify /sbin/sulogin rc_shell=/sbin/sulogin

# Do we allow any started service in the runlevel to satisfy the dependency # or do we want all of them regardless of state? For example, if net.eth0 # and net.eth1 are in the default runlevel then with rc_depend_strict="NO" # both will be started, but services that depend on 'net' will work if either # one comes up. With rc_depend_strict="YES" we would require them both to # come up. #rc_depend_strict="YES"

# rc_hotplug is a list of services that we allow to be hotplugged. # By default we do not allow hotplugging. # A hotplugged service is one started by a dynamic dev manager when a matching # hardware device is found. # This service is intrinsically included in the boot runlevel. # To disable services, prefix with a ! # Example - rc_hotplug="net.wlan !net.*" # This allows net.wlan and any service not matching net.* to be plugged. # Example - rc_hotplug="*" # This allows all services to be hotplugged #rc_hotplug="*"

# rc_logger launches a logging daemon to log the entire rc process to # /var/log/rc.log # NOTE: Linux systems require the devfs service to be started before # logging can take place and as such cannot log the sysinit runlevel. #rc_logger="YES"

# Through rc_log_path you can specify a custom log file. # The default value is: /var/log/rc.log #rc_log_path="/var/log/rc.log"

# By default we filter the environment for our running scripts. To allow other # variables through, add them here. Use a * to allow all variables through. #rc_env_allow="VAR1 VAR2"

# By default we assume that all daemons will start correctly. # However, some do not - a classic example is that they fork and return 0 AND # then child barfs on a configuration error. Or the daemon has a bug and the # child crashes. You can set the number of milliseconds start-stop-daemon # waits to check that the daemon is still running after starting here. # The default is 0 - no checking. #rc_start_wait=100

# rc_nostop is a list of services which will not stop when changing runlevels. # This still allows the service itself to be stopped when called directly. #rc_nostop=""

# rc will attempt to start crashed services by default. # However, it will not stop them by default as that could bring down other # critical services. #rc_crashed_stop=NO #rc_crashed_start=YES

############################################################################## # MISC CONFIGURATION VARIABLES # There variables are shared between many init scripts

# Set unicode to YES to turn on unicode support for keyboards and screens. unicode="yes"

# Below is the default list of network fstypes. # # afs cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs # nfs nfs4 ocfs2 shfs smbfs # # If you would like to add to this list, you can do so by adding your # own fstypes to the following variable. #extra_net_fs_list=""

############################################################################## # SERVICE CONFIGURATION VARIABLES # These variables are documented here, but should be configured in # /etc/conf.d/foo for service foo and NOT enabled here unless you # really want them to work on a global basis.

# Some daemons are started and stopped via start-stop-daemon. # We can set some things on a per service basis, like the nicelevel. #export SSD_NICELEVEL="-19"

# Pass ulimit parameters #rc_ulimit="-u 30"

# It's possible to define extra dependencies for services like so #rc_config="/etc/foo" #rc_need="openvpn" #rc_use="net.eth0" #rc_after="clock" #rc_before="local" #rc_provide="!net"

# You can also enable the above commands here for each service. Below is an # example for service foo. #rc_foo_config="/etc/foo" #rc_foo_need="openvpn" #rc_foo_after="clock"

# You can also remove dependencies. # This is mainly used for saying which servies do NOT provide net. #rc_net_tap0_provide="!net"

############################################################################## # LINUX SPECIFIC OPTIONS

# This is the subsystem type. Valid options on Linux: # "" - nothing special # "lxc" - Linux Containers # "openvz" - Linux OpenVZ # "prefix" - Prefix # "uml" - Usermode Linux # "vserver" - Linux vserver # "xen0" - Xen0 Domain # "xenU" - XenU Domain # If this is commented out, automatic detection will be attempted. # Note that autodetection will not work in a prefix environment or in a # linux container. # # This should be set to the value representing the environment this file is # PRESENTLY in, not the virtualization the environment is capable of. #rc_sys=""

# This is the number of tty's used in most of the rc-scripts (like # consolefont, numlock, etc ...) rc_tty_number=12

#231301

raven_cler, попробуйте в /etc/conf.d/net добавить modules="ifconfig".
Покажите, что пишет /var/log/rc.log, ну и dmesg на всякий случай.

#231309

Проблема решилась через emerge --oneshot -e openrc и раскомментирвание строчки rc_sys="" (возможно, последнее никак не связано, но желтые буквы в логе раздражали).
Но просьба тему пока что не закрывать, ибо:
а) Локалка так и не работает
б) Ещё поднимать ppp-интерфейс, а с одновременной работой pppoe и локалки у моего провайдера даже под Windos без костылей не обходится.
Пока пытаюсь сделать сам, но могут возникнуть проблемы просто.

#231324

Fiat lux! Локалку подняли. Просто была попечатка в IP-адресе.
Теперь надо что-то думать с pppoe...
Итак, вопрос:
Если локальная сеть использует один DNS (172.25.255.10), а PPPoE - другой(10.10.0.1), то что указывать в /etc/resolv.conf? И как заставить это всё работать вместе?

#231326

зачем гнать dns трафик через тунель, пусть будет локальный..

#231342

Тогда интернеты не работають =(
Можно ли как-то указать, что, мол, пусть ppp юзает один DNS, а локалка - второй? Причём указание разных DNS в две строчки результатов не дало, увы.

#231352

если локальный днс доступен, ваша машина должна резолвить адрес с него

ричём указание разных DNS в две строчки результатов не дало

при указании 2-х записей, машина попытается сначала с первым и при неудачной попытке перейдет ко второму.

#233050

Соответственно, единственный вопрос остался: где в pppoe.conf прописать роуты? И можно ли?

Войдите или зарегистрируйтесь, чтобы ответить.