LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-29-2008, 11:24 AM   #1
clintp
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
Two interfaces routing problem, Debian, kernel 2.4


I have AT&T U-Verse as my provider. The routing device they supply has a quirk that's making life difficult.

To pass all incoming requests to a device on my network, that device has to have a dynamic IP. I'm fine with that. However, that device I also use for other things on the internal network. As its address changes, the internal machines (mix of linux/windows) need to have the new address given to them and that's a pain.

So I installed a second interface. This interface I've given a static IP address (192.168.1.13), and have pointed my internal machines to it for services.

The problem is this: that box can no longer communicate outside my network (no internet). Internally, everything's fine. Externally, nothing.

Here's the ifconfig:

Code:
eth0      Link encap:Ethernet  HWaddr 00:C0:4F:72:E1:FF
          inet addr:192.168.1.13  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:785094 errors:0 dropped:0 overruns:166 frame:0
          TX packets:112220 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:150695813 (143.7 MiB)  TX bytes:22274993 (21.2 MiB)
          Interrupt:19 Base address:0xdc00

eth1      Link encap:Ethernet  HWaddr 00:50:BF:16:92:70
          inet addr:99.13.10.182  Bcast:99.13.11.255  Mask:255.255.252.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:598193 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44946 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:46530563 (44.3 MiB)  TX bytes:5414705 (5.1 MiB)
          Interrupt:17 Base address:0xc00
And the routing table (route -n):

Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
99.13.8.0       0.0.0.0         255.255.252.0   U     0      0        0 eth1
0.0.0.0         99.13.8.1       0.0.0.0         UG    0      0        0 eth1
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0
Where have I screwed this up, and how do I fix it?
 
Old 10-29-2008, 08:25 PM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
try
Code:
# ip route del default dev eth0
Quote:
So I installed a second interface.
Unless your hardware is weird (i.e. old), you can have multiple IP addresses on the same NIC.
Code:
# ifconfig eth0:internal 192.168.0.1
Note that in some cases (multipath routing, for one), "ip route" shows more information than "route"
 
Old 10-30-2008, 08:14 AM   #3
jlarson
LQ Newbie
 
Registered: Oct 2008
Posts: 6

Rep: Reputation: 0
/etc/network/interfaces

I'm not sure of where your distro stores network settings, but this is what I would do with /etc/network/interfaces in debian:

Code:
auto eth0
iface eth0 inet static
        address 192.168.1.13
        netmask 255.255.255.0
auto eth0:0
iface eth0:0 inet dhcp
Then:

Code:
/etc/init.d/networking restart
You shouldn't need multiple NICs.
 
Old 10-30-2008, 01:58 PM   #4
clintp
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Deleting the route worked.

Quote:
Originally Posted by jonaskoelker View Post
try
Code:
# ip route del default dev eth0

Unless your hardware is weird (i.e. old), you can have multiple IP addresses on the same NIC.
Code:
# ifconfig eth0:internal 192.168.0.1
Note that in some cases (multipath routing, for one), "ip route" shows more information than "route"
Deleting the route worked. I don't know why I didn't think of that. (Although "ip" isn't a valid command on this distribution. "route del..." did the trick.)

I tried using two addresses for the same NIC but for some reason, I couldn't get it to use DHCP on one and static on the other. Since the machine already had another NIC card in it (from when it functioned as my firewall) enabling the second one wasn't a big deal.
 
Old 10-31-2008, 12:24 AM   #5
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
Quote:
I tried using two addresses for the same NIC but for some reason, I couldn't get it to use DHCP on one and static on the other.
Try doing the dhcp request first and the static assignment later; I wouldn't be surprised if your dhcp daemon drops all configuration from the interface when first started, including aliased IP addresses.
(Sorry, I'm too lazy to test this myself)

Code:
auto eth0
iface eth0 inet dhcp
auto eth0:0
iface eth0:0 inet static
        address 192.168.1.13
        netmask 255.255.255.0
 
  


Reply



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
Problem with routing via different external interfaces (eth and tun) juliensweiss Linux - Networking 1 09-13-2008 09:49 AM
IP Routing between interfaces. mpr104 Linux - Networking 2 11-05-2006 01:19 AM
Routing between 2 interfaces? m4rk0 Linux - Networking 18 03-08-2006 01:08 AM
Routing between interfaces? cryptical Linux - Networking 13 08-18-2004 07:29 AM
Problem with routing between interfaces Kostko Linux - Networking 6 12-01-2003 01:47 PM

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

All times are GMT -5. The time now is 04:17 PM.

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