Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Routing between subnets is always on by default. How to turn it off?
Results 1 to 3 of 3

Thread: Routing between subnets is always on by default. How to turn it off?

Hybrid View

  1. #1

    Routing between subnets is always on by default. How to turn it off?

    Hi,

    I have a linux home router, with 3 nic's,
    eth0: for internet
    eth1: for the first local subnet
    eth2: for the second local subnet

    It runs nat from the 2 local cards to the internet, with :

    echo 1 > /proc/sys/net/ipv4/ip_forward
    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

    On slackware i had to add routes between the 2 local subnets manually if i wanted them to access each other.
    Like this:
    #/sbin/route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.3.1 metric 1
    #/sbin/route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.1.1 metric 1

    On ubuntu however this routing is on by default, and i don't want that at the moment. (second subnet is for a different apartment, i don't want them browsing my shares/network printer etc).

    How do i turn this off?

  2. #2
    Administrator Advisor peter's Avatar
    Join Date
    Apr 2004
    Posts
    882
    To turn off routing between subnets add this line to your /etc/sysctl.conf file.

    Code:
    # net/ipv4/ip_forward = 0
    You must restart network for the change to take effect:
    Code:
    # /etc/rc.d/init.d/network restart
    For more details see: http://www.linuxhomenetworking.com/w...Using_iptables

    My sites:
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    -
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

  3. #3
    Won't that disable routing to my openvpn server? (subnet 192.168.8.0) What i am wondering about is why the kernel routes between the subnets without me adding the routes to the routing table. If i turn off ip_forward, will it disable manually added routes as well?

Similar Threads

  1. Problem with subnets.
    By stimburg in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 03-08-2013, 02:50 AM
  2. Cannot connect two subnets
    By lloowen in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 05-15-2012, 08:58 PM
  3. Routing two Subnets
    By lorddevi in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 07-10-2010, 08:19 PM
  4. Default How to turn on SSL support for Apache2
    By Compunuts in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 09-15-2006, 07:55 AM
  5. redhat default passwords for the default inbuilt users
    By kaushalsp in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 12-31-2004, 04:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •