LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-03-2010, 12:39 PM   #1
Spacedust2
LQ Newbie
 
Registered: Mar 2010
Posts: 2

Rep: Reputation: 0
How to force server to open connections via eth0:0 not eth0 ?


Hello!

I got two IP's in my dedicated server.

Both are external IP's.

I would like to make connections using 2nd IP address under eth0:0 interface.

For example: when using "lynx whatismyip.com" should display my 2nd IP.

How to do this using iptables ?
 
Old 03-03-2010, 12:55 PM   #2
Spacedust2
LQ Newbie
 
Registered: Mar 2010
Posts: 2

Original Poster
Rep: Reputation: 0
I found it:

Code:
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source <new_IP>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to force eth0 interface association on IPCop 1.4.18 the_cranky_don Linux - Networking 4 09-17-2010 10:03 AM
eth0:1 IP taking precedence for outgoing connections over eth0 abefroman Linux - Networking 7 08-12-2008 07:37 AM
Network Manager - Two eth0 connections? hessond Linux - Newbie 2 03-20-2008 08:04 AM
Force NIC to be 'eth0' instead of 'eth2' stefanlasiewski Linux - Networking 13 12-29-2006 01:41 AM
force eth0 to use e100 nutthick Slackware 6 11-14-2004 05:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:18 AM.

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