LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Multiple Network Interfaces - Force one to WAN and one to LAN? (https://www.linuxquestions.org/questions/slackware-14/multiple-network-interfaces-force-one-to-wan-and-one-to-lan-653362/)

pricejm 07-03-2008 10:14 AM

Multiple Network Interfaces - Force one to WAN and one to LAN?
 
Hello,

I have the following network structure:
Code:

    ISP --> Router --> Gb Switch |
                                |
                                | --> SlackBox (eth0: 192.168.1.11)
                                | --> SlackBox (eth1: 192.168.1.10)
                                | --> PC

I first had only one of the interfaces up on the SlackBox and decided to bring the extra one up just for LAN file transfers. I have the router's firewall forwarding to the .11 IP for all the WAN traffic, any internal traffic I connect through the .10 IP (i.e. ftp)...

The weird thing is that the connections are to the .11 IP but the traffic is being handled by eth1, which is the .10 IP.

ifconfig:
Code:

eth0      Link encap:Ethernet  HWaddr abc123
          inet addr:192.168.1.11  Bcast:192.168.1.255 Mask:255.255.255.0
          inet6 addr: abc123 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3053 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:255839 (249.8 KiB)  TX bytes:2284 (2.2 KiB)
          Interrupt:20 Base address:0x2000

eth1      Link encap:Ethernet  HWaddr abc123
          inet addr:192.168.1.10  Bcast:192.168.1.255 Mask:255.255.255.0
          inet6 addr: abc123 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13220730 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11627726 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1969552445 (1.8 GiB)  TX bytes:3599271101 (3.3 GiB)
          Interrupt:21

netstat shows a mix of .10 and .11, mostly .11 IP.

Here's a good example from a iptables log:
Code:

Jul  3 11:00:50 hostname kernel: RST DROPED IN=eth1
 OUT= MAC=abc123 SRC=xx.xx.xx.xx DST=192.168.1.11
 LEN=40 TOS=0x00 PREC=0x20 TTL=108 ID=5168 DF PROTO=TCP SPT=63318
 DPT=2682 WINDOW=0 RES=0x00 RST URGP=0

I'm going to have to learn this one...

So short version: how do I use two network interfaces and dedicate one to WAN traffic and one to LAN only (I would like it if LAN can connect to both).

My purpose is to prevent local file transfers from starving the WAN connections. Don't want to throttle any LAN traffic.

Slackware 12.1

EDIT: I'm currently looking into `route`...

pricejm 07-03-2008 11:09 AM

`route` command...
 
OK

Looks like route solved my problem.

`route`
Code:

Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
localnet        *              255.255.255.0  U    0      0        0 eth1
localnet        *              255.255.255.0  U    0      0        0 eth0
loopback        *              255.0.0.0      U    0      0        0 lo
default        GW              0.0.0.0        UG    0      0        0 eth1

Ran:
route del default; route add default netmask 0.0.0.0 gw GW eth0

Code:

Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
localnet        *              255.255.255.0  U    0      0        0 eth1
localnet        *              255.255.255.0  U    0      0        0 eth0
loopback        *              255.0.0.0      U    0      0        0 lo
default        GW              0.0.0.0        UG    0      0        0 eth0



All times are GMT -5. The time now is 02:38 PM.