LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setting default route w/ two nice (https://www.linuxquestions.org/questions/linux-networking-3/setting-default-route-w-two-nice-668121/)

muncherelli 09-07-2008 06:23 AM

Setting default route w/ two nice
 
-- SORRY THREAD TITLE SHOULD SAY NICS NOT NICE --

I am somewhat of a Linux N00b, so I apologize upfront if my terminology is not correct. And this is my first post to LinuxQuestions w00t :P.

At my house I have two seperate internet connections. One that feeds my server (Debian sid), and one that feeds my router. I have my server hooked to my router via eth0, and my internet connection (DHCP) directly connected to eth1.

What I want to do is make sure all traffic goes over eth1, and not eth0, since that bandwidth is for my router and any clients I have hooked up to the router. Right now any time I ping out from the server, it is using my "client" internet connection [eth0](172.16.120.x), and not my DHCP [eth1] internet feed. I still need eth0 for access to the server via LAN for ftp and ssh'ing into it.

After searching around, it seems I need to add some sort of routing by using the route add command, but the documentation is very confusing for a noob like me :P, and I'm not really sure that is the correct command/method to direct all outbound traffic to eth1. Here is a cat at my ifconfig:

Code:

eth0      Link encap:Ethernet  HWaddr 00:a0:cc:e4:66:02
          inet addr:172.16.120.5  Bcast:172.16.120.255  Mask:255.255.255.0
          inet6 addr: fe80::2a0:ccff:fee4:6602/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25033 errors:0 dropped:0 overruns:0 frame:0
          TX packets:43405 errors:28 dropped:0 overruns:0 carrier:25
          collisions:3188 txqueuelen:1000
          RX bytes:2110144 (2.0 MiB)  TX bytes:11026175 (10.5 MiB)
          Interrupt:10 Base address:0x1400

eth1      Link encap:Ethernet  HWaddr 00:50:ba:c7:ce:60
          inet addr:<MAH INTERNET IP>  Bcast:68.102.63.255  Mask:255.255.224.0
          inet6 addr: fe80::250:baff:fec7:ce60/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1484321 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2787 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:90797856 (86.5 MiB)  TX bytes:380143 (371.2 KiB)
          Interrupt:9 Base address:0x1800

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:69 errors:0 dropped:0 overruns:0 frame:0
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5801 (5.6 KiB)  TX bytes:5801 (5.6 KiB)

and cat /etc/network/interfaces:

Code:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo eth0 eth1
iface lo inet loopback

# The primary network interface

iface eth0 inet static
        address 172.16.120.5
        netmask 255.255.255.0
        network 172.16.120.0
        broadcast 172.16.120.255
        gateway 172.16.120.1

iface eth1 inet dhcp

I'm not really sure which direction to go to find out how to do this. Any help on this would be greatly appreciated.

chort 09-07-2008 12:44 PM

Remove the gateway statement from the eth0 config.

muncherelli 09-07-2008 01:41 PM

Wow, thank you very very much. Glad I asked here!


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