View Full Version : How to add a route table for eth1 and make it the default
banner
2005-05-08, 07:26 AM CDT
I currently have two network cards, eth0 is for my private network for my thin clients and my wireless pci card is set up as eth1 in which i want this to be the gateway for my internet acccess. currnetly my route table looks like this below.
root@bangde ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.1.4 0.0.0.0 UG 0 0 0 eth0
[root@bangde ~]#
as you see there is no gate way for eth1 it does not even show up, but it is confugured properly as i can see all the details in wifi tools area about it.
I would like to know how to add a route entry for eth1 and make that the default route.
Thank you.
tashirosgt
2005-05-09, 09:10 AM CDT
I've asked about the standard way to associate IPs with eth's several times, but have gotten no advice. If eth1 shows up in the output of the command
ifconig
then you can put a script in /etc/rc.d/rc.local that says something like:
ifconfig eth1 192.xxx.yyy.zzz
The only trouble with this is that some process which needs eth1 may be started before this script runs, a process started by some other script in /etc/rc.d/*.
Reasoning by supersition and ignorance, it seems that the standard Fedora way would be to put a script called ifcfg-eth1 in /etc/sysconfig/network-scripts that would bring up eth1. One would be hoping that there is some other script that runs all the scripts in that directory.
(There is a command called nameif that says it will associate a given eth* with a given hardware address. But I have never seen an /etc/mactab on a Fedora machine. I tried creating one and it didn't work. Perhaps running nameif must also be put in a script.)
AndyGreen
2005-05-09, 09:20 AM CDT
What does your
ifconfig
currently show? How are you setting the IPs... via
system-config-network?
banner
2005-05-09, 09:47 AM CDT
hi there, my if config looks like this. How does it look like now to you?
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0B:6A:D4:71:C5
inet addr:192.168.2.1 Bcast:192.168.2.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500
Metric:1
RX packets:1165129 errors:0 dropped:0
overruns:0 frame:0
TX packets:1191926 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:162358184 (154.8 MiB) TX
bytes:238301702 (227.2 MiB)
Interrupt:11 Base address:0xe00
eth1 Link encap:Ethernet HWaddr 00:04:E2:DA:82:80
inet addr:192.168.1.105 Bcast:255.255.255.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500
Metric:1
RX packets:70 errors:0 dropped:0 overruns:0
frame:0
TX packets:64 errors:2 dropped:0 overruns:0
carrier:0
collisions:0 txqueuelen:1000
RX bytes:10561 (10.3 KiB) TX bytes:9904 (9.6
KiB)
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:9936 errors:0 dropped:0 overruns:0
frame:0
TX packets:9936 errors:0 dropped:0 overruns:0
carrier:0
collisions:0 txqueuelen:0
RX bytes:4669408 (4.4 MiB) TX bytes:4669408
(4.4 MiB)
AndyGreen
2005-05-09, 10:09 AM CDT
It looks okay, but it looks like it no longer matches the route that you gave earlier? Can you give the results of
route
again?
banner
2005-05-09, 10:20 AM CDT
I did a fresh install of fedora again starting from scratch. that is why it looks diffferent . I will give you the route informaion that i got from Route command. But i am still confused why my wireless pci card does not show up in the I.P Routing Table, it only shows eth0 which is for my thin clients.
[root@localhost ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
[root@localhost ~]#
AndyGreen
2005-05-09, 10:29 AM CDT
Whatever the reason is for not having a routing table entry for eth1, I should think it is the same reason for this mysterious action
inet addr:192.168.1.105 Bcast:255.255.255.255
Mask:255.255.255.0
The mask is shown correctly as /24 but the broadcast address is completely crazy as if the mask was /0. This was also the case on the previous install. Something is clearly going wrong here.
What does
cat /etc/sysconfig/networking/devices/ifcfg-eth1
and
ls /etc/sysconfig/networking/devices
say?
banner
2005-05-09, 11:06 AM CDT
This is my information
# Please read /usr/share/doc/initscripts*/
sysconfig.txt
# for the documentation of these parameters.
IPV6INIT=no
ONBOOT=yes
USERCTL=no
PEERDNS=yes
GATEWAY=
TYPE=Wireless
DEVICE=eth1
HWADDR=00:04:e2:da:82:80
BOOTPROTO=dhcp
NETMASK=
DHCP_HOSTNAME=
IPADDR=
DOMAIN=
ESSID=
CHANNEL=1
MODE=Auto
RATE=6Mb/s
AndyGreen
2005-05-09, 11:46 AM CDT
Seems that your DHCP server is misconfigured about the netmask for eth1, assuming the DHCP action is working okay. Consider setting it to a static IP/netmask/gateway if possible.
The channel and rate look wrong too, in which was DHCP should fail. Am I missing something? How does eth1 get its IP address in this case?
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.