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.
IP Forwarding allows traffic from one network to be passed to another network. In other words, a machine with IP forwarding enabled can act as a router.
For example traffic from 192.168.1.0/24 will be allowed to pass to 192.168.2.0/24 (all traffic is still subject to iptables rules ofcourse).
To turn IP forwarding on in Ubuntu use:
#echo 1 > /proc/sys/net/ipv4/ip_forward
and to turn it off use:
#echo 0 > /proc/sys/net/ipv4/ip_forward
Note that there is a config file you can edit to enable/disable ip forwarding whenever the machine starts, but i can't remember the path right now
Finally, you'll need to add the proper routes to the kernel routing table so the machine nows what traffic to forward and where to forward it to.
For this you can #man route
- is it possible to use IP Forwading to connect different networks and do you have to learn iptables if you are dealing with IP Forwarding.
If you have IP forwarding on and IP tables off, two nics on the machine, one connected to one network and other connected to the second network it will work.
However, if you are not using ip tables you will get traffic (read access and insecure)both ways.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.