LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 03-30-2009, 12:54 PM   #1
vivhost
LQ Newbie
 
Registered: May 2004
Posts: 7

Rep: Reputation: 0
change default outgoing ip address


Hello, I've been trying to research this, but I don't really understand IP routing and it's bugging me that I can't fix this problem. I have a dedicated server (fedora core 7) with 3 IP addresses on the same eth0 interface. On the default IP address 62.193.226.127, there is some routing problem because I can't connect from the server to some other sites. Using one of the other IP addresses, like 62.193.252.129, I can connect fine. Additionally this address is better for sending mail because it coincides with the main domain name from which the mail is sent.

My question is: how can I configure networking so that outgoing traffic from the box goes via 62.193.252.129?

Here is some info:

eth0 Link encap:Ethernet HWaddr 00:18:37:09:99:87
inet addr:62.193.226.127 Bcast:62.193.227.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:155048 errors:0 dropped:0 overruns:0 frame:0
TX packets:189356 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32241110 (30.7 MiB) TX bytes:218707677 (208.5 MiB)
Interrupt:5 Base address:0xc000

eth0:1 Link encap:Ethernet HWaddr 00:18:37:09:99:87
inet addr:62.193.252.129 Bcast:62.193.252.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:5 Base address:0xc000

eth0:2 Link encap:Ethernet HWaddr 00:18:37:09:99:87
inet addr:62.193.252.147 Bcast:62.193.252.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:5 Base address:0xc000

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
62.193.252.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
62.193.224.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 62.193.227.254 0.0.0.0 UG 0 0 0 eth0


I can post any info as needed. Any help would be appreciated.

Last edited by vivhost; 03-30-2009 at 03:03 PM.
 
Old 03-31-2009, 10:38 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
In /etc/sysconfig/network-scripts/ you should see three files, ifcfg-eth0, ifcfg-eth0:1, and ifcfg-eth0:2.
Swap the IPADDR lines of ifcfg-eth0 and ifcfg-eth0:1. This will make .129 the ip address of eth0, which
is the primary address:

Code:
service network stop
<edit files as above>
service network start
 
Old 03-31-2009, 10:54 PM   #3
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
I just noticed that your addresses are in two different networks, so there's more work to be done. When swapping the IPADDR lines, you'll also
have to swap other related lines such as the netmask, broadcast (if present), etc. Finally, you'll have to change your gateway address (either
in ifcfg-eth0 or in /etc/sysconfig/network) to an ip address in the same network as your new primary address, i.e. in 62.193.252.0/24
 
  


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
Change sender address of outgoing emails in Sendmail ALInux Linux - Server 8 05-10-2012 06:25 PM
change grub boot order, all instructions say change default, but I don't see default mhg Linux - Newbie 5 11-09-2008 10:01 AM
Solaris 9 how to change ip address and default gateway rust8y Solaris / OpenSolaris 6 10-15-2007 05:44 PM
Crontab: How to change the default notification E-mail address? rignes Linux - Software 4 04-04-2007 02:21 PM
to change outgoing mac and ip address korenje Linux - Networking 3 12-31-2005 12:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 12:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration