LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-13-2003, 04:23 AM   #1
Soma
LQ Newbie
 
Registered: Dec 2002
Posts: 24

Rep: Reputation: 15
Routing.


Distro: Debian Woody/stable
Network: 192.168.0.0
eth0: 192.168.0.10
eth1 (wireless): 192.168.0.11

I have a box that has a wireless interface and a ethernet interface that I want on the same network. I want the wireless interface to be the default gateway for the machine (ie. the gateway to the network 192.168.0.0), but when I set them both up routes are automatically setup for both cards. Ie:

192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1

Can anyone give a suggestion to make eth1 the only route to 192.168.0.0? I guess I will have to add host routes for the eth0 IP address as well?
 
Old 06-13-2003, 04:41 AM   #2
siddiqu
Member
 
Registered: Mar 2001
Location: India
Posts: 332

Rep: Reputation: 30
Hi..

It is not necessary to setup the rotues for the connected network. Both the cards will get the arp / broadcasts.

Siddiqu.T

 
Old 06-13-2003, 05:23 AM   #3
Soma
LQ Newbie
 
Registered: Dec 2002
Posts: 24

Original Poster
Rep: Reputation: 15
If I only set one interface up it works fine, I can ping other machines over the wireless connection. If I set the second one up I can't ping anything anymore, it all just times out.
 
Old 06-13-2003, 06:38 AM   #4
justinlq.org
LQ Newbie
 
Registered: Jun 2003
Distribution: RedHat 9
Posts: 11

Rep: Reputation: 0
Hi, I know nothing about Linux but as for IP networking I know this... I have never setup or seen 2 ethernet interfaces into the same network (except for load balancing & fault tolerance where they both share the same ip address) and cannot really imagine why it would be required. Unless you want to use a wired connection for when you are near your hub/switch/router and a wireless for when you are going outside for a coffee break... in this case you just have to disable/enable eth0 and eth1 as required.
The reason why both interfaces active in the same network does not work is to do with arp and mac addresses. You cannot have, as far as I am aware, 2 different mac addresses associated with 1 ip address. It's 1 for 1.
Hope this helps.
 
Old 06-13-2003, 06:41 AM   #5
justinlq.org
LQ Newbie
 
Registered: Jun 2003
Distribution: RedHat 9
Posts: 11

Rep: Reputation: 0
I will be even more surprised to hear that you got it working! A challenge?...
 
Old 06-13-2003, 06:43 AM   #6
justinlq.org
LQ Newbie
 
Registered: Jun 2003
Distribution: RedHat 9
Posts: 11

Rep: Reputation: 0
>The reason why both interfaces active in the same network >does not work is to do with arp and mac addresses. You cannot >have, as far as I am aware, 2 different mac addresses >associated with 1 ip address. It's 1 for 1.
Actually, just disreagard that bit. It doesn't apply to your situation...
 
Old 06-13-2003, 06:54 AM   #7
Soma
LQ Newbie
 
Registered: Dec 2002
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by justinlq.org
>The reason why both interfaces active in the same network >does not work is to do with arp and mac addresses. You cannot >have, as far as I am aware, 2 different mac addresses >associated with 1 ip address. It's 1 for 1.
Actually, just disreagard that bit. It doesn't apply to your situation...
Nope, I have two seperate IP's on two seperate interfaces, but on the same network.

Thanks so far guys. Anyone else?
 
Old 06-13-2003, 11:25 AM   #8
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
just to correct what some are saying:

you can have 2 interfaces sharing an IP on the same network,
that's what a bridge does. Makes 2 interfaces appear as 1 interface/1 IP. If you have 2 managed switches with IPs
192.168.1.3 and 192.168.1.4, you can connected them both to
the same router, bridge the interfaces, and make a logical 192.168.1.1 and the computers on both subnets wil have a default gateway of 192.168.1.1.

Soma, it's strange what you are asking. You want 2 network cards to be on the same netowrk, but you dont want one of them to be able to access it. Just disable the card or put it on a different network. I'm not sure if you can put them on the same netowork and then tell 1 not to use it....kinda like giving a child a toy and saying "dont play with this". What exactly are you trying to accomplish, what is your final goal...maybe I can help with that.
 
Old 06-13-2003, 11:52 AM   #9
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
i was just doing some research and came across something interesting:

you may be able to force all packets to go out through a certain interface using a combination of iptables and iproute2. in the example that is shown if you click on the link below, they forced all outgoing mail on one interface. You could do the same with all outgoing.

http://www.ibiblio.org/pub/Linux/doc...ARTC.NETFILTER

i have never used IP router though but the iptables part i do understand:

iptables -A PREROUTING -p tcp -j MARK --set-mark 1
that will mark all of your tcp packets

iptables -A PREROUTING -p upd -j MARD --set-mark 1
that wil mark all of your udp packets

now that they both have the same mark, the iproute part can
handle which interface stuff marked with 1 goes out on. Sounds intuitive but i've never set it up.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
routing jmono Linux - Networking 5 02-07-2006 06:20 AM
Routing gtkmike Linux - Networking 1 11-13-2003 09:21 AM
real routing under nat routing nothingmuch Linux - Networking 4 10-27-2003 03:11 PM
Routing in RH 8.0 Hybrid Blue Linux - Networking 2 10-12-2003 05:41 PM
Routing jimval7 Linux - Networking 3 02-08-2002 04:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration