Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am having a problem as I need to set the outgoing IP address for a machine. The box is assigned 9 external IPs on eth0. eth1 is a direct link to another of our servers for backups/queries. The problem is that outgoing requests are being made on eth0:8, rather than eth0 directly. And since the request is being made to a machine that requires a certain IP address, it won't work as is.
Here is some of the relevant information. If you need more, please let me know.
Code:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
xx.zz.yy.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 xx.zz.yy.1 0.0.0.0 UG 0 0 0 eth0
My background is more in web development (apache/postgresql/mysql/php/etc) and not really in routing/etc, so please, any examples, urls would be helpful! Thanks!
Just a little more information... I had changed /etc/sysconfig/network so that GATEWAY=external ip, and it worked fine when I restarted the network. However, named starting spitting out all kinds of errors such as the following:
Aug 27 15:03:45 www named[28110]: client ww.xx.yy.zz#55286: error sending response: not enough free resources
And after many of those, and the server rebooted, we began getting:
Aug 27 15:10:36 dp1 kernel: NET: 193 messages suppressed.
Aug 27 15:10:36 dp1 kernel: Neighbour table overflow.
Aug 27 15:10:41 dp1 kernel: NET: 178 messages suppressed.
Aug 27 15:10:41 dp1 kernel: Neighbour table overflow.
Aug 27 15:10:46 dp1 kernel: NET: 194 messages suppressed.
Aug 27 15:10:46 dp1 kernel: Neighbour table overflow.
Aug 27 15:10:51 dp1 kernel: NET: 202 messages suppressed.
Aug 27 15:10:51 dp1 kernel: Neighbour table overflow.
And more of the same... After changing the GATEWAY back, and restarting the network, these errors quit.
BTW, I also tried setting /etc/sysconfig/network-scripts/ifcfg-eth0 with SRCADDR=external ip, but that didn't change anything...
the routing table looks kinda ugly. you have listed there like 17 or so different gateways for default traffic.
you have several default routes (0.0.0.0)
you could always insert and iptables rule:
iptables -A POSTROUTING -t nat -j SNAT --to $IP_ADDRESS
that will change the ip of all outgoing traffic to the one u want. but that's a bad hack for your situation.
i dont really know the entire network topology, but 17 different gateways for default traffic seems....crazy (from what i have learned about networking). you only USUALLY specify 1 default route (or maybe u have 16 backup routers...i dont know).
Thanks for your reply. I don't know why those other entres for default routes are there. The network is simply 2 nics, 1 going directly to another server we have (eth1), and the other is assigned 9 IPs and is external. These 2 are dedicated machines we purchased, and both have the same routing table setup.
As for how to remove all the extra gateways, I am not sure what to do. I tried 'route del default' with no success. Any additional help on this would be appreciated.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.