LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-01-2013, 12:23 AM   #1
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Rep: Reputation: Disabled
question about centos/rhel with 2 ips on one network and one to be globally visible.


i have one network card with 2 ips on different subnets A1 & B1
the gateway has address B2, so how to force linux to go through gateway with outgoing ip address B1?
 
Old 03-01-2013, 12:35 AM   #2
CyberNixon
LQ Newbie
 
Registered: Mar 2013
Distribution: Ubuntu, CentOS, Linux Mint, Solaris, Android
Posts: 4

Rep: Reputation: Disabled
setup a static route

You'd need to setup a static route.

Try...
Code:
# route add default gw gwB1 dev eth0:1
or, if you prefer...
Code:
# ip route add 0.0.0.0 via gwB1 dev eth0:1
where "gwB1" is the gateway IP address and "eth0:1" is the device name for the B network.

Last edited by CyberNixon; 03-01-2013 at 12:38 AM. Reason: added "ip route" cmd
 
Old 03-01-2013, 12:46 AM   #3
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
thanks for the prompt reply, much appreciated
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rhel/centos nis question luxaterna Linux - Server 3 05-01-2012 02:28 PM
configuring different network IPs in DNS server for RHEL 5. rockhack Linux - Networking 2 05-20-2010 06:12 AM
CentOS/ Rhel/ Scientific 5.4 - Network Manager prob? spoovy Linux - Newbie 6 04-15-2010 04:14 AM
CentOS/RHEL Linux small network configuration help linux_newb Linux - Networking 4 01-15-2010 09:05 AM
[SOLVED] using rhel/centos 5 without connection to the internet (yum/rpm question) deadeyes Red Hat 3 10-16-2009 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration