PDA

Виж пълна версия : Добаване на alias на Slackware 10?


stole
02.03.05 г., 14:54
Опитах се по този начин да добавам алиас:
/etc/rc.d/rc.inet1.conf
#
# This file contains the configuration settings for network interfaces.
# If USE_DHCP[interface] is set to "yes", this overrides any other settings.
# If you don't have an interface, leave the settings null ("").

# Config information for eth0:
IPADDR[0]="212.110.95.150"
NETMASK[0]="255.255.255.192"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
ETH0_ALIAS[0]="172.16.255.200" ## For multiple IPs on interface.
ETH0_ALIAS[1]="192.168.0.1" ## Ditto.
####################################

ама не стана. Добавих ги в /etc/rc.d/rc.local и работат, ама искам да попитам има ли начин да ги сложам тук: /etc/rc.d/rc.inet1.conf?

Fo
02.03.05 г., 15:07
rc.inet1 използва rc.inet1.conf - той е само за конфигуриране (.conf) и не се изпълнява...

stole
02.03.05 г., 15:32
Аз след като променям /etc/rc.d/rc.inet1.conf, испълнявам /etc/rc.d/rc.inet1 и със ifconfig вийдам че ги няма алиасите.
Въпроса ми беше как да променям /etc/rc.d/rc.inet1.conf, тъка че като испълня /etc/rc.d/rc.inet1 да се активираат алиасите.
Мерси!

Fo
02.03.05 г., 16:46
Ами виж в rc.inet1 как са и си направи да ги ползва, иф, тхен, анд со он...
Примерно:
# /etc/rc.d/rc.inet1.conf
#
# This file contains the configuration settings for network interfaces.
# If USE_DHCP[interface] is set to "yes", this overrides any other settings.
# If you don't have an interface, leave the settings null ("").

# Config information for eth0:
IPADDR[0]="212.110.95.150"
NETMASK[0]="255.255.255.192"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
USE_ETH_ALIAS="yes"
ETH0_ALIAS[0]="172.16.255.200" ## For multiple IPs on interface.
ETH0_ALIAS[1]="192.168.0.1" ## Ditto.
####################################
и в rc.inet1 нещо такова.... предполагам... не разбирам много, не ми се смейте ако не е така... :p #! /bin/sh
# /etc/rc.d/rc.inet1
# This script is used to bring up the various network interfaces.
#
# @(#)/etc/rc.d/rc.inet1 10.0 Sun Jun 6 23:42:32 PDT 2004 (pjv)

############################
# READ NETWORK CONFIG FILE #
############################

# Get the configuration information from /etc/rc.d/rc.inet1.conf:
. /etc/rc.d/rc.inet1.conf

eth_alias() {
if [ "$USE_ETH0_ALIAS" = "yes" ]; then
ETH0_ALIAS[0]="${ETH0_ALIAS[0]}"
ETH0_ALIAS[1]="${ETH0_ALIAS[1]}"
fi
}
############
### MAIN ###
############

case "$1" in
'start') # "start" brings up all available interfaces:
eth_alias
;;
*) # The default is to bring up all interfaces:
eth_alias
esac

# End of /etc/rc.d/rc.inet1
да не изриеш другите неща, :) за пример къде да пипнеш само...
Може и да работи... :rolleyes: