Linux IP routing: help

Discussion in 'Home Networking' started by aguara, May 13, 2015.

  1. aguara

    aguara Guest

    Hi!
    I have two access to internet..

    I have a LAN 192.168.0.0/24 but, the IP 192.168.0.2 only I need to out for the other conection.

    Example:

    192.168.0.0/24 <- ppp0
    192.168.0.2/32 <- ppp1


    How to make the changes? I don't understand all the options of IP..
    Thanks in advance!
     
    aguara, May 13, 2015
    #1
    1. Advertisements

  2. aguara

    Henry Law Guest

    Not sure I understand your question. Your internet connection will not
    have an address in 192.168... because that is one of the RFC1819
    "private internet" blocks.
    But these are not two different, independent networks. If you go to
    http://mxtoolbox.com/subnetcalculator.aspx and play around a bit you
    will see that 192.168.0.2 is a valid address in both of them.
     
    Henry Law, May 13, 2015
    #2
    1. Advertisements

  3. Hi Henry!

    Well, I have a one LAN 192.168.0.0/24

    And have two conection to Internet (ppp0 and ppp1)

    All PCs get out to Internet over the conexion of ppp0

    But, I need only one PC of the LAN 192.168.0.0/24 to get out over the ppp1

    The PC have a fix IP 192.168.0.2/32

    I can make the changes with IP command?
    I test the iptables, without result.

    I make the changes with the IP command:

    # echo 202 voip >> /etc/iproute2/rt_tables
    # ip rule add from 192.168.0.2/32 table fibra
    # ip route add default dev ppp1 table fibra
    # ip route flush cache

    The IP 192.168.0.2/32 get out to the Internet over ppp1

    But, connecting other PC with OPENVPN to access lan remotely, I can't ping or see the 192.168.0.2/32, but I can see all other IP. Only the 192.168.0.2/32 I can't access.

    Only within the LAN I can ping..

    You understand me?
     
    José Sanabria, May 13, 2015
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.