Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 10-09-2016, 05:01 PM   #1
LQ Newbie
Registered: Oct 2016
Posts: 1

Rep: Reputation: Disabled
Networking setup for two computers

I have two computers

Comp A:
Comp B:
The setup is like this

Internet <----> Computer A <--------> Computer B

Both computers have a single network card. The computer A is connected to the Internet. Computer B is connected to computer A via a usb-ethernet adapter.

How can I configure this to give Internet connectivity to computer B. Also, I would like to control internet connectivity to computer B by any firewall rule that I add on computer A

I ran sysctl -w net.ipv4.ip_forward=1 on both the computers.

On comp B, I go to edit connections, change from DHCP to manual. Add ip address and gateway as <ip addr of comp A>. Flush iptables on comp B. Added a rule 'sudo ip route add default via' . On doing a ping to computer A, it says network host is unreachable
Old 10-10-2016, 05:53 AM   #2
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 15,998

Rep: Reputation: 2275Reputation: 2275Reputation: 2275Reputation: 2275Reputation: 2275Reputation: 2275Reputation: 2275Reputation: 2275Reputation: 2275Reputation: 2275Reputation: 2275
Not enough information.

Is there a modem/router on the internet? There must be a server somewhere with a address on computer A's nic, because that's a private IP, not a public one. Tell us more.

Also, Have a look at this and check it out for your situation. Tell us what you think.
Old 10-10-2016, 03:53 PM   #3
Registered: Mar 2008
Posts: 21,893

Rep: Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615
A to B would be any private ip address you wish as long as they don't interfere with the other nic range. Make usb and B static.

Some distro's have a gui way to make it work.

Many folks use iptable to route the packets from A nic to A usb nic to B.

And others

Last edited by jefro; 10-10-2016 at 03:56 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Networking computers ? Richard14 Linux - Newbie 7 04-26-2014 01:38 PM
Networking 2 computers mukulsharma Linux - Networking 4 09-24-2012 07:08 AM
Networking Two Computers jhwatts Linux - Networking 3 09-24-2006 06:43 PM
Networking three computers srinuallada Linux - Networking 1 08-01-2002 05:31 PM
networking 2 computers Susan Linux - Networking 1 10-26-2001 04:23 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration