Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Multiple NIC's problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ghost5316
n00b
n00b


Joined: 18 Aug 2003
Posts: 35

PostPosted: Wed Dec 17, 2003 1:02 am    Post subject: Multiple NIC's problem Reply with quote

I have eth0 and eth1 up and running, however eth1 is a symbolic link to eth0 (I did this on accident).

How can I remove the symbolic link to eth0 and get the real eth1 running?

Also, is there any way to bind multiple ip addresses to one nic w/o making a symbolic link at all?

Thanks
Back to top
View user's profile Send private message
m0pr0be
Guru
Guru


Joined: 29 Aug 2002
Posts: 308

PostPosted: Wed Dec 17, 2003 1:13 am    Post subject: Reply with quote

how did you do this? its not possible to create symbolic links for network devices.
symbolic links are only possible for filesystems.

for a basic network understanding in linux read this
Back to top
View user's profile Send private message
dlambeth
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 123
Location: San Antonio, TX

PostPosted: Wed Dec 17, 2003 1:05 pm    Post subject: Reply with quote

Yes you can create symbolic links to interfaces, it's in the Gentoo install guide. I did the same thing he did and was forced to remove it by deleting them. What I did is copied net.eth0 and net.eth1 to a backup directory and deleted the symbolic link. Then I copied the net.eth files back over to the /etc/init.d directory and re-ran rc-update for these files. You should probably do rc-update del net.eth0 and rc-update del net.eth1 for the interfaces before you delete them.

Hope this helps.
_________________
Darwin L. Lambeth
Network Administrator/Developer
FPMI
dlambeth@darwinsdomain.com
Back to top
View user's profile Send private message
dlambeth
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 123
Location: San Antonio, TX

PostPosted: Wed Dec 17, 2003 1:18 pm    Post subject: Reply with quote

I forgot to mention the part about binding multiple ip's to your NIC. If you open your /etc/conf.d/net.eth0 file, you will see options for aliasing in there. This is where you would add your aliases.

Example:

# For adding aliases to a interface
#
#alias_eth0="192.168.0.3 192.168.0.4"

Uncomment the alias line out and put in your next ip address. Make sure your alias_eth0 to eth0:1

Don't forget you have to:
rc-update del net.eth0
and then:
rc-update add net.eth0 default


Good day
_________________
Darwin L. Lambeth
Network Administrator/Developer
FPMI
dlambeth@darwinsdomain.com
Back to top
View user's profile Send private message
defendtherealm1
Tux's lil' helper
Tux's lil' helper


Joined: 16 Dec 2003
Posts: 138

PostPosted: Wed Dec 17, 2003 1:45 pm    Post subject: Reply with quote

Quote:
alias_eth0 to eth0:1


Please can you elaborate on that bit there......You may help me solve a problem that I have.....

https://forums.gentoo.org/viewtopic.php?t=115899


Cheers
Back to top
View user's profile Send private message
dlambeth
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 123
Location: San Antonio, TX

PostPosted: Wed Dec 17, 2003 3:40 pm    Post subject: Reply with quote

Forget about the rename alias_eth0 part, you don't need to do that. Just follow below.


Open your /etc/conf.d/net.eth0
Look for the following line and uncomment the alias_eth0....
Then replace the two ipaddresses with one ipaddress of your next ip you want to assign.

# For adding aliases to a interface
#
alias_eth0="192.168.0.3"


That's it. Again before you do any of this, make sure you
rc-update del net.eth0
When you finish, do
rc-update add net.eth0 default


Good luck.
_________________
Darwin L. Lambeth
Network Administrator/Developer
FPMI
dlambeth@darwinsdomain.com
Back to top
View user's profile Send private message
ghost5316
n00b
n00b


Joined: 18 Aug 2003
Posts: 35

PostPosted: Wed Dec 17, 2003 3:44 pm    Post subject: Reply with quote

okay.... I ran rc-update del net.eth0 and rc-update del net.eth1 and deleted the symbolic link....

eth0 is up and running but eth1 is no where to be found (yes, I have 2 nics.. both the same model)

Any ideas?

rc-update add net.eth1 default says...

* /sbin/rc-update: /etc/init.d/net.eth1 not found; aborting.

Side Note:

I compiled tulip (module for networking) into the kernel not as a module... someone said they were having problems when they added it as a module and it works when they don't...
Back to top
View user's profile Send private message
dlambeth
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 123
Location: San Antonio, TX

PostPosted: Wed Dec 17, 2003 4:13 pm    Post subject: Reply with quote

Give me a few minutes and I'll find the answer, as I am working on a dual nic system now.
_________________
Darwin L. Lambeth
Network Administrator/Developer
FPMI
dlambeth@darwinsdomain.com
Back to top
View user's profile Send private message
dlambeth
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 123
Location: San Antonio, TX

PostPosted: Wed Dec 17, 2003 4:47 pm    Post subject: Reply with quote

Try this:
IMPORTANT: You are going to modify /etc/conf.d/net.eth0 and save it as net.eth1. I recommend backing up your net.eth0 first before proceeding.

Stop your net.eth0 by issuing /etc/init.d/net.eth0 stop

Now copy your /etc/init.d/net.eth0 to /etc/init.d/net.eth1
(should be able to:
cp /etc/init.d/net.eth0 /etc/init.d/net.eth1)

Open your /etc/conf.d/net.eth0 and find the following line.

# This is basically the ifconfig argument without the ifconfig $iface
#
#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

Comment out the iface_eth0 line and un-comment the iface_eth1 and put your ip address for eth1 there along with gateway etc.

Make sure at the bottom of the file you comment out the default gateway if it's not already, if you don't, it will conflict with net.eth0. Now just save the file as net.eth1.

At this point you should be able to:
rc-update add net.eth1 default

You don't have to reboot, just run /etc/init.d/net.eth1 start

If all goes well, reboot and see if it all comes up okay.

Let me know how it goes.
_________________
Darwin L. Lambeth
Network Administrator/Developer
FPMI
dlambeth@darwinsdomain.com
Back to top
View user's profile Send private message
ghost5316
n00b
n00b


Joined: 18 Aug 2003
Posts: 35

PostPosted: Wed Dec 17, 2003 4:56 pm    Post subject: Reply with quote

i went into /etc/conf.d and tried to edit the net.eth0, but there isnt a file there for it. Any suggestions on how i can get that file back?

I dont know if this is related, But i tried to bring up eth0 and now i cant seem to get it to pull an ip address anymore.
Back to top
View user's profile Send private message
dlambeth
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 123
Location: San Antonio, TX

PostPosted: Wed Dec 17, 2003 5:06 pm    Post subject: Reply with quote

There should be a file called net in /etc/conf.d

Use that instead, and when you modify it as per last post, save it as net.eth1 (you may have to do net.eth0 also).

It sounds like you lost your net.eth0 so you may have to redo it also. Do you have the default gentoo instructions, it will tell you exactly what you need to do.

If you do all of this like I explained, it should work without incident. I just duplicated all of this and rebooted and it works great.
_________________
Darwin L. Lambeth
Network Administrator/Developer
FPMI
dlambeth@darwinsdomain.com
Back to top
View user's profile Send private message
ghost5316
n00b
n00b


Joined: 18 Aug 2003
Posts: 35

PostPosted: Wed Dec 17, 2003 5:25 pm    Post subject: Reply with quote

when I tried doing a /etc/init.d/net.eth1 start it said...

* Count not get dependency info for "net.eth1"!
* Count not get dependency info for "net.eth1"!
* Bringing eth1 up... [ok]

and when I tried doing /etc/init.d/net.eth0 start it came up fine...

I have an ipaddress for eth1 but not one for eth0... right now I have both set up for dhcp
Back to top
View user's profile Send private message
dlambeth
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 123
Location: San Antonio, TX

PostPosted: Wed Dec 17, 2003 5:53 pm    Post subject: Reply with quote

If you don't mind, send me your:

/etc/conf.d/net.eth0
and
/etc/init.d/net.eth0

I'll look at them. It sounds like your almost there. Are you running a dhcp server on both networks?
_________________
Darwin L. Lambeth
Network Administrator/Developer
FPMI
dlambeth@darwinsdomain.com
Back to top
View user's profile Send private message
ghost5316
n00b
n00b


Joined: 18 Aug 2003
Posts: 35

PostPosted: Wed Dec 17, 2003 7:03 pm    Post subject: Reply with quote

/etc/conf.d/net.eth0

Quote:
# /etc/conf.d/net:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface
#
#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
#iface_eth1="208.2.138.101 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
iface_eth0="dhcp"
#iface_eth1="dhcp"
#dhcpcd_eth0="..."

# For adding aliases to a interface
#
#alias_eth0="192.168.0.3 192.168.0.4"

# NB: The next is only used for aliases.
#
# To add a custom netmask/broadcast address to created aliases,
# uncomment and change accordingly. Leave commented to assign
# defaults for that interface.
#
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"


# For setting the default gateway
#
#gateway="eth0/192.168.0.1"


/etc/conf.d/net.eth0

Quote:

#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.eth0,v 1.28 2003/03/16 08:03:19 azarah Exp$

#NB: Config is in /etc/conf.d/net


# For pcmcia users. note that pcmcia must be added to the same
# runlevel as the net.* script that needs it.
depend() {
use hotplug pcmcia
}

checkconfig() {
if [ -z "${iface_IFACE}" ]
then
eerror "Please make sure that /etc/conf.d/net has \$iface_$IFACE set"
return 1
fi
}

setup_env() {
# No reason to check these multiple times in the file
iface_IFACE="$(eval echo \$\{iface_${IFACE}\})"
dhcpcd_IFACE="$(eval echo \$\{dhcpcd_${IFACE}\})"
inet6_IFACE="$(eval echo \$\{inet6_${IFACE}\})"
alias_IFACE="$(eval echo \$\{alias_${IFACE}\})"
status_IFACE="$(ifconfig | gawk -v IFACE="${IFACE}" '/Link/ { if ($1 == IFACE) print "up" }'$
}

start() {
local retval=0

setup_env
checkconfig || return 1

ebegin "Bringing ${IFACE} up"
if [ "${iface_IFACE}" != "dhcp" ]
then
/sbin/ifconfig ${IFACE} ${iface_IFACE} >/dev/null || {
retval=$?
eend ${retval} "Failed to bring ${IFACE} up"
return ${retval}
}
# ifconfig do not always return failure ..
/sbin/ifconfig ${IFACE} &> /dev/null || {
retval=$?
eend ${retval} "Failed to bring ${IFACE} up"
return ${retval}
}
else
# Check that eth0 was not brough up by the kernel ...
if [ "${status_IFACE}" != "up" ]
then
/sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE} >/dev/null || {
retval=$?
eend ${retval} "Failed to bring ${IFACE} up"
return ${retval}
}
fi
fi
eend 0

if [ -n "${alias_IFACE}" ]
then
local x=""
local num=0
local aliasbcast=""
local aliasnmask=""

ebegin " Adding aliases"
for x in ${alias_IFACE}
do
aliasbcast="$(eval echo \$\{broadcast_${IFACE}\} \| awk \'\{ print \$$((num $
if [ -n "${aliasbcast}" ]
then
aliasbcast="broadcast ${aliasbcast}"
fi

aliasnmask="$(eval echo \$\{netmask_${IFACE}\} \| awk \'\{ print \$$((num + $
if [ -n "${aliasnmask}" ]
then
aliasnmask="netmask ${aliasnmask}"
fi

ebegin " ${IFACE}:${num}"
/sbin/ifconfig ${IFACE}:${num} ${x} \
${aliasbcast} ${aliasnmask} >/dev/null
num=$((num + 1))
eend 0
done
save_options "alias" "${alias_IFACE}"
fi

if [ -n "${inet6_IFACE}" ]
then
local x=""
ebegin " Adding inet6 addresses"
for x in ${inet6_IFACE}
do
ebegin " ${IFACE} inet6 add ${x}"
/sbin/ifconfig ${IFACE} inet6 add ${x} >/dev/null
eend 0
done
save_options "inet6" "${inet6_IFACE}"
fi

if [ -n "${gateway}" ] && [ "${gateway%/*}" = "${IFACE}" ]
then
ebegin " Setting default gateway"
# First delete any existing routes if it was setup by kernel ..
/sbin/route del default dev ${gateway%/*} &>/dev/null
/sbin/route add default gw ${gateway#*/} dev ${gateway%/*} \
netmask 0.0.0.0 metric 1 >/dev/null || {

local error=$?
ifconfig ${IFACE} down &>/dev/null
eend ${error} "Failed to bring ${IFACE} up"
stop
return ${error}
}
eend 0

fi

# Enabling rp_filter causes wacky packets to be auto-dropped by
# the kernel
if [ -e /proc/sys/net/ipv4/conf/${IFACE}/rp_filter ]
then
echo 1 > /proc/sys/net/ipv4/conf/${IFACE}/rp_filter
fi
}

stop() {
local myalias="$(get_options alias)"
local myinet6="$(get_options inet6)"

setup_env

ebegin "Bringing ${IFACE} down"

# Also down the inet6 interfaces
if [ -n "${myinet6}" ]
then
local x=""
for x in ${myinet6}
do
/sbin/ifconfig ${IFACE} inet6 del ${x} >/dev/null
done
fi
# Do some cleanup in case the amount of aliases change
if [ -n "${myalias}" ]
then
local x=""
local num=0
for x in ${myalias}
do
/sbin/ifconfig ${IFACE}:${num} down >/dev/null
num=$((num + 1))
done
fi

if [ "${iface_IFACE}" = "dhcp" ]
then
local count=0
while /sbin/dhcpcd -k ${IFACE} &>/dev/null && [ "${count}" -lt 9 ]
do
# Give dhcpcd time to properly shutdown
sleep 1
count=$((count + 1))
done
if [ "${count}" -ge 9 ]
then
eerror "Timed out trying to stop dhcpcd"
fi
else
/sbin/ifconfig ${IFACE} down >/dev/null
fi
eend 0
}


# vim:ts=4
Quote:
Quote:
Back to top
View user's profile Send private message
ghost5316
n00b
n00b


Joined: 18 Aug 2003
Posts: 35

PostPosted: Wed Dec 17, 2003 7:04 pm    Post subject: Reply with quote

Also, for right now both the cards are on the same network... So yes, there's dhcp on the network for both the cards.
Back to top
View user's profile Send private message
dlambeth
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 123
Location: San Antonio, TX

PostPosted: Wed Dec 17, 2003 7:17 pm    Post subject: Reply with quote

can you send me your a direct email address so I can send you back the correct modifications?
_________________
Darwin L. Lambeth
Network Administrator/Developer
FPMI
dlambeth@darwinsdomain.com
Back to top
View user's profile Send private message
ghost5316
n00b
n00b


Joined: 18 Aug 2003
Posts: 35

PostPosted: Wed Dec 17, 2003 7:26 pm    Post subject: Reply with quote

mbald@world123.net
Back to top
View user's profile Send private message
ghost5316
n00b
n00b


Joined: 18 Aug 2003
Posts: 35

PostPosted: Wed Dec 17, 2003 8:49 pm    Post subject: Reply with quote

it said there was a syntax error in the net.eth0 files
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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