LinuxQuestions.org
Visit Jeremy's Blog.
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 10-19-2009, 03:43 AM   #1
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 433

Rep: Reputation: 30
Machine tries to connect through wrong interface.


Hi,

I have a machine with 2 NIC cards.

eth0 is set up as a static IP (67.x.x.x) on the Internet.

eth1 is connected to a local Lan (10.0.0.2) via a switch.

eth1 is static and is configured as a dhcp-server.

when I ping my DNS:

ping 80.247.148.142
From 10.0.0.2 Network host unreachable

if I stop the interface with 'ifconfig eth1 down' then it connects as expected.

What have I missed?
 
Old 10-19-2009, 04:05 AM   #2
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
Linux Routing Tables

Greetingz!

Your routes seem hosed.

To view your current routing table;

Code:
netstat -rn
or

Code:
route -nNvee
I would suggest you save, write down, or otherwise note the configuration of your routes prior to messing with them. If you can't revert back, this can turn into a big headache!

To add a default route to your eth0 NIC;

Code:
route add default gw x.x.x.x eth0
To add route to talk to your 10.x.y.z network;
Code:
route add -net 10.0.0.0 netmask 255.0.0.0 eth1
check your man pages for your Linux distribution to be sure of the command's syntax.

Also, once you get this worked out, you may want to check the documentation of your Linux distribution to find out how to configure the routes to be persistent across reboots.
 
Old 10-19-2009, 04:18 AM   #3
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 433

Original Poster
Rep: Reputation: 30
Ah.

Thanks. This was the first time I'm trying this and, yes, I haven't set my routes up yet. I've installed quagga, but I'm starting to think that this is overkill for what I am trying to achieve. ie. a connection between the 10.x.x.x Lan and the 67.x.x.x Wan.
 
Old 10-19-2009, 05:23 AM   #4
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
Wow, well, If you're trying to do "Internet Connection Sharing" for the systems on your 10.x.y.z network, you may want to read up on "IP Masquerading".

However, if you're trying to setup a Linux server as a router, so it can interact with other routers, I suppose quagga would fit the bill nicely.
 
  


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
Dovecot imap will not connect from remote machine but will connect local charlesnorman Linux - Server 2 05-15-2008 03:23 PM
Printing from Debian machine to Win machine, What I did wrong. sarajevo Debian 8 04-30-2008 11:08 PM
how to connect a window machine to linux machine sibi_mangadan Linux - Newbie 5 03-29-2008 01:30 PM
ping on wrong interface despite route ocgltd Linux - Networking 1 09-26-2005 11:23 PM
Samba: can't connect to my local linux machine but can connect to windows. Royle Linux - Networking 3 01-18-2005 05:32 PM

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

All times are GMT -5. The time now is 02:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration