Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Source IP Address

Status
Not open for further replies.

netwalker1

Programmer
Feb 5, 2000
1,241
EG
Dear All :
I have a Redhat Linux installed on Station-A, and I have only 1 NIC on this station ..
I configured the NIC to have multiple Subinterfaces ..
eth0:0 , eth0:1 , and eth0:2 because I am using a clustre system on this Station ..

eth0 has the IP 192.168.1.70
eth0:0 has IP : 192.168.1.71
eth0:1 has IP : 192.168.1.73
eth0:2 has IP : 192.168.1.75

I want to control the source Address which my Station will use when trying to establish a connection with any other devices in my Network ..

How can I do this ?

Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
CCNP,CCSP,CCA,MCSE,MCSA
 
I think you can do that via iptables and use snat.


--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
I found a way :
to change the default Source IP Address from eth0 to eth0:0 use the command :
route add –net 192.168.1.0 netmask 255.255.255.0 dev eth0:0

Thanks to me :)


Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
CCNP,CCSP,CCA,MCSE,MCSA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top