Toon posts:

[Slackware 8.0]Netwerk probleem met 2 kaarten

Pagina: 1
Acties:
  • 33 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik heb een linux bak (Slackware 8.0) met daarin 2 netwerkkaarten. Dmv netconfig laat ik eth0 automatisch internet krijgen. Nu wil ik eth1 configureren voor het netwerk. Dit doe ik nu nog door gewoon het commando:

ifconfig eth1 192.168.0.3 netmask 255.255.255.0 up

in te voeren. Hierdoor kan ik wel al pingen met de andere pc's in het netwerk, maar dmv ssh kan ik de pc niet overnemen.

SSH werkt wel als ik de internetkabel uit eth0 haal en de kabel van eth1 hier invoer. Dmv netconfig laat ik de pc dan configureren en dan werkt het netwerk wel. Alleen dan heb ik weer geen internet.

Hoe moet ik dit nu oplossen zodat het automatisch goed wordt gezet?

Verwijderd

kijk is in /etc/ssh/sshd_config daar kan je het een en ander instellen

Verwijderd

Topicstarter
k.. zal ik doen.. maar waar kan ik ervoor zorgen dat automatisch het netwerk en de internetverbinding wordt gestart als ik de pc aanzet?

Verwijderd

Start je sshd voor of nadat je eth1 opbrengt? Als je n'l sshd start voordat je eth1 op is, zal sshd daar niet aan binden...

Verwijderd

Nadeel van netconfig is dat er maar 1 netwerkkaart ondersteund wordt. Als je een tweede aan de praat wilt hebben dan moet je aan het aanpassen van het rc.inet1 . Slackware 8.1 heeft dat script wel voor 2 kaarten geschikt gemaakt , maar netconfig nog steeds maar 1.
Wat je kunt doen is het onderstaande script je huidige /etc/rc.d/rc.inet1 laten vervangen. Dit is het Slackware 8.1 rc.inet1 script:
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#! /bin/sh
# /etc/rc.d/rc.inet1
# This script starts up the base networking system.
#
# Version:
# @(#)/etc/rc.d/rc.inet1 8.1 Tue May 28 15:27:39 PDT 2002 (pjv)

# Edit these values to set up your first Ethernet card (eth0):
IPADDR="127.0.0.1"  # REPLACE with YOUR IP address!
NETMASK="255.255.255.0" # REPLACE with YOUR netmask!
# Or, uncomment the following lines to set up eth0 using DHCP:
USE_DHCP=yes
# If your provider requires a DHCP hostname, uncomment and edit below:
#DHCP_HOSTNAME="CCHOSTNUM-A"

# Edit these values to set up your second Ethernet card (eth1),
# if you have one.  Otherwise leave it configured to 127.0.0.1,
# or comment it out, and it will be ignored at boot.
IPADDR2="127.0.0.1"  # REPLACE with YOUR IP address!
NETMASK2="255.255.255.0" # REPLACE with YOUR netmask!
# Or, uncomment the following lines to set up eth1 using DHCP:
#USE_DHCP2=yes
# If your provider requires a DHCP hostname, uncomment and edit below:
#DHCP_HOSTNAME2="CCHOSTNUM-A"

# Edit the next line to point to your gateway:
GATEWAY="" # REPLACE with YOUR gateway!

# You shouldn't need to edit anything below here.

# Set up the loopback interface:
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

# Set up the eth0 interface:
if [ "$USE_DHCP" = "yes" ]; then # use DHCP to set everything up:
  echo "Attempting to configure eth0 by contacting a DHCP server..."
  # Add the -h option to the DHCP hostname:
  if [ ! "$DHCP_HOSTNAME" = "" ]; then
    DHCP_HOSTNAME="-h $DHCP_HOSTNAME"
  fi
  /sbin/dhcpcd -t 10 ${DHCP_HOSTNAME} -d eth0
elif [ ! "$IPADDR" = "127.0.0.1" -a ! "$IPADDR" = "" ]; then # set up IP statically:
  # Determine broadcast and network addresses from the IP address and netmask:
  BROADCAST=`/bin/ipmask $NETMASK $IPADDR | cut -f 1 -d ' '`
  NETWORK=`/bin/ipmask $NETMASK $IPADDR | cut -f 2 -d ' '`
  # Set up the ethernet card:
  echo "Configuring eth0:"
  echo "ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}"
  /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
  # If that didn't succeed, give the system administrator some hints:
  if [ ! $? = 0 ]; then
    echo "Your eth0 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 run netconfig"
    echo "   and configure your machine for loopback. (Unless you don't mind seeing this"
    echo "   error...)"
  fi
fi # set up eth0

# Set up the eth1 interface:
if [ "$USE_DHCP2" = "yes" ]; then # use DHCP to set everything up:
  echo "Attempting to configure eth1 by contacting a DHCP server..."
  # Add the -h option to the DHCP hostname:
  if [ ! "$DHCP_HOSTNAME2" = "" ]; then
    DHCP_HOSTNAME2="-h $DHCP_HOSTNAME2"
  fi
  /sbin/dhcpcd -t 10 ${DHCP_HOSTNAME2} -d eth1
elif [ ! "$IPADDR2" = "127.0.0.1" -a ! "$IPADDR2" = "" ]; then # set up IP statically:
  # Determine broadcast and network addresses from the IP address and netmask:
  BROADCAST2=`/bin/ipmask $NETMASK2 $IPADDR2 | cut -f 1 -d ' '`
  NETWORK2=`/bin/ipmask $NETMASK2 $IPADDR2 | cut -f 2 -d ' '`
  # Set up the ethernet card:
  echo "Configuring eth1:"
  echo "ifconfig eth1 ${IPADDR2} broadcast ${BROADCAST2} netmask ${NETMASK2}"
  /sbin/ifconfig eth1 ${IPADDR2} broadcast ${BROADCAST2} netmask ${NETMASK2}
  # If that didn't succeed, give the system administrator some hints:
  if [ ! $? = 0 ]; then
    echo "Your eth1 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 eth1. (Unless you don't mind"
    echo "   seeing this error...)"
  fi
fi # set up eth1

# Set up the gateway:
if [ ! "$GATEWAY" = "127.0.0.1" -a ! "$GATEWAY" = "" ]; then
  /sbin/route add default gw ${GATEWAY} metric 1
fi

# End of /etc/rc.d/rc.inet1

Je moet deze even kritisch doorlopen en afstemmen op jouw situatie.
Ik vermoed namelijk dat je geen goede route hebt en bovenstaande script regelt dat ook voor je. De comments spreken voor zich.

+titelfix

  • RupS
  • Registratie: Februari 2001
  • Laatst online: 22-01 12:46
Verwijderd schreef op 27 February 2003 @ 14:44:
maar waar kan ik ervoor zorgen dat automatisch het netwerk en de internetverbinding wordt gestart als ik de pc aanzet?
Hoogstwaarschijnlijk in /etc/rc.conf
Ik ken slackware niet zo goed, maar probeer `man rc.conf` eens...

edit:
Laat maar, zie vrotogel :+

[ Voor 7% gewijzigd door RupS op 27-02-2003 14:50 ]


Verwijderd

Topicstarter
Verwijderd schreef op 27 February 2003 @ 14:45:
Start je sshd voor of nadat je eth1 opbrengt? Als je n'l sshd start voordat je eth1 op is, zal sshd daar niet aan binden...
erna

Verwijderd

ThaRups schreef op 27 February 2003 @ 14:49:
[...]


Hoogstwaarschijnlijk in /etc/rc.conf
Ik ken slackware niet zo goed, maar probeer `man rc.conf` eens...

edit:

Laat maar, zie vrotogel :+
/etc/rc.d/rc.inet1

zoals vrotogel ook al zei.
ik heb ook gewoon met netconfig eth0 gedaan en toen wat prutsen in inet1 :) en voila. dat idd ff aanpassen en klaar is kees.

Verwijderd

Topicstarter
vrotogel. dit script werkt niet. wanneer ik dit script gebruik wordt er helemaal nix gerunt

Verwijderd

Met dat script is niks mis, echter je moet het nog wel configgen naar jouw situatie. Daarvoor staan die comments met toelichting er dus in. Zoals het hier staat gebruikt het 1 nic op dhcp. En heb je je script executable gemaakt ? De standaard rechten zijn 755 en user en group zijn root.
Daarnaast kan het zo zijn dat je ook een regeltje op te nemen in /etc/rc.d/rc.netdevices waarin je de module laadt voor je 2e nic.

Verwijderd

Topicstarter
k.. ik heb het script niet ececutable gemaakt. dat moet ik dus nog doen. hoe doe ik dat dan? en ik zal eens kijken in netdevices

Verwijderd

chmod u+x rc.inet1

?

Verwijderd

Verwijderd schreef op 27 February 2003 @ 19:00:
k.. ik heb het script niet ececutable gemaakt. dat moet ik dus nog doen. hoe doe ik dat dan? en ik zal eens kijken in netdevices

[rml]-=[ Nieuw in NOS? Eerst dit lezen! GEEN HELPDESK! ]=-[/rml]
Dit soort vragen horen niet in NOS. Hoe je met rechten omgaat is te lezen in de FAQ Non-Windows Operating Systems - Update: 13/02 .
Lees ook het eerstgenoemde draadje maar eens door.
Pagina: 1

Dit topic is gesloten.