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.
Distribution: Whatever I feel like at the time I install.
Posts: 284
Rep:
iptables router
I am currently learning linux slowly but surely. I am trying to get a router setup so that I can have more than two computers online.
This is my setup:
eth0 --> int lan
eth1 --> ext lan
eth2 --> ext lan
192.168.168.10 --> my int ip
I have this so that I can forward two differentent comps to diff ext ips for gaming purposes. The ftp server is running on 192.168.168.10 on port 2020. I also have a DHCP server running on the int NIC to provide IPs.
I have successfully gotten it to route everything through either ext NIC. However I can't seem to get it to send my int ip through the other NIC.
I used the following to setup the routes that work.
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
that works fine. I tried doing:
iptables -I FORWARD -s 192.186.168.10 -o eth2 -j ACCEPT
but that had no affect on my routing.
Your linux box is probably configured that at any given time, there is only one default gateway to external network.
i.e. your linux box can get through only one ISP at any given time.
Try to set your linux box with two gateways each with different metric, and perhaps you want it run some routing protocol as well, so the if any changes with your external network(say one ISP down), it will automatically re-calculate routing metric, and re-route packets out.
Distribution: Whatever I feel like at the time I install.
Posts: 284
Original Poster
Rep:
I have 2 default gateways.
eth1
eth2
I don't exactly have the money to have two ips's. I am pulling two IP's from the same Road Runner and I am trying to pass some int IPs through oen ext NIC card and the rest through the other.
any clues?
You can't have TWO default gateways. i.e. Default gateway cannot be more than one. However, if you have some routing protocol running, then you can have dymanic routing tables(discovered by routing protocols) and it will assigned with prioity number (metric) to routing paths it finds. The discovered routing path are not gateways.
Default gateway is a gateway when there aren't any routing tables matching the destination, its also called 'gateway of last resort'.
Distribution: Whatever I feel like at the time I install.
Posts: 284
Original Poster
Rep:
when I type in route this is what I get.
Destination Gateway Genmask Flags Iface
192.168.168.0 * 255.255.255.0 U eth0
xx.xx.xx.0 * 255.255.254.0 U eth1
yy.yy.yy.0 * 255.255.252.0 U eth2
127.0.0.0 * 255.0.0.0 U lo
default yy.yy.yy.1.name 0.0.0.0 UG eth2
default xx.xx.xx.1.name 0.0.0.0 UG eth1
I think i understand why everything is going to eth2 now but I duno how to stop it and to change it.
Distribution: Whatever I feel like at the time I install.
Posts: 284
Original Poster
Rep:
I have looked at that and done that but I don't understand exactly what I should be doing. I need to have two gateways. One should be default I assume and the other is the special one, which I want to route the "special" int IPs through.
plz help
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.