Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Please note that this is ONE NIC and TWO Gateways

Now this solution is super easy in Windows:
* Connection Properties -> TCP/IP Properties -> Default Gateways -> Add (separated by metrics)

I notice Windows adds a second route in its routing table as such:

Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0  192.168.192.253  192.168.192.12       1
          0.0.0.0          0.0.0.0  192.168.192.254  192.168.192.12       2


How would I perform something very similar to this in Linux? ( Server Console )

My ultimate goal is to have a service, domain.com, run on one nic, but have access from two external IP addresses. So if anyone knows how to go that far, it would save another post as this would only protect the server if a router failed! :)

share|improve this question

migrated from stackoverflow.com May 17 '11 at 0:24

This question came from our site for professional and enthusiast programmers.

2 Answers 2

Connection Properties -> TCP/IP Properties -> Default Gateways -> Add (separated by metrics

ip route add default via 192.168.192.253 dev eth0

but have access from two external IP addresses

Are they assigned to the router, or directly to the PC? (I'm guessing the former, in which case you have to configure the router...)

If the addresses belonged to the computer itself, you could use ip addr add.

share|improve this answer
    
I have two routers actually. One router is ...253 and the other is ...254, however the Ubuntu server only has a console interface and one network card. –  dunpealslyr May 28 '11 at 23:16

The following should work

ip route add default via 192.168.192.253 dev eth0 metric 100

ip route add default via 192.168.192.253 dev eth0 metric 200
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.