Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
EEP! Can someone post their /etc/conf.d/net ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
DaNIsH
Apprentice
Apprentice


Joined: 01 Jan 2003
Posts: 197
Location: Melbourne, Australia.

PostPosted: Fri Oct 22, 2004 7:14 am    Post subject: EEP! Can someone post their /etc/conf.d/net ? Reply with quote

Hey,
Somehow managed to delete my /etc/conf.d/net file, and don't know the basic formatting to rewrite it.
Can someone please paste theirs in CODE tags? :oops:

Thanks in advance :)
_________________
Adopt an unanswered post today
Back to top
View user's profile Send private message
Lucky_Bastard
n00b
n00b


Joined: 23 Jul 2004
Posts: 8

PostPosted: Fri Oct 22, 2004 7:28 am    Post subject: Reply with quote

Code:
cat /etc/conf.d/net
# /etc/conf.d/net: Global config file for net.* rc-scripts
# $Header: /var/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.10 2004/06/28 19:44:46 agriffis Exp $

##############################################################################
#
#                      READ THIS COMMENT FIRST
#
# PLEASE PICK ONE of the configuration methods listed below.  If you
# don't know which to pick, use the top one, NEW-STYLE IFCONFIG.
# The other two possible options are OLD-STYLE IFACE and
# IPROUTE2-STYLE.
#
# If you have multiple sections (for example IFCONFIG and IPROUTE2)
# the network scripts will attempt to make reasonable assumptions
# about what to use, but there is no guarantee on the results, so
# PLEASE just use one set of configuration variables.
#
# At the bottom there is an ADVANCED CONFIGURATION section with some
# additional configuration possibilities
#
##############################################################################


##############################################################################
#   NEW-STYLE IFCONFIG examples
#   ---------------------------
#   This uses /sbin/ifconfig and /sbin/route to set the network up.
#   It is suitable for most home users.
##############################################################################

# To use DHCP on eth0, simply uncomment the following line:
ifconfig_eth0=( "dhcp" )
ifconfig_eth1=( "dhcp" )

# For passing custom options to dhcpcd use something like the following.  This
# example reduces the timeout for retrieving an address from 60 seconds (the
# default) to 10 seconds.  Note that this might be too short for some servers,
# so the default is encouraged unless you know what you're doing.
dhcpcd_eth0="-t 1"
dhcpcd_eth1="-t 10"

# For a static configuration, use something like this.  This sets the primary
# eth0 address to 192.168.0.2 and adds two aliases, eth0:1 and eth0:2
#ifconfig_eth0=(
#       "192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
#       "192.168.0.3 broadcast 192.168.0.255 netmask 255.255.255.0"
#       "192.168.0.4 broadcast 192.168.0.255 netmask 255.255.255.0"
#)

# This is just like setting the gateway config option in the old-style iface
# config, but allows one to add custom routes.  This should not be needed if you
# are obtaining an address via DHCP since the default route should be set
# automatically.
#routes_eth0=(
#       "default gw 192.168.0.1"
#)

# VLAN support - emerge net-misc/vconfig
# Please ensure your VLAN IDs are NOT zero-padded
#vlans_eth0="1 2"
#ifconfig_eth0_1=( "dhcp" )
#ifconfig_eth0_2=( "172.16.2.1 broadcast 172.16.3.255 netmask 255.255.254.0" )


##############################################################################
#   OLD-STYLE IFACE examples (deprecated)
#   -------------------------------------
#   This uses /sbin/ifconfig and /sbin/route to set the network up,
#   but is not as flexible as the IFCONFIG method above or the
#   IPROUTE2 method below.
##############################################################################

# To use DHCP on eth0, simply uncomment the following line:
#iface_eth0="dhcp"

# For passing custom options to dhcpcd use something like the following.  This
# example reduces the timeout for retrieving an address from 60 seconds (the
# default) to 10 seconds.  Note that this might be too short for some servers,
# so the default is encouraged unless you know what you're doing.
#dhcpcd_eth0="-t 10"

# To set a static IP address use a line similar to this
#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

# For setting the default gateway.  You should not need to do this if you use
# DHCP since the default gateway should be set automatically.
#gateway="eth0/192.168.0.1"

# For adding aliases to a interface, specify them space-separated in the
# following string
#alias_eth0="192.168.0.3 192.168.0.4"

# To add a custom netmask/broadcast address to created aliases, specify them in
# the same order as the alias_eth0 string.  If you find yourself doing this, you
# might consider switching to the new-style
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"

# VLAN support - emerge net-misc/vconfig
# Please ensure your VLAN IDs are NOT zero-padded
#vlans_eth0="1 2"
#iface_eth0_1="dhcp"
#iface_eth0_2="172.16.2.1 broadcast 172.16.3.255 netmask 255.255.254.0"


##############################################################################
#   IPROUTE2-STYLE CONFIGURATION
#   ----------------------------
#   This makes use of the /sbin/ip command to set routes and ip
#   addresses.  This style is very useful if you are building an
#   advanced linux router or using VRRP For more information on how to
#   use the iproute2 command have a look at the ip(8) man page.
#
#   NOTE: You must emerge sys-apps/iproute2 to use this configuration
##############################################################################

# To use DHCP on eth0, simply uncomment the following line:
#ipaddr_eth0=( "dhcp" )

# For passing custom options to dhcpcd use something like the following.  This
# example reduces the timeout for retrieving an address from 60 seconds (the
# default) to 10 seconds.  Note that this might be too short for some servers,
# so the default is encouraged unless you know what you're doing.
#dhcpcd_eth0="-t 10"

# For a static configuration, use something like this.  This sets the primary
# eth0 address to 192.168.0.2 and adds two aliases, eth0:1 and eth0:2.
# You may also pass advanced ip addr commands via this option.
#ipaddr_eth0=(
#       "192.168.0.2/24 brd 192.168.0.255"
#       "192.168.0.3/24 brd 192.168.0.255"
#       "192.168.0.4/24 brd 192.168.0.255"
#)

# The following will set up the default gateway. You can also pass advanced
# route configs via this option.
#iproute_eth0=(
#       "default via 192.168.0.1"
#)

# VLAN support - emerge net-misc/vconfig
# Please ensure your VLAN IDs are NOT zero-padded
#vlans_eth0="1 2"
#ipaddr_eth0_1=( "dhcp" )
#ipaddr_eth0_2=( "172.16.2.1/23 brd 172.16.3.255" )


##############################################################################
#   ADVANCED CONFIGURATION
#   ----------------------
#   The items in this section can be combined with one of the sections
#   above to create a complete network configuration.  None of the
#   items in this section are necessary to configure for most users.
##############################################################################

# Four functions can be defined which will be called surrounding the
# start/stop operations.  The functions are called with the interface
# name first so that one function can control multiple adapters.
#
# The return values for the preup and predown functions should be 0
# (success) to indicate that configuration or deconfiguration of the
# interface can continue.  If preup returns a non-zero value, then
# interface configuration will be aborted.  If predown returns a
# non-zero value, then the interface will not be allowed to continue
# deconfiguration.
#
# The return values for the postup and postdown functions are ignored
# since there's nothing to do if they indicate failure.
#
#preup() {
#       # Uncomment this function below if you want to check for link
#       # Remember to uncomment the preup_linkdetect function!
#       #preup_linkdetect $1
#
#       # Enable this function with this next line if you want to change your
#       # MAC address. Remember to uncomment the preup_macchanger function!
#       #preup_macchanger $1
#
#       # Remember to return 0 on success
#       return 0
#}

#predown() {
#       # Test to make sure the root filesystem is not mounted via NFS.
#       # Interface ($1) is ignored but could also be tested.
#       #if grep -q ' / nfs ' /proc/mounts; then
#       #       ewarn "Root is NFS mounted, aborting deconfiguration of $1"
#       #       return 1
#       #fi
#
#       # Bonding support
#       #predown_bonding $1
#
#       # Remember to return 0 on success
#       return 0
#}
#
#postup() {
#       # This function could be used, for example, to register with a
#       # dynamic DNS service.  Another possibility would be to
#       # send/receive mail once the interface is brought up.
#
#       # Enable this function with the next line if you want to use bonding.
#       # Remember to uncomment the preup_bonding function!
#       #postup_bonding $1
#
#       # Return 0 for success (ignored)
#       return 0
#}

#postdown() {
#       # This function is mostly here for completeness... I haven't
#       # thought of anything nifty to do with it yet ;-)
#
#       # Return 0 for success (ignored)
#       return 0
#}

# For changing MAC addresses - emerge net-analyzer/macchanger
# - to set a specific MAC address
#mac_eth0="00:11:22:33:44:55"
# - to randomize the last 3 bytes only
#mac_eth0="random-ending"
# - to randomize between the same physical type of connection (eg fibre, copper, wireless) , all vendors
#mac_eth0="random-samekind"
# - to randomize between any physical type of connection (eg fibre, copper, wireless) , all vendors
#mac_eth0="random-anykind"
# - full randomization - WARNING: some MAC addresses generated by this may NOT act as expected
#mac_eth0="random-full"
# custom - passes all parameters directly to net-analyzer/macchanger
#mac_eth0="some custom set of parameters"

# uncomment this function for support for changing MAC addresses
# also uncomment it's invocation in preup() above
#preup_macchanger() {
#       eval mac_IFACE=\"\$\{mac_${IFACE}\}\"
#       if [ -n "${mac_IFACE}" ]; then
#               if [[ -x /sbin/macchanger ]]; then
#                       local macchanger_opts=""
#                       case "${mac_IFACE}" in
#                               # specific mac-addr, i wish there were a shorter way to specify this
#                               [0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]) macchanger_opts="${macchanger_opts} --mac=${mac_IFACE}" ;;
#                               # increment MAC address, default macchanger behavior
#                               increment) macchanger_opts="${macchanger_opts}" ;;
#                   # randomize just the ending bytes
#                   random-ending) macchanger_opts="${macchanger_opts} -e" ;;
#                   # keep the same kind of physical layer (eg fibre, copper)
#                   random-samekind) macchanger_opts="${macchanger_opts} -a" ;;
#                   # randomize to any known vendor of any physical layer type
#                   random-anykind) macchanger_opts="${macchanger_opts} -A" ;;
#                   # fully random bytes
#                   random-full) macchanger_opts="${macchanger_opts} -r" ;;
#                   # default case is just to pass on all the options
#                               *) macchanger_opts="${macchanger_opts} ${mac_IFACE}" ;;
#                       esac
#               #echo "/sbin/macchanger ${macchanger_opts} ${IFACE}"
#               /sbin/macchanger ${macchanger_opts} ${IFACE} >/dev/null
#                       retval=$?
#                       if [ $retval -gt 0 ]; then
#                               eerror "Failed to set MAC address"
#                               return 1
#                       fi
#               else
#                       eerror "For changing MAC addresses, emerge net-analyzer/macchanger"
#                       return 1
#               fi
#       fi
#       return 0 #important
#}

# For link bonding/trunking - emerge net-misc/ifenslave
# if you are using any of the slave interfaces, it is important that you remove
# configurations for them and take them down first!
#slaves_bond0="eth2"
#ipaddr_bond0=( "172.16.2.1/23 brd 172.16.3.255" )

#postup_bonding() {
#       # return silently if this is not a bonding interface
#       if [ -n "${IFACE/bond*/}" ]; then
#               return 0
#       fi
#       eval slaves_IFACE=\"\$\{slaves_${IFACE}\}\"
#       if [[ -n "${slaves_IFACE}" ]]; then
#               if [[ -x /sbin/ifenslave ]]; then
#                       # must force the slaves to a particular state before adding them
#                       for slaveiface in ${slaves_IFACE}; do
#                               ifconfig ${slaveiface} 0.0.0.0 up
#                       done
#                       # now force the master to up
#                       ifconfig ${IFACE} up
#                       # finally add in slaves
#                       /sbin/ifenslave ${IFACE} ${slaves_IFACE}
#               else
#                       eerror "For link aggregation (bonding), emerge net-misc/ifenslave"
#                       return 1
#               fi
#       fi
#       return 0 #important
#}

#predown_bonding() {
#       # return silently if this is not a bonding interface
#       if [ -n "${IFACE/bond*/}" ]; then
#               return 0
#       fi
#       # don't trust the config, get the active list instead
#       slaves_IFACE=$(awk '/^Slave Interface:/ { printf $3" " }' /proc/net/bonding/${IFACE})
#       if [[ -n "${slaves_IFACE}" ]]; then
#               # remove all slaves
#               echo /sbin/ifenslave -d ${IFACE} ${slaves_IFACE}
#               /sbin/ifenslave -d ${IFACE} ${slaves_IFACE}
#               # reset all slaves
#               for slaveiface in ${slaves_IFACE}; do
#                       ifconfig ${slaveiface} 0.0.0.0 down
#               done
#       fi
#       return 0
#}

#preup_linkdetect() {
#       # Test for link on the interface prior to bringing it up.  This
#       # only works on some network adapters and requires the ethtool
#       # package to be installed.
#       if ethtool $1 | grep -q 'Link detected: no'; then
#               ewarn "No link on $1, aborting configuration"
#               return 1
#       fi
#}
Back to top
View user's profile Send private message
DaNIsH
Apprentice
Apprentice


Joined: 01 Jan 2003
Posts: 197
Location: Melbourne, Australia.

PostPosted: Fri Oct 22, 2004 7:30 am    Post subject: Reply with quote

Looks alot different to my original copy, but oh well as long as it works :)
Thanks heaps!
_________________
Adopt an unanswered post today
Back to top
View user's profile Send private message
To
Veteran
Veteran


Joined: 12 Apr 2003
Posts: 1145
Location: Coimbra, Portugal

PostPosted: Fri Oct 22, 2004 8:49 am    Post subject: Reply with quote

The only think I've setup since I'm using dhcp:
Code:
ifconfig_eth0=( "dhcp" )



_________________

------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------
Back to top
View user's profile Send private message
DaNIsH
Apprentice
Apprentice


Joined: 01 Jan 2003
Posts: 197
Location: Melbourne, Australia.

PostPosted: Fri Oct 22, 2004 11:02 am    Post subject: Reply with quote

Yeah, I knew it was fairly basic.. just not the exact formatting for it (mine's a bit more detailed than that).
As it was I booted with 23947298734 command not found messages, ended up being an issue with how Windows writes text files (edited and saved the config file with nano once and it was fixed).
_________________
Adopt an unanswered post today
Back to top
View user's profile Send private message
tecknojunky
Veteran
Veteran


Joined: 19 Oct 2002
Posts: 1937
Location: Montréal

PostPosted: Thu Nov 11, 2004 7:41 pm    Post subject: Reply with quote

Where dows that configuration file coming from?!? I downloaded the 2004.2 image like 3 days ago, and the net config file in it is dating from 2002/11/18.
_________________
(7 of 9) Installing star-trek/species-8.4.7.2::talax.
Back to top
View user's profile Send private message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Fri Nov 26, 2004 5:10 pm    Post subject: Reply with quote

Same thing here, I installed from 2004.3 livecd last week a new server and I have never seen this new file format.
_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
tecknojunky
Veteran
Veteran


Joined: 19 Oct 2002
Posts: 1937
Location: Montréal

PostPosted: Sat Nov 27, 2004 3:37 am    Post subject: Reply with quote

AchilleTalon wrote:
Same thing here, I installed from 2004.3 livecd last week a new server and I have never seen this new file format.
I've found the source:

ACCEPT_KEYWORDS=~x86 emerge baselayout
_________________
(7 of 9) Installing star-trek/species-8.4.7.2::talax.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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