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

Notices


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

Rep: Reputation: Disabled
Networking setup for two computers


I have two computers

Comp A: 192.168.151.19
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 192.168.151.15 and gateway as <ip addr of comp A>. Flush iptables on comp B. Added a rule 'sudo ip route add default via 192.168.151.19' . On doing a ping to computer A, it says network host is unreachable
 
Old 10-10-2016, 05:53 AM   #2
business_kid
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 192.168.xxx.xxx 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
jefro
Moderator
 
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.

https://help.ubuntu.com/community/In...nectionSharing

And others

https://www.google.com/search?q=Ipta...ternet+sharing

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


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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