|
Two Gateways (two isps two nic)- LINUX - Please :)Hi! (i googled this and tired numerous answers still cant get the routes working, using redhat 5)
I have a linux computer, before I get another internet connection on my server- I have a question, since i have two ISPs - trying to get them both to be routing on the internet
(firewall turned off since they are behind routers)
( i did this on a windows 2000 about 12 years ago with just a few clicks)
eth0 = 172.10.10.190 255.255.255.0 gateway 172.10.10.1 (not set) eth1 = 10.10.10.190 255.255.255.0 gateway 10.10.10.1 (set as default gateway)
I did the whole IP tables thing.... ip rule.
did the service network restart
but still can only reach server from default eth1 gateway.
Any suggestions? |
|
plebel Premium Member join:2011-01-27 Ottawa, ON |
plebel
Premium Member
2012-Oct-14 3:24 pm
Try setting both as default gateways, you should be able to add more than one.
route add -net 0.0.0.0 netmask 0.0.0.0 gw 172.10.10.1 route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.10.10.1 |
|
|
i did that but it just chooses a random route - ......... |
|
plebel Premium Member join:2011-01-27 Ottawa, ON |
plebel
Premium Member
2012-Oct-14 3:40 pm
I'm not sure what you're trying to do here... Do you want to do fail-over or load balance outgoing connections between your two ISP's or are you trying something else? |
|
your moderator at work
hidden :
|
|
to olive403
Re: Two Gateways (two isps two nic)- LINUX - Please :)You can't just add two default routes. Read this this first or google for "Linux Advanced Routing". |
|
|
|
thats exactly what i did. still not working... |
|
olive403 |
ill paypal someone $10 to fix this from me with SSH access |
|
plebel Premium Member join:2011-01-27 Ottawa, ON |
to olive403
|
|
|
thats exactly what i did from the start - same thing - only one ip will have an outside path to the internet....
here are the commands are used.
ip route add 172.10.10.0 dev eth0 src 172.10.10.190 table T1
ip route add default via 172.10.10.1 table T1 ip route add 10.0.0.0 dev eth1 src 10.10.10.190 table T2 ip route add default via 10.10.10.1 table T2
ip route add 172.10.10.0 dev eth0 src 172.10.10.190 ip route add 10.0.0.0 dev eth1 src 10.10.10.190 Then, your preference for default route: ip route add default via 172.10.10.1
ip rule add from 172.10.10.190 table T1 ip rule add from 10.10.10.190 table T2
ip route add default scope global nexthop via 172.10.10.1 dev eth0 weight 1 \ nexthop via 10.10.10.1 dev eth1 weight 1 |
|
olive403 |
to plebel
i gave up i think TELUS is blocking my business port 80 |
|
olive403 |
where would i save this info so when i restart network service it already has this saved? |
|
plebel Premium Member join:2011-01-27 Ottawa, ON |
plebel
Premium Member
2012-Oct-14 8:56 pm
I don't remember where exactly extra routing information is kept in Red Hat, somwhere under /etc/sysconfig/network or network_scripts. You could create a startup script as well that runs those commands, just make sure it runs immediately after the network startup script runs. |
|
|
to olive403
Create the following files:
/etc/sysconfig/network-scripts/route-eth0 /etc/sysconfig/network-scripts/route-eth1 /etc/sysconfig/network-scripts/rule-eth0 /etc/sysconfig/network-scripts/rule-eth1
and add your configuration for each Ethernet interface your system has. Files route-* and rule-* contain only parameters of ip command (simply exclude "ip route/rule add"). For example, route-eth0 will look like:
172.10.10.0 dev eth0 src 172.10.10.190 table T1 default via 172.10.10.1 table T1 ...
I think it should work in RedHat. My server is running Fedora 17 which is a RedHat distro as well and it has a similar configuration for two interfaces. |
|
|
ok strange - i added the routes to rc.local.. onlything i did different now i cant get the network to turn on
Bringing up loopback interface: [ OK ] has different MAC address than expected, ignoring. [FAILED] |
|
olive403 |
does anyone know hwo to do this with windows server? i formated switching to windows server 2008 |
|
|
Raja
Anon
2012-Oct-17 12:53 pm
Hi i am also having this same problem.. after setting up the IP route & rule the network could not turn on.. Found the assigned IP address was removed.
I have reconfigured it .
does anyone help to configure this IP rule |
|
|
to olive403
You need to bind the two eth interfaces into a single one to be able to use them as a single one. I recommend you read the following page: » access.redhat.com/knowle ··· ing.html |
|
|
to olive403
I did this kind of setup with a microtik router a few years back. Was fairly easy.
If I remember correctly you cna use iptables to randomly or specifically define which nat will be used to go out, otherwise it will cause issues. |
|