View previous topic :: View next topic |
Author |
Message |
grepcomputers Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 16 Sep 2003 Posts: 375
|
Posted: Sat Oct 11, 2003 3:19 am Post subject: 2 net connections, why are they interfering with one another |
|
|
I have eth0 and eth1, both on a dual head eepro100 card (two chips, to jacks, one card).
eth0 is connected to my school network, eth1 to my laptop via crossover cable. My laptop is set to share it's other network connection, so is running a fake dhcp server (laptop is running win2k)
in /etc/conf.d/net:
iface_eth0="dhcp"
iface_eth1="dhcp"
...
gateway="eth0/134.82.104.254"
gateway="eth1/192.168.0.1"
the gateway settings are correct, as they are what are used if allowed to be set via dhcp. I still have this problem even if there is no gatway stuff...
So, the problem: I enable eth0 "/etc/init.d/net.eth0 start" and all is well and good, but as soon as I enable net.eth1, I can no longer access the network. Pings time out...can't webbrowse, etc.
Why are the connections interfering with one another? Also, one day I hope to be able to share my school connection through my desktop to my laptop...
cheers...
...grep |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
flying_walus n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 07 Sep 2002 Posts: 58
|
Posted: Sat Oct 11, 2003 7:13 am Post subject: |
|
|
when you set the "gateway" you're setting the default route for the machine. have a look at the output of netstat -r before you start eth1, and after it.
if you tell the machine that the default route to the rest of the net is through the laptop, it's going to send all it's packets that way. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
grepcomputers Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 16 Sep 2003 Posts: 375
|
Posted: Wed Oct 15, 2003 1:09 am Post subject: |
|
|
netstat, before and after eth1 start:
Code: | bash-2.05b# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
134.82.104.0 * 255.255.255.0 U 40 0 0 eth0
loopback localhost 255.0.0.0 UG 40 0 0 lo
default 134.82.104.254 0.0.0.0 UG 40 0 0 eth0
bash-2.05b# /etc/init.d/net.eth1 start
* Bringing eth1 up... [ ok ]
bash-2.05b# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 * 255.255.255.0 U 40 0 0 eth1
134.82.104.0 * 255.255.255.0 U 40 0 0 eth0
loopback localhost 255.0.0.0 UG 40 0 0 lo
default 192.168.0.1 0.0.0.0 UG 40 0 0 eth1 |
my /etc/conf.d/net file:
Code: | # /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="207.170.82.202 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/134.82.104.254"
#gateway="eth1/192.168.0.1"
|
With this setup, once I bring eth1 up, I can ping 134.82.104.254 (the switch/router), but nothing outside of it. When I booted with them both beign enabled, all my daemons failed to load properly - cause they couldn't get network, I assume...
I'm wondering...do I need to do something with the broadcast or netmask? And why does the destination always end in *.0?
I just found out that when I initialize eth1 *before* eth0, everything works. so how do I add them to the rc-update list so that they start in that order? ok, everything works, but not dns, it appears. it seems to be randomly doing different things as I start and stop the two interfaces. I cannot seem to find any connections. but I do know that even with both of them up I can ping an IP, it just can seem to resolve the DNS...
cheers...
...grep |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
devon l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 23 Jun 2003 Posts: 943
|
Posted: Wed Oct 15, 2003 8:24 am Post subject: |
|
|
grepcomputers wrote: | I'm wondering...do I need to do something with the broadcast or netmask? |
No. You are using DHCP on both interfaces, so the broadcast and netmask are set for you.
grepcomputers wrote: | And why does the destination always end in *.0? |
Because those are the network addresses for the two /24s (255.255.255.0 subnet mask) you are connected to. You machine has an interface on 132.82.104.0/24 and an interface on 192.168.0.0/24. The /24 means any host from 132.82.104.0 to 132.82.104.255. For example, the line "192.168.0.0 * 255.255.255.0 U 40 0 0 eth1" says "to reach any machine from 192.168.0.0 to 192.168.0.255, I will use the local route out my eth1 interface".
If you want to learn more about IP addressing, I suggest 3Com's PDF file that explains it in-depth.
It sounds like the DHCP server that your laptop is running is stomping all over the DHCP settings you got from your school network. I would try the following in your /etc/conf.d/net file.
Code: | dhcpcd_eth1="-G -R" |
That prevents the DHCP server on eth1 from overwriting the default gateway and DNS servers you got from your school network. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
grepcomputers Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 16 Sep 2003 Posts: 375
|
Posted: Wed Oct 15, 2003 4:09 pm Post subject: |
|
|
thanks, that seems to have fixed it!
netstat-r:
Code: |
bash-2.05b# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 * 255.255.255.0 U 40 0 0 eth1
134.82.104.0 * 255.255.255.0 U 40 0 0 eth0
loopback localhost 255.0.0.0 UG 40 0 0 lo
default 134.82.104.254 0.0.0.0 UG 40 0 0 eth0
bash-2.05b#
|
I'm a little confused, though, I'm not sure where to get information regarding dhcpcd settings?
cheers...
...grep |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
devon l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 23 Jun 2003 Posts: 943
|
Posted: Wed Oct 15, 2003 10:27 pm Post subject: |
|
|
grepcomputers wrote: | I'm a little confused, though, I'm not sure where to get information regarding dhcpcd settings? |
You mean like the -R and -G options I supplied you? If so, just type "man dhcpcd" at a prompt. Want to know more information about the command "ls"? Type "man ls". Command "foo"? "man foo". We use man pages to read about different options and usage for a program. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
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
|
|