Linux - NewbieThis 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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
192.168.11.0 range is the client side and 192.168.1.0 range is internal connection to a leased line router and its IP is 192.168.1.1. So what I want to do the what ever the traffic comes to eth0 (192.168.11.73) should be routed to 192.168.1.1
Hi though I have configured net.ipv4.ip_forward=1 and firewall is down, I am unable to route via this machine.
So you're trying to configure this host as a router? If so, you will probably want to use iptables, and a host of rules to forward traffic between the two interfaces. What is the use case for your desired router: home network, routing between subnets on a LAN, other? There are commonly packages or tools to assist in creating an appropriate set of rules, and I suggest using them, unless you have significant expertise in creating routers or other networking devices using Linux.
Hi Guys, so just enabling net.ipv4.ip_forward is not enough is it? I need to configure iptables as well to start the IP forwarding? I though otherwise, you just have to enable net.ipv4.ip_forward to get a basic route going for starters
Your question casts some confusion. The 'route' command is not really related to the concept of using the host as a router. Setting routes is used to tell the IP stack how to send packets from the host, on an appropriate interface and/or to an appropriate gateway. Using the host as a router/firewall is a separate matter, and uses iptables rules (lots of them for a well configured setup) to configure appropriate routing of traffic between LANs or LANs and WAN. The central difference has to do with where the data originates: either on the host itself, or on some other host & requiring traversal of the router to a host on a different network.
You really need to explain what your objective is (just setting up routes, or configuring the host as a router), so people can answer accordingly. I see answers here that seem to touch on both sides.
Hi theNbomr, thank you for the explanation. my senario is as below
I have tow sub-nets one is 192.168.11.0 and the other is 192.168.1.0 can I use Redhat linux box to route packets between these two networks without having to configure firewall (host as a router)
Since I did the above just a linux box with 2 network interfaces, facing 11 and 1 ranges. I have enabled net.ipv4.ip_forward = 1 and added its default gate way as 192.168.1.1 since this is yet another router facing the internet. Since 11 and 1 ranges are known to the router I dont think I have to add any specific route to routing table. And the firewall is off
My problem is when I try to ping 192.168.1.1 (internet route) from 192.168.11.120 (client in 11 range and its gateway is set to 192.168.11.254 (linux box which I am trying to configure as router)) I get a time out. If I to do a traceroute to 192.168.1.1 it will go up to 192.168.11.254 and stops with *****. But I can ping from the route to be to any machine on 11 rang and 192.168.1.1 route
I dont understand what I going on. as per help I got it looks like I need firewall as well to achieve my objective