# eth1 problem

## SewerBeing

on my laptop, the wireless card is recognized as eth1, I can ping the router with it, however I can't do anything else with it. How do I get it to be recognized as eth0, or make things work using eth1.

----------

## NeddySeagoon

SewerBeing,

This is a popular question and I keep posting the answer. I can't find it so I'll not suggest you search.

In /etc/init.d/ create a symbolic link named net.eth1 that points to net.eth0. This will be your script for starting eth1.

In /etc/conf.d edit the file net to add the setup you need for eth1. Use the examples provided for eth0 but change the eth0 to eth1.

Do not mess with the active eth0 entries of course.

With thad done, 

```
/etc/init.d/net.eth1 start
```

will bring up eth1.

If it works, 

```
rc-update add net.eth1 defualt
```

will start it at boot time.

----------

## SewerBeing

the problem with rc-update is this is a fedora core 2 laptop. And rc-update wont work on it. I'm trying your suggestion right now though. Also it will not save the key after a reboot, any fix for that? Could it be the fact that I manually assigned it the ip, and did not use dhcp (no clue how on fedora core 2). Your fix has not helped, trying a reboot. fix does not work.

----------

## NeddySeagoon

SewerBeing,

I run a scriot that calls iwconfig to load the key after the interface is up. The iwconfig commands could just be tacked on the end of any script that runs after the interface is up.

FC2 has similar startup mechanisims to gentoo, so the mechanisim can be generalised. Ih gave on on RH, when RH9 came out. I still have a RH8 install I could look at if you need a hand adapting my original post to FC2. Is the startup similar do you know ?

----------

## SewerBeing

I dont think it has changed from RH9 to FC2. I would be interested in your script. I check on the router and it does show the laptop as attached, yet no internet things work on the laptop. How do I use DHCP (my router is setup as the server) on FC2?

----------

## NeddySeagoon

SewerBeing,

The script is just two lines

ifconfig sorts out tthe IP address and brings the network up but does not set the wireless odds and ends, that requires iwconfig.

The contents of the script are 

```
iwconfig wlan0 essid any mode managed channel 2

iwconfig wlan0 enc [<key>
```

This is from my iPaq, running Familiar 0.7.2 unstable. to make it stand alone you need to add the magic comment 

```
#!/bin/bash
```

as the first line. Fill in your particular parameters.

I'll have a look at the RH setup later.

----------

## SewerBeing

the thing is ifconfig does not give it an ip address. On my gentoo rig (main rig) I need to use dhcp, however I have no idea how to do that on fc2.

----------

## SewerBeing

more bumpage

----------

## NeddySeagoon

SewerBeing,

Some of us have to sleep too. I'll get back here in about 12 hours.

----------

## SewerBeing

bump

----------

## NeddySeagoon

SewerBeing,

I got a new toy instead of reading the forums (Colour Laser Printer).

To make dhcp work yo need to run the iwconfig setup before you can broadcast for a DHCP address.

Broadcasting on the wrong channel with the wrong crypto will get yo nowhere.

In RH8 ( I dont have RH9 Installed) the following are approximately equivelent:- 

```
Gentoo          Red Hat 8

/etc/init.d        /etc/rc.d/init.d/

/etc/conf.d      /etc/sysconfig/ 
```

The script  /etc/rc.d/init.d/network brings up all the network interfaces based on data it finds in 

/etc/sysconfig/network for the default gateway and hostname

and in /etc/sysconfig/networking/devices/ for individual devices.

Look in /etc/sysconfig/networking/devices/ifcfg-eth0 for a free sample of what your /etc/sysconfig/networking/devices/ifcfg-eth1 should look like.

----------

## SewerBeing

that did nothing, it just ignores the script. What did you mean "iwconfig setup" all the settings are correct. I can ping other computers and the router assuming I manually assign it an ip address. Congratz on the new toy I'm jealous.

----------

## NeddySeagoon

SewerBeing,

To get a wifi link up, you need to assign it the wireless parameters such as channel, essid, crypto etc., before you can use it for anything or it will not talk to the other end. If you are using the defualts, expect a 'drive by hacking' any moment. A lot of other people will be using the defaults too. They offer no security at all.

When the radio link is up, you can use it to broadcast for an IP address using dhcp. Somehow, you need to run iwconfig on eth1 (or wlan0 or whatever the  port name is for your wifi), then run the network script to get the network an IP address. If you assign it an IP address and it just works all you neibours are probably using your wilreless link too.  

As a test, you can run iwconfig to manually set the wifi parameters the run the RH network script manually with  

```
/etc/rc.d/init.d/network restart
```

 This time your wifi should start. If this works, the hard bit is getting iwconfig to run at boot.

What is in your /etc/sysconfig/networking/devices/ifcfg-eth1 file ?

RH has had a graphical network setup tool since about version 6. Does it help you a t all?

----------

## SewerBeing

they are correct, I set them myself, even the key is in there. I can ping every computer on my network (192.168.0.X) including the router. However as soon as something goes outside it doesnt work. making it a DMZ server on the router does not help. The last tip did not help either  :Sad: . Could it be a router issue. BTW no one outside of this house is using my wifi thank you very much.

----------

## NeddySeagoon

SewerBeing,

Please post the output of 

```
/sbin/route -n
```

This should show something like

```
Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0

192.168.0.0     192.168.100.6   255.255.255.0   UG    0      0        0 eth0

127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo

0.0.0.0         192.168.100.1   0.0.0.0         UG    0      0        0 eth0
```

The key entry here is the last one, which is the default route. any packets that the routing table has not sent somewhere when this last rule is encountered are (in my case) sent to 192.168.100.1 via eth0.

Hopefully, you will have a rule to use eth1.

Is the content of /etc/resolv.conf correct?

It must contain at least one line like 

```
nameserver 192.168.100.1
```

You will have a different IP there.

----------

## SewerBeing

here is the /sbin/route -n output

```

Kernel IP routing table

Destination    Gateway        Genmask          Flags    Metric     Ref    Use Iface

```

 Thats all there is  :Sad: 

```

nameserver 167.206.3.170

nameserver 167.206.3.236

nameserver 167.206.3.171

search localdomain

```

Thats my resolv.conf file.

----------

## NeddySeagoon

SewerBeing,

Was your network up when you you did the route command?

You should always have 127.0.0.1, which is the local interface that network transparent things use to communicate. Thats having a network of one PC. Some *NIX thing break without it.

Depending on whats happening, it can take 30 sec  for the 

```
/sbin/route -n
```

 command to complete.

Your /etc/hosts file should contain at least the following:-

```
# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1       localhost.localdomain
```

Fix it if not (taken from RH8)

Create a default route manually with

```
route add default <IP_of_next_hop> ethN
```

Choose the correct interface for ethN

Does that improve your browsing any?

----------

## SewerBeing

well I added it, wouldn't let me make it the default but I added it, still no go. The weird thing is, the redhat network update thing says 24 things need to be upgraded. But it will not dl them.

----------

## NeddySeagoon

SewerBeing,

What dies /sbin/route -n show now ?

----------

## SewerBeing

it shows that added, and another one 192.168.0.0 using eth0.

----------

## NeddySeagoon

SewerBeing,

If your WiFi is eth1, you need your default route over eth1, not eth0.

What does /sbin/ifconfig show for your interfaces?

----------

## SewerBeing

eth1 is my WiFI, there is no eth0 route.

/sbin/ifconfig shows eth1 and lo.

----------

## SewerBeing

bump

----------

## NeddySeagoon

SewerBeing,

The debug info you are providing is a liitle on the brief side.

Can you copy and paste the output of the following commands into a post please?

/sbin/ifconfig

/sbin/route -n

less /etc/resolv.conf

----------

