Find the answer to your Linux question:
Results 1 to 2 of 2
Objective ------------- I am trying to connect a desktop(in LAN) to internet by setting its gateway on another desktop who is on a different LAN and getting internet by having ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2011
    Posts
    3

    Question Routing or Bridging


    Objective
    -------------
    I am trying to connect a desktop(in LAN) to internet by setting its gateway on another desktop who is on a different LAN and getting internet by having its gateway configured on a DHCP server.

    Scenario
    ---------
    System A (Virtual Machine)
    NIC - eth0
    IP 192.168.1.2
    Netmask 255.255.255.0
    Gateway 192.168.1.1
    Broadcast 192.168.1.255
    OS Ubuntu

    System B (Server, Virtual Machine)
    NIC - eth0 and eth1
    eth0-IP 10.1.31.5 (through DHCP, internet enabled)
    Netmask 255.255.0.0
    Gateway 10.1.31.254 (configured on another DHCP server)
    OS Ubuntu

    Configuration
    ---------------
    I have configured the eth1 of System B as a gateway of system A with IP 192.168.1.1, netmask 255.255.255.0.
    System B is able to ping System A and vice-versa but no internet on system A.

    What I want to do is to get the internet on system A from system B.

    What I am confused about is what I require?
    - do I need to bridge eth0 and eth1 on System B and then routing packets from System A via its gateway configured on system B?
    - do I need to add routing rules on system A and B that will do the following-
    1. when I will type ping google on system A, the packet will reach on eth1 of systemB.
    2. eth1 of systemB will pass the packet to eth0 of systemB and it will be passed to the gateway of systemB which is configured on a DHCP server and hence connecting to the internet.

    I dont know if the logic seems to be fully correct or not but I need your help guys.
    I tried doing both the things but something is not working the way it should be. I need someone who can guide me to this to get it working.

    Please help.

  2. #2
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    192.168.1.0/24 has gateway 192.168.1.1
    192.168.1.1 has gateway 10.1.31.254

    This means for example:

    tracepath from host 192.168.1.16 to 8.8.8.8 should then show something like this:

    192.168.1.16
    192.168.1.1
    10.1.31.254
    <public ips*>
    8.8.8.8

Posting Permissions

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