LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   slackware lan network configuration problem (https://www.linuxquestions.org/questions/slackware-14/slackware-lan-network-configuration-problem-646095/)

martysha 05-31-2008 02:52 PM

slackware lan network configuration problem
 
hi, it's me again :p

i'm trying to configure my lan connection. i have a static ip, mask and gateway that are succesfully working on my windows.

now, the all story ( with codes this time)

1. i did netconfig. followed the steps. ok. i reboot, no ping to gateway
Code:

Network unreachable
2. retried to configure it in control center in kde - nothing. when i choose network settings there it gives me
Code:

Could not parse the XML output from the network configuration
:rolleyes:

3. found netconfig file in sbin, tried to rewrite the info for eth0 and eth1 (was not sure which exactly lan card i'm using), reboot, ping
Code:

Network unreachable
4. ifconfig
Code:

lo link encap local, looback
inet addr 127.0.0.1 mask 255.0.0.0
inet6 addr 1/128 Scope: Host
UP LOOPBACK RUNNING MTU 16436 Metric: 1
RX packets:12 err:0 dropp: 0 overrid: 0 frame: 0
TX packets:12 err:0 dropp: 0 overrid: 0 carr: 0
coll:0 txqueuelen: 0
RX bytes: 1080 TX bytes: 1080

:confused: that was not possible! i've already chosen at least 5 times ethernet static ip connection

5. tried to reopen netconfig and comment all lines about loopback -- nothing
Code:

root@martysha: netconfig
sbin/netconfig: Permission denied

:eek: :cry:

6. reboot, connect to your site, read the thread of Cuetzpallin and after that: succesfully detected that my lan card in use is eth1.
Code:

ifconfig eth1 [my ip] netmask [my mask]
7. yes! at least i have now connection... no. there is a traffic but i cannot ping the gateway --- and i don't know how to set the gateway!! it's not set, and i have a broadcast address configured from somewhere! tried with ifconfig eth1 tunnel [my address] - no result

8. so, conclusion:
a) i want to set up my gateway
b) still "permission denied" for netconfig - maybe i did something very very wrong
c) still "could not parse the XML output from the network configuration" when i try to open network settings in kde
d) ifconfig - still loopback !
e) lan card connected and there is a traffic - at least that!!!

please don't laugh so loudly ;)

alan_ri 05-31-2008 04:06 PM

Open /etc/rc.d/rc.inet1.conf file as root and enter your configuration,save and reboot.

T3slider 05-31-2008 04:25 PM

The local loopback device is is supposed to be there. Without it, X probably won't work (and a lot of services). `ifconfig -a` will show ALL available interfaces, and therefore should show eth1 (if that is the interface). You should NEVER edit netconfig -- that's really not what it's for. It's a script to setup your network, and nothing more. If you want to edit something, edit /etc/rc.d/rc.inet1.conf, as alan_ri said.

Post the output of `ifconfig -a` and `route -n`. If I were you I would download the network-scripts-12.1-noarch-1.tgz package from your favourite mirror (it's in the slackware/n/ directory), and do the following (OUTSIDE of X, still in the console) as root:
Code:

# telinit 1
# upgradepkg --reinstall /path/to/network-scripts-12.1-noarch-1.tgz
# telinit 3

That way you will restore your netconfig file. You could also just extract the file from the package (it's just a gzipped tar archive), but the other way is more elegant.

You should also post the output of `lspci -vv` and `lsmod` (use the code tags).

martysha 05-31-2008 06:12 PM

report

like alan_ri said, i've opened rc.inet1.conf - and everything was already configured
default gateway also :scratch:

i will download and replace my netconfig file, as T3slider suggested.

now, still the same. eth1 - my lan card in use, is connected, there is traffic used, but no gateway set up. how could i setup it ? tomorrow i will replace netconfig and try again.

the codes:

i have 2 lan cards:
Code:

bash-3.1# ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:1d:7d:01:32:48

          inet addr:**.**.222.18  Bcast:**.**.222.63  Mask:255.255.255.192

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          Interrupt:16 Base address:0xc000


eth1      Link encap:Ethernet  HWaddr 00:e0:4c:51:53:2e

          inet addr:**.**.222.18  Bcast:**.**.222.63  Mask:255.255.255.192

          inet6 addr: fe80::2e0:4cff:fe51:532e/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:731 errors:0 dropped:0 overruns:0 frame:0

          TX packets:46 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:71984 (70.2 KiB)  TX bytes:2868 (2.8 KiB)

          Interrupt:21 Base address:0xd000


lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:41 errors:0 dropped:0 overruns:0 frame:0

          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:3228 (3.1 KiB)  TX bytes:3228 (3.1 KiB)

that is strange, my ip is **.**.222.18 and gateway missing

Code:

Destination    Gateway        Genmask        Flags Metric Ref    Use Iface

**.**.222.0    0.0.0.0        255.255.255.192 U    0      0        0 eth0

**.**.222.0    0.0.0.0        255.255.255.192 U    0      0        0 eth1

127.0.0.0      0.0.0.0        255.0.0.0      U    0      0        0 lo

0.0.0.0        **.**.222.1    0.0.0.0        UG    1      0        0 eth0


T3slider 05-31-2008 08:16 PM

Your `route -n` output shows that there is a gateway for eth0 but not eth1.If eth1 is the card you're trying to use (which based on your previous posts I suspect it is), then you'll have to add a gateway for eth1. Try the following command:
Code:

# route add default gw **.**.222.1 eth1
Assuming that **.**.222.1 is a valid gateway.

martysha 06-01-2008 03:36 AM

it's working! :cool:

so, first i tried to configure the gateway

Code:

route add default gw **.**.222.1 eth1
gateway was set up, and i was able to ping it, but when i was trying to open some site, it was

Code:

Unknown host
i've downloaded the package with the netconfig script, and replaced it, after that i've ran netconfig and now i have my connection working


thank you a lot!

martysha 06-01-2008 04:23 AM

no - it was just for a moment working and now it's not! grr

i rebooted for being sure that everything is ok. and - eth1 not connected

:confused:

Code:

bash-3.1# ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:1d:7d:01:32:48

          inet addr:**.**.222.18  Bcast:**.**.222.63  Mask:255.255.255.192

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          Interrupt:16 Base address:0x8000


eth1      Link encap:Ethernet  HWaddr 00:e0:4c:51:53:2e

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          Interrupt:22 Base address:0xd000


lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:16 errors:0 dropped:0 overruns:0 frame:0

          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:1376 (1.3 KiB)  TX bytes:1376 (1.3 KiB)

Code:

bash-3.1# route -n

Kernel IP routing table

Destination    Gateway        Genmask        Flags Metric Ref    Use Iface

**.**.222.0    0.0.0.0        255.255.255.192 U    0      0        0 eth0

127.0.0.0      0.0.0.0        255.0.0.0      U    0      0        0 lo

0.0.0.0        **.**.222.1    0.0.0.0        UG    1      0        0 eth0

i've looked in etc/rc.d/rc.inet1.conf - all the configuration missing for eth1

i've written it in the file and made one more time netconfig - nothing

what is going on with my lan card? :rolleyes:

maybe i have problems because i have two lan cards ? any ideas?

i'll go to reconfigure all-all-all files again...

onebuck 06-01-2008 08:00 AM

Hi,

Your output shows that 'eth0' is activated and has a IP with a kernel route table setup.

Post your '/etc/rc.d/rc.inet1conf' file.

T3slider 06-01-2008 02:25 PM

Post your /etc/rc.d/rc.inet1.conf, as onebuck said. Since netconfig isn't doing the trick, it's probably because of the multiple interfaces. You should try editing /etc/rc.d/rc.inet1.conf directly (you can probably copy the settings for your eth0 into the eth1 section, since they should be valid). Then run `/etc/rc.d/rc.inet1 restart` and it should be up and running (hopefully). Alternatively, you could add a udev rule to rename the interfaces (change eth1 to eth0 and vice versa), but that's really not necessary.

martysha 06-01-2008 04:07 PM

ok, me again with last report:

first, the inet1config file (this is after i filled again all the details, they've been lost for eth1, and i have not idea why:

Code:

# /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 ("").

# You can configure network interfaces other than eth0,eth1... by setting
# IFNAME[interface] to the interface's name. If IFNAME[interface] is unset
# or empty, it is assumed you're configuring eth<interface>.

# Several other parameters are available, the end of this file contains a
# comprehensive set of examples.

# =============================================================================

# Config information for eth0:
IPADDR[0]="**.**.222.18"
NETMASK[0]="255.255.255.192"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

# Config information for eth1:
IPADDR[1]="**.**.222.18"
NETMASK[1]="255.255.255.192"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

# Config information for eth2:
IPADDR[2]=""
NETMASK[2]=""
USE_DHCP[2]=""
DHCP_HOSTNAME[2]=""

# Config information for eth3:
IPADDR[3]=""
NETMASK[3]=""
USE_DHCP[3]=""
DHCP_HOSTNAME[3]=""

# Default gateway IP address:
GATEWAY="**.**.222.1"

# Change this to "yes" for debugging output to stdout.  Unfortunately,
# /sbin/hotplug seems to disable stdout so you'll only see debugging output
# when rc.inet1 is called directly.
DEBUG_ETH_UP="no"

## Example config information for wlan0.  Uncomment the lines you need and fill
## in your info.  (You may not need all of these for your wireless network)
#IFNAME[4]="wlan0"
#IPADDR[4]=""
#NETMASK[4]=""
#USE_DHCP[4]="yes"
#DHCP_HOSTNAME[4]="icculus-wireless"
#DHCP_KEEPRESOLV[4]="yes"
#DHCP_KEEPNTP[4]="yes"
#DHCP_KEEPGW[4]="yes"
#DHCP_IPADDR[4]=""
#WLAN_ESSID[4]=BARRIER05
#WLAN_MODE[4]=Managed
##WLAN_RATE[4]="54M auto"
##WLAN_CHANNEL[4]="auto"
##WLAN_KEY[4]="D5AD1F04ACF048EC2D0B1C80C7"
##WLAN_IWPRIV[4]="set AuthMode=WPAPSK | set EncrypType=TKIP | set WPAPSK=96389dc66eaf7e6efd5b5523ae43c7925ff4df2f8b7099495192d44a774fda16"
#WLAN_WPA[4]="wpa_supplicant"
#WLAN_WPADRIVER[4]="ndiswrapper"

## Some examples of additional network parameters that you can use.
## Config information for wlan0:
#IFNAME[4]="wlan0"              # Use a different interface name nstead of
                                # the default 'eth4'
#HWADDR[4]="00:01:23:45:67:89"  # Overrule the card's hardware MAC address
#MTU[4]=""                      # The default MTU is 1500, but you might need
                                # 1360 when you use NAT'ed IPSec traffic.
#DHCP_KEEPRESOLV[4]="yes"      # If you dont want /etc/resolv.conf overwritten
#DHCP_KEEPNTP[4]="yes"          # If you don't want ntp.conf overwritten
#DHCP_KEEPGW[4]="yes"          # If you don't want the DHCP server to change
                                # your default gateway
#DHCP_IPADDR[4]=""              # Request a specific IP address from the DHCP
                                # server
#WLAN_ESSID[4]=DARKSTAR        # Here, you can override _any_ parameter
                                # defined in rc.wireless.conf, by prepending
                                # 'WLAN_' to the parameter's name. Useful for
                                # those with multiple wireless interfaces.
#WLAN_IWPRIV[4]="set AuthMode=WPAPSK | set EncrypType=TKIP | set WPAPSK=thekey"
                                # Some drivers require a private ioctl to be
                                # set through the iwpriv command. If more than
                                # one is required, you can place them in the
                                # IWPRIV parameter (separated with the pipe (|)
                                # character, see the example).

after my rebooting there was no eth1 nowhere. inet1config, ifconfig, route --- like if my card was suddently gone somewhere with all the details i've entered.

so, i've made

1. netconfig
2. inet1config
3. route - add gateway

reboot

the gateway is missing again, no connection

again (i'm really stubborn)
1. netconfig
2. inet1config
3. route - add gateway

reboot
reboot

now it's working...hopefully... i think now to reboot to check again... but i cannot do that changes all the time!! :( every time i restart i lose my gateway or something

T3slider do you think that if i change eth0 and eth1 that will solve the problem?

T3slider 06-01-2008 04:40 PM

You should first try editing /etc/rc.d/rc.inet1.conf and ONLY putting the settings in eth1, leaving everything from eth0 blank. I would hope that would apply the gateway to eth1 and not eth0 -- but I'm definitely not an expert on the subject, so I may be wrong.

If you want to try switching eth0 and eth1, you should look in /etc/udev/rules.d/70-persistent-net.rules. It maps a network device to eth0 or eth1. You could switch the eth0 to eth1 and vice versa. It's probably better to create local rules instead of changing the default files, so you could create a copy of the 70-persistent-net.rules file and name it 10-local.rules, and change the eth0 and eth1 in there -- but I don't claim to know a lot about udev, so I don't know how well, if at all, this will work.

martysha 06-01-2008 04:48 PM

yeah, obviously rebooting is not a good idea :D

1. i've lost my gateway AGAIN
made #route add default gw
no internet (but eth1 well connected)
reboot
2. lost gateway again
inet1conf - eth1 missing again
added all
no internet
reboot
3. missing gateway and eth1 data.
netconfig, inet1.conf, add AGAIN the f***** gateway
no net connection
reboot
4. of course, no surprises now - gateway address is lost (only that this time
reenter all (netconfig, inet1.conf, gateway)
all is entered but no connection to internet
reboot
5. eth1 not connected :tisk:



i see one easy solution - do that 10 times again until it decides to work.. and .. do not switch off my pc anymore!!

martysha 06-01-2008 04:58 PM

T3slider, yeah, i'll try to fill only eth1 fields now. but i think that every time i run netconfig it makes configuration of eth0 only :rolleyes:

i'll try that and if it's not working, tomorrow i'll switch eth0 and eth1 like you suggested ;) thanks!

allend 06-01-2008 06:55 PM

You seem to be assigning the same IP address to both network cards. Some more information about your network topology would make for providing better advice.

bgeddy 06-01-2008 07:00 PM

T3Slider said :
Quote:

If you want to try switching eth0 and eth1, you should look in /etc/udev/rules.d/70-persistent-net.rules. It maps a network device to eth0 or eth1. You could switch the eth0 to eth1 and vice versa. It's probably better to create local rules instead of changing the default files, so you could create a copy of the 70-persistent-net.rules file and name it 10-local.rules, and change the eth0 and eth1 in there -- but I don't claim to know a lot about udev, so I don't know how well, if at all, this will work.
I would definitely set the udev rules so you can be sure which if is eth0 and which is eth1 between boots. I have had a machine seemingly randomly choose interfaces between reboots without a rule being set.

Quote:

T3slider, yeah, i'll try to fill only eth1 fields now. but i think that every time i run netconfig it makes configuration of eth0 only
Yes - netconfig sets up eth0.

I usually set up a udev rule so my internet i/f is eth0 then netconfig will work ok for this.

The udev rule can be set up to allocate an interface by Mac address ensuring eh0/1 are consistent.

At the moment I'm on a Slackware 12 box so I cannot comment on the correct udev rule setting as 12.1 has changed the rules file names but T3Slider has given instructions.


All times are GMT -5. The time now is 06:46 AM.