# 2 internet connections, 2 nics routing



## whiskeyH0tel (Mar 10, 2012)

Here is my current network configuration


```
ISP 1                  ISP 2
|                      |
ROUTER1                 ROUTER2
192.168.1.1            192.168.1.2
```

LAN (192.168.1.0/24)

SERVER

```
iface nge0 192.168.1.10
iface bge0 192.168.1.11
default gateway 192.168.1.1
```

*O* my server if *I* port forward from router1 to server everything is good because the default route sends it right back out thr*ough* the same connection. If *I* port forward on router2 to my server it doesn*'*t work at all the packets get lost/dropped.

I want to set the default route for interface nge0 to be 192.168.1.1 and for bge0 to be 192.168.1.2.

*B*ut it doesn't seem like you can set default routes per interface? *O*r can you, *I* know you can set default routes per IP subnet but since these are on the same network that would be an issue.

*B*asically *I* want to be able to use both connections at the same time, nothing fancy no link aggregation (unless its easy or required). Is this possible with my config? *I*f not what are your suggestions? I can modify the config at a later date but not currently.

*H*ere is my routing table and *ifconfig* output:


```
Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            192.168.1.1        UGS       318 10038999   nfe0
127.0.0.1          link#4             UH          0   101446    lo0
192.168.1.0/24     link#1             U          70 156486435   nfe0
192.168.1.10       link#1             UHS         0   194059    lo0
192.168.1.11       link#2             UHS         0        6    lo0

nfe0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8210b<RXCSUM,TXCSUM,VLAN_MTU,TSO4,WOL_MAGIC,LINKSTATE>
        ether 00:e0:81:5f:d2:03
        inet 192.168.1.10 netmask 0xffffff00 broadcast 192.168.1.255
        media: Ethernet autoselect (1000baseT <full-duplex,flowcontrol,rxpause,txpause>)
        status: active
bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE>
        ether 00:e0:81:5f:d2:02
        inet 192.168.1.11 netmask 0xffffff00 broadcast 255.255.255.0
        media: Ethernet autoselect (100baseTX <full-duplex,flowcontrol,rxpause,txpause>)
        status: active
```


----------



## Uniballer (Mar 11, 2012)

Maybe one of these threads has ideas that will help you:

[Solved] Network/Routing problem with two providers

[Solved] PF + 2 Nat

[Solved] Need different routing table on host and jail


----------

