Daarvoor dien je /etc/rc.d/rc.inet1 aan te passen, deze is namelijk maar voor max 2 nics.
Voeg onderstaande code toe aan je file voor de regel:
# Edit the next line to point to your gateway:
GATEWAY="" # REPLACE with YOUR gateway!
code:
1
2
3
4
5
6
7
8
9
| # Edit these values to set up your third Ethernet card (eth2),
# if you have one. Otherwise leave it configured to 127.0.0.1,
# or comment it out, and it will be ignored at boot.
IPADDR3="127.0.0.1" # REPLACE with YOUR IP address!
NETMASK3="255.255.255.0" # REPLACE with YOUR netmask!
# Or, uncomment the following lines to set up eth2 using DHCP:
#USE_DHCP3=yes
# If your provider requires a DHCP hostname, uncomment and edit below:
#DHCP_HOSTNAME3="CCHOSTNUM-A" |
Pas de waardes aan zodat ze overeenkomen met jouw ipnummer en netmask.
Vervolgens kun je onderstaande code kopieren voor de regel met:
# Set up the gateway:
if [ ! "$GATEWAY" = "127.0.0.1" -a ! "$GATEWAY" = "" ]; then
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| # Set up the eth2 interface:
if [ "$USE_DHCP3" = "yes" ]; then # use DHCP to set everything up:
echo "Attempting to configure eth2 by contacting a DHCP server..."
# Add the -h option to the DHCP hostname:
if [ ! "$DHCP_HOSTNAME3" = "" ]; then
DHCP_HOSTNAME3="-h $DHCP_HOSTNAME3"
fi
/sbin/dhcpcd -t 10 ${DHCP_HOSTNAME3} -d eth2
elif [ ! "$IPADDR3" = "127.0.0.1" -a ! "$IPADDR3" = "" ]; then # set up IP statically:
# Determine broadcast and network addresses from the IP address and netmask:
BROADCAST3=`/bin/ipmask $NETMASK3 $IPADDR3 | cut -f 1 -d ' '`
NETWORK3=`/bin/ipmask $NETMASK3 $IPADDR3 | cut -f 2 -d ' '`
# Set up the ethernet card:
echo "Configuring eth2:"
echo "ifconfig eth2 ${IPADDR3} broadcast ${BROADCAST3} netmask ${NETMASK3}"
/sbin/ifconfig eth2 ${IPADDR3} broadcast ${BROADCAST3} netmask ${NETMASK3}
# If that didn't succeed, give the system administrator some hints:
if [ ! $? = 0 ]; then
echo "Your eth2 card was not initialized properly. Here are some reasons why this"
echo "may have happened, and the solutions:"
echo "1. Your kernel does not contain support for your card. Including all the"
echo " network drivers in a Linux kernel can make it too large to even boot, and"
echo " sometimes including extra drivers can cause system hangs. To support your"
echo " ethernet, either edit /etc/rc.d/rc.modules to load the support at boot time,"
echo " or compile and install a kernel that contains support."
echo "2. You don't have an ethernet card, in which case you should fix"
echo " /etc/rc.d/rc.inet1 to stop trying to configure eth2. (Unless you don't mind"
echo " seeing this error...)"
fi
fi # set up eth2 |
Ik heb dit niet getest, maar denk dat het wel werkt

/edit: schoonheidsfoutje verwijderd uit comments