How to connect to the internet through another PC?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have a small cluster with several nodes. Only one node (let's call it root), can connect to the internet. All nodes are connected, so we can ping from one to another, but we can't reach Internet from common node (i.e. not root).
Root node ifconfig
output:
eth0 Link encap:Ethernet HWaddr b8:27:eb:d8:53:25
inet addr:192.168.10.10 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4084 errors:0 dropped:1295 overruns:0 frame:0
TX packets:841 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:249141 (243.3 KiB) TX bytes:87110 (85.0 KiB)
eth1 Link encap:Ethernet HWaddr b8:8d:12:54:75:aa
inet addr:158.184.27.129 Bcast:158.184.27.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1647 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:229772 (224.3 KiB) TX bytes:68634 (67.0 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:260 (260.0 B) TX bytes:260 (260.0 B)
wlan0 Link encap:Ethernet HWaddr 00:0f:13:39:02:c3
inet addr:158.196.122.94 Bcast:158.196.123.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:127 errors:0 dropped:0 overruns:0 frame:0
TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:37269 (36.3 KiB) TX bytes:27150 (26.5 KiB)
Root node route -n
output
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 158.184.27.1 0.0.0.0 UG 0 0 0 eth1
158.184.27.0 * 255.255.255.0 U 0 0 0 eth1
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
Common node ifconfig
output:
eth0 Link encap:Ethernet HWaddr b8:27:eb:b3:ed:0e
inet addr:192.168.10.11 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5078 errors:0 dropped:2249 overruns:0 frame:0
TX packets:1502 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:287740 (280.9 KiB) TX bytes:179477 (175.2 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:36 errors:0 dropped:0 overruns:0 frame:0
TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3590 (3.5 KiB) TX bytes:3590 (3.5 KiB)
Common node route -n
output:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.10.10 0.0.0.0 UG 0 0 0 eth0
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Do you have any idea, how could I connect to the Internet from common node through the root node? I have very little knowledge of networking, so please, try to explain it in detail.
EDIT:
Considering Richard Neumann's answer, I enabled IP forwarding on the root node. And I think, that the root node already IS set as the default gateway (see Common node route -n
output).
But the internet is still not working...
EDIT 2:
> traceroute 8.8.8.8
1 permonik0 (192.168.10.10) 0.972ms 0.957ms 0.922ms
2 * * *
...
30 * * *
EDIT 3:
I set NAT up according to this article and now I can even ping 8.8.8.8 successfully. But still, I can't ping any website, so it looks, there is some remaining DNS problem now.
networking cluster
add a comment |Â
up vote
1
down vote
favorite
I have a small cluster with several nodes. Only one node (let's call it root), can connect to the internet. All nodes are connected, so we can ping from one to another, but we can't reach Internet from common node (i.e. not root).
Root node ifconfig
output:
eth0 Link encap:Ethernet HWaddr b8:27:eb:d8:53:25
inet addr:192.168.10.10 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4084 errors:0 dropped:1295 overruns:0 frame:0
TX packets:841 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:249141 (243.3 KiB) TX bytes:87110 (85.0 KiB)
eth1 Link encap:Ethernet HWaddr b8:8d:12:54:75:aa
inet addr:158.184.27.129 Bcast:158.184.27.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1647 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:229772 (224.3 KiB) TX bytes:68634 (67.0 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:260 (260.0 B) TX bytes:260 (260.0 B)
wlan0 Link encap:Ethernet HWaddr 00:0f:13:39:02:c3
inet addr:158.196.122.94 Bcast:158.196.123.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:127 errors:0 dropped:0 overruns:0 frame:0
TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:37269 (36.3 KiB) TX bytes:27150 (26.5 KiB)
Root node route -n
output
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 158.184.27.1 0.0.0.0 UG 0 0 0 eth1
158.184.27.0 * 255.255.255.0 U 0 0 0 eth1
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
Common node ifconfig
output:
eth0 Link encap:Ethernet HWaddr b8:27:eb:b3:ed:0e
inet addr:192.168.10.11 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5078 errors:0 dropped:2249 overruns:0 frame:0
TX packets:1502 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:287740 (280.9 KiB) TX bytes:179477 (175.2 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:36 errors:0 dropped:0 overruns:0 frame:0
TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3590 (3.5 KiB) TX bytes:3590 (3.5 KiB)
Common node route -n
output:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.10.10 0.0.0.0 UG 0 0 0 eth0
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Do you have any idea, how could I connect to the Internet from common node through the root node? I have very little knowledge of networking, so please, try to explain it in detail.
EDIT:
Considering Richard Neumann's answer, I enabled IP forwarding on the root node. And I think, that the root node already IS set as the default gateway (see Common node route -n
output).
But the internet is still not working...
EDIT 2:
> traceroute 8.8.8.8
1 permonik0 (192.168.10.10) 0.972ms 0.957ms 0.922ms
2 * * *
...
30 * * *
EDIT 3:
I set NAT up according to this article and now I can even ping 8.8.8.8 successfully. But still, I can't ping any website, so it looks, there is some remaining DNS problem now.
networking cluster
@RichardNeumann I added the output into my question
â Eenoku
Sep 26 '17 at 14:55
I updated my answer.
â Richard Neumann
Sep 26 '17 at 15:05
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a small cluster with several nodes. Only one node (let's call it root), can connect to the internet. All nodes are connected, so we can ping from one to another, but we can't reach Internet from common node (i.e. not root).
Root node ifconfig
output:
eth0 Link encap:Ethernet HWaddr b8:27:eb:d8:53:25
inet addr:192.168.10.10 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4084 errors:0 dropped:1295 overruns:0 frame:0
TX packets:841 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:249141 (243.3 KiB) TX bytes:87110 (85.0 KiB)
eth1 Link encap:Ethernet HWaddr b8:8d:12:54:75:aa
inet addr:158.184.27.129 Bcast:158.184.27.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1647 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:229772 (224.3 KiB) TX bytes:68634 (67.0 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:260 (260.0 B) TX bytes:260 (260.0 B)
wlan0 Link encap:Ethernet HWaddr 00:0f:13:39:02:c3
inet addr:158.196.122.94 Bcast:158.196.123.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:127 errors:0 dropped:0 overruns:0 frame:0
TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:37269 (36.3 KiB) TX bytes:27150 (26.5 KiB)
Root node route -n
output
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 158.184.27.1 0.0.0.0 UG 0 0 0 eth1
158.184.27.0 * 255.255.255.0 U 0 0 0 eth1
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
Common node ifconfig
output:
eth0 Link encap:Ethernet HWaddr b8:27:eb:b3:ed:0e
inet addr:192.168.10.11 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5078 errors:0 dropped:2249 overruns:0 frame:0
TX packets:1502 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:287740 (280.9 KiB) TX bytes:179477 (175.2 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:36 errors:0 dropped:0 overruns:0 frame:0
TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3590 (3.5 KiB) TX bytes:3590 (3.5 KiB)
Common node route -n
output:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.10.10 0.0.0.0 UG 0 0 0 eth0
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Do you have any idea, how could I connect to the Internet from common node through the root node? I have very little knowledge of networking, so please, try to explain it in detail.
EDIT:
Considering Richard Neumann's answer, I enabled IP forwarding on the root node. And I think, that the root node already IS set as the default gateway (see Common node route -n
output).
But the internet is still not working...
EDIT 2:
> traceroute 8.8.8.8
1 permonik0 (192.168.10.10) 0.972ms 0.957ms 0.922ms
2 * * *
...
30 * * *
EDIT 3:
I set NAT up according to this article and now I can even ping 8.8.8.8 successfully. But still, I can't ping any website, so it looks, there is some remaining DNS problem now.
networking cluster
I have a small cluster with several nodes. Only one node (let's call it root), can connect to the internet. All nodes are connected, so we can ping from one to another, but we can't reach Internet from common node (i.e. not root).
Root node ifconfig
output:
eth0 Link encap:Ethernet HWaddr b8:27:eb:d8:53:25
inet addr:192.168.10.10 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4084 errors:0 dropped:1295 overruns:0 frame:0
TX packets:841 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:249141 (243.3 KiB) TX bytes:87110 (85.0 KiB)
eth1 Link encap:Ethernet HWaddr b8:8d:12:54:75:aa
inet addr:158.184.27.129 Bcast:158.184.27.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1647 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:229772 (224.3 KiB) TX bytes:68634 (67.0 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:260 (260.0 B) TX bytes:260 (260.0 B)
wlan0 Link encap:Ethernet HWaddr 00:0f:13:39:02:c3
inet addr:158.196.122.94 Bcast:158.196.123.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:127 errors:0 dropped:0 overruns:0 frame:0
TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:37269 (36.3 KiB) TX bytes:27150 (26.5 KiB)
Root node route -n
output
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 158.184.27.1 0.0.0.0 UG 0 0 0 eth1
158.184.27.0 * 255.255.255.0 U 0 0 0 eth1
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
Common node ifconfig
output:
eth0 Link encap:Ethernet HWaddr b8:27:eb:b3:ed:0e
inet addr:192.168.10.11 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5078 errors:0 dropped:2249 overruns:0 frame:0
TX packets:1502 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:287740 (280.9 KiB) TX bytes:179477 (175.2 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:36 errors:0 dropped:0 overruns:0 frame:0
TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3590 (3.5 KiB) TX bytes:3590 (3.5 KiB)
Common node route -n
output:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.10.10 0.0.0.0 UG 0 0 0 eth0
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Do you have any idea, how could I connect to the Internet from common node through the root node? I have very little knowledge of networking, so please, try to explain it in detail.
EDIT:
Considering Richard Neumann's answer, I enabled IP forwarding on the root node. And I think, that the root node already IS set as the default gateway (see Common node route -n
output).
But the internet is still not working...
EDIT 2:
> traceroute 8.8.8.8
1 permonik0 (192.168.10.10) 0.972ms 0.957ms 0.922ms
2 * * *
...
30 * * *
EDIT 3:
I set NAT up according to this article and now I can even ping 8.8.8.8 successfully. But still, I can't ping any website, so it looks, there is some remaining DNS problem now.
networking cluster
networking cluster
edited Sep 27 '17 at 17:53
GAD3R
22.7k154895
22.7k154895
asked Sep 26 '17 at 14:20
Eenoku
465215
465215
@RichardNeumann I added the output into my question
â Eenoku
Sep 26 '17 at 14:55
I updated my answer.
â Richard Neumann
Sep 26 '17 at 15:05
add a comment |Â
@RichardNeumann I added the output into my question
â Eenoku
Sep 26 '17 at 14:55
I updated my answer.
â Richard Neumann
Sep 26 '17 at 15:05
@RichardNeumann I added the output into my question
â Eenoku
Sep 26 '17 at 14:55
@RichardNeumann I added the output into my question
â Eenoku
Sep 26 '17 at 14:55
I updated my answer.
â Richard Neumann
Sep 26 '17 at 15:05
I updated my answer.
â Richard Neumann
Sep 26 '17 at 15:05
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
If @Richard Neumann's answer did not work, there is a possibility of it being a DNS issue.
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
Set up IP Forwarding and Masquerading.
iptables -P FORWARD ACCEPT
iptables --table nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables --table nat --append POSTROUTING --jump MASQUERADE --source 192.168.10.10/24
iptables-save > /root/clients.fw
echo "/sbin/iptables-restore < /root/clients.fw" >> /etc/rc.local
This above commands will enable IP Forwarding, and setup a firewall using iptables
that allows you to access the internet from your client's.
Thank you, I added the line, but it still doesn't work...
â Eenoku
Sep 26 '17 at 14:59
What happens when you simplyping 8.8.8.8
? @Eenoku
â Hunter.S.Thompson
Sep 26 '17 at 15:01
Ping doesn't work...
â Eenoku
Sep 26 '17 at 15:04
"Ping doesn't work" That does not help me at all. What does ping say?
â Hunter.S.Thompson
Sep 26 '17 at 15:05
Ok, I'm sorry :-) Ping hangs, like it can't connect the address.
â Eenoku
Sep 26 '17 at 15:06
 |Â
show 3 more comments
up vote
2
down vote
Your root node will have to act as a router for the other nodes.
You'll need to enable IP forwarding, in your case for IPv4, on the router:
sysctl -w net.ipv4.ip_forward = 1
And to make it persistent, edit /etc/sysctl.conf
and set:
net.ipv4.ip_forward=1
You'd probably also want to make the router the default gateway on the other nodes.
If the next hop beyond your router is not aware of the network 192.168.10.10/24, then you'll need to implement Network Address Translation (NAT).
Have a look at iptables
and its MASQUERADE
option.
For possible DNS issues, see @Hunter.S.Thompson's answer.
1
Just to add. Run "sysctl net.ipv4.ip_forward = 1" to make the change live and "sysctl -p /etc/sysctl.conf" to make the changes persistent after reboot.
â Raman Sailopal
Sep 26 '17 at 14:27
sysctl -p
loads the settings fromsysctl.conf
.
â Richard Neumann
Sep 26 '17 at 14:33
Thank you, I've made the changes and edited my question. But, it doesn't work yet
â Eenoku
Sep 26 '17 at 14:43
Could you, please, describe a little what do you mean by your last paragraph exactly?
â Eenoku
Sep 26 '17 at 15:14
Ok, NAT is set up, now I have a problem with DNS probably... I've edited my question...
â Eenoku
Sep 26 '17 at 15:31
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
If @Richard Neumann's answer did not work, there is a possibility of it being a DNS issue.
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
Set up IP Forwarding and Masquerading.
iptables -P FORWARD ACCEPT
iptables --table nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables --table nat --append POSTROUTING --jump MASQUERADE --source 192.168.10.10/24
iptables-save > /root/clients.fw
echo "/sbin/iptables-restore < /root/clients.fw" >> /etc/rc.local
This above commands will enable IP Forwarding, and setup a firewall using iptables
that allows you to access the internet from your client's.
Thank you, I added the line, but it still doesn't work...
â Eenoku
Sep 26 '17 at 14:59
What happens when you simplyping 8.8.8.8
? @Eenoku
â Hunter.S.Thompson
Sep 26 '17 at 15:01
Ping doesn't work...
â Eenoku
Sep 26 '17 at 15:04
"Ping doesn't work" That does not help me at all. What does ping say?
â Hunter.S.Thompson
Sep 26 '17 at 15:05
Ok, I'm sorry :-) Ping hangs, like it can't connect the address.
â Eenoku
Sep 26 '17 at 15:06
 |Â
show 3 more comments
up vote
3
down vote
accepted
If @Richard Neumann's answer did not work, there is a possibility of it being a DNS issue.
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
Set up IP Forwarding and Masquerading.
iptables -P FORWARD ACCEPT
iptables --table nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables --table nat --append POSTROUTING --jump MASQUERADE --source 192.168.10.10/24
iptables-save > /root/clients.fw
echo "/sbin/iptables-restore < /root/clients.fw" >> /etc/rc.local
This above commands will enable IP Forwarding, and setup a firewall using iptables
that allows you to access the internet from your client's.
Thank you, I added the line, but it still doesn't work...
â Eenoku
Sep 26 '17 at 14:59
What happens when you simplyping 8.8.8.8
? @Eenoku
â Hunter.S.Thompson
Sep 26 '17 at 15:01
Ping doesn't work...
â Eenoku
Sep 26 '17 at 15:04
"Ping doesn't work" That does not help me at all. What does ping say?
â Hunter.S.Thompson
Sep 26 '17 at 15:05
Ok, I'm sorry :-) Ping hangs, like it can't connect the address.
â Eenoku
Sep 26 '17 at 15:06
 |Â
show 3 more comments
up vote
3
down vote
accepted
up vote
3
down vote
accepted
If @Richard Neumann's answer did not work, there is a possibility of it being a DNS issue.
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
Set up IP Forwarding and Masquerading.
iptables -P FORWARD ACCEPT
iptables --table nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables --table nat --append POSTROUTING --jump MASQUERADE --source 192.168.10.10/24
iptables-save > /root/clients.fw
echo "/sbin/iptables-restore < /root/clients.fw" >> /etc/rc.local
This above commands will enable IP Forwarding, and setup a firewall using iptables
that allows you to access the internet from your client's.
If @Richard Neumann's answer did not work, there is a possibility of it being a DNS issue.
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
Set up IP Forwarding and Masquerading.
iptables -P FORWARD ACCEPT
iptables --table nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables --table nat --append POSTROUTING --jump MASQUERADE --source 192.168.10.10/24
iptables-save > /root/clients.fw
echo "/sbin/iptables-restore < /root/clients.fw" >> /etc/rc.local
This above commands will enable IP Forwarding, and setup a firewall using iptables
that allows you to access the internet from your client's.
edited Sep 26 '17 at 15:32
answered Sep 26 '17 at 14:52
Hunter.S.Thompson
4,57431334
4,57431334
Thank you, I added the line, but it still doesn't work...
â Eenoku
Sep 26 '17 at 14:59
What happens when you simplyping 8.8.8.8
? @Eenoku
â Hunter.S.Thompson
Sep 26 '17 at 15:01
Ping doesn't work...
â Eenoku
Sep 26 '17 at 15:04
"Ping doesn't work" That does not help me at all. What does ping say?
â Hunter.S.Thompson
Sep 26 '17 at 15:05
Ok, I'm sorry :-) Ping hangs, like it can't connect the address.
â Eenoku
Sep 26 '17 at 15:06
 |Â
show 3 more comments
Thank you, I added the line, but it still doesn't work...
â Eenoku
Sep 26 '17 at 14:59
What happens when you simplyping 8.8.8.8
? @Eenoku
â Hunter.S.Thompson
Sep 26 '17 at 15:01
Ping doesn't work...
â Eenoku
Sep 26 '17 at 15:04
"Ping doesn't work" That does not help me at all. What does ping say?
â Hunter.S.Thompson
Sep 26 '17 at 15:05
Ok, I'm sorry :-) Ping hangs, like it can't connect the address.
â Eenoku
Sep 26 '17 at 15:06
Thank you, I added the line, but it still doesn't work...
â Eenoku
Sep 26 '17 at 14:59
Thank you, I added the line, but it still doesn't work...
â Eenoku
Sep 26 '17 at 14:59
What happens when you simply
ping 8.8.8.8
? @Eenokuâ Hunter.S.Thompson
Sep 26 '17 at 15:01
What happens when you simply
ping 8.8.8.8
? @Eenokuâ Hunter.S.Thompson
Sep 26 '17 at 15:01
Ping doesn't work...
â Eenoku
Sep 26 '17 at 15:04
Ping doesn't work...
â Eenoku
Sep 26 '17 at 15:04
"Ping doesn't work" That does not help me at all. What does ping say?
â Hunter.S.Thompson
Sep 26 '17 at 15:05
"Ping doesn't work" That does not help me at all. What does ping say?
â Hunter.S.Thompson
Sep 26 '17 at 15:05
Ok, I'm sorry :-) Ping hangs, like it can't connect the address.
â Eenoku
Sep 26 '17 at 15:06
Ok, I'm sorry :-) Ping hangs, like it can't connect the address.
â Eenoku
Sep 26 '17 at 15:06
 |Â
show 3 more comments
up vote
2
down vote
Your root node will have to act as a router for the other nodes.
You'll need to enable IP forwarding, in your case for IPv4, on the router:
sysctl -w net.ipv4.ip_forward = 1
And to make it persistent, edit /etc/sysctl.conf
and set:
net.ipv4.ip_forward=1
You'd probably also want to make the router the default gateway on the other nodes.
If the next hop beyond your router is not aware of the network 192.168.10.10/24, then you'll need to implement Network Address Translation (NAT).
Have a look at iptables
and its MASQUERADE
option.
For possible DNS issues, see @Hunter.S.Thompson's answer.
1
Just to add. Run "sysctl net.ipv4.ip_forward = 1" to make the change live and "sysctl -p /etc/sysctl.conf" to make the changes persistent after reboot.
â Raman Sailopal
Sep 26 '17 at 14:27
sysctl -p
loads the settings fromsysctl.conf
.
â Richard Neumann
Sep 26 '17 at 14:33
Thank you, I've made the changes and edited my question. But, it doesn't work yet
â Eenoku
Sep 26 '17 at 14:43
Could you, please, describe a little what do you mean by your last paragraph exactly?
â Eenoku
Sep 26 '17 at 15:14
Ok, NAT is set up, now I have a problem with DNS probably... I've edited my question...
â Eenoku
Sep 26 '17 at 15:31
add a comment |Â
up vote
2
down vote
Your root node will have to act as a router for the other nodes.
You'll need to enable IP forwarding, in your case for IPv4, on the router:
sysctl -w net.ipv4.ip_forward = 1
And to make it persistent, edit /etc/sysctl.conf
and set:
net.ipv4.ip_forward=1
You'd probably also want to make the router the default gateway on the other nodes.
If the next hop beyond your router is not aware of the network 192.168.10.10/24, then you'll need to implement Network Address Translation (NAT).
Have a look at iptables
and its MASQUERADE
option.
For possible DNS issues, see @Hunter.S.Thompson's answer.
1
Just to add. Run "sysctl net.ipv4.ip_forward = 1" to make the change live and "sysctl -p /etc/sysctl.conf" to make the changes persistent after reboot.
â Raman Sailopal
Sep 26 '17 at 14:27
sysctl -p
loads the settings fromsysctl.conf
.
â Richard Neumann
Sep 26 '17 at 14:33
Thank you, I've made the changes and edited my question. But, it doesn't work yet
â Eenoku
Sep 26 '17 at 14:43
Could you, please, describe a little what do you mean by your last paragraph exactly?
â Eenoku
Sep 26 '17 at 15:14
Ok, NAT is set up, now I have a problem with DNS probably... I've edited my question...
â Eenoku
Sep 26 '17 at 15:31
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Your root node will have to act as a router for the other nodes.
You'll need to enable IP forwarding, in your case for IPv4, on the router:
sysctl -w net.ipv4.ip_forward = 1
And to make it persistent, edit /etc/sysctl.conf
and set:
net.ipv4.ip_forward=1
You'd probably also want to make the router the default gateway on the other nodes.
If the next hop beyond your router is not aware of the network 192.168.10.10/24, then you'll need to implement Network Address Translation (NAT).
Have a look at iptables
and its MASQUERADE
option.
For possible DNS issues, see @Hunter.S.Thompson's answer.
Your root node will have to act as a router for the other nodes.
You'll need to enable IP forwarding, in your case for IPv4, on the router:
sysctl -w net.ipv4.ip_forward = 1
And to make it persistent, edit /etc/sysctl.conf
and set:
net.ipv4.ip_forward=1
You'd probably also want to make the router the default gateway on the other nodes.
If the next hop beyond your router is not aware of the network 192.168.10.10/24, then you'll need to implement Network Address Translation (NAT).
Have a look at iptables
and its MASQUERADE
option.
For possible DNS issues, see @Hunter.S.Thompson's answer.
edited Sep 26 '17 at 15:18
answered Sep 26 '17 at 14:24
Richard Neumann
488211
488211
1
Just to add. Run "sysctl net.ipv4.ip_forward = 1" to make the change live and "sysctl -p /etc/sysctl.conf" to make the changes persistent after reboot.
â Raman Sailopal
Sep 26 '17 at 14:27
sysctl -p
loads the settings fromsysctl.conf
.
â Richard Neumann
Sep 26 '17 at 14:33
Thank you, I've made the changes and edited my question. But, it doesn't work yet
â Eenoku
Sep 26 '17 at 14:43
Could you, please, describe a little what do you mean by your last paragraph exactly?
â Eenoku
Sep 26 '17 at 15:14
Ok, NAT is set up, now I have a problem with DNS probably... I've edited my question...
â Eenoku
Sep 26 '17 at 15:31
add a comment |Â
1
Just to add. Run "sysctl net.ipv4.ip_forward = 1" to make the change live and "sysctl -p /etc/sysctl.conf" to make the changes persistent after reboot.
â Raman Sailopal
Sep 26 '17 at 14:27
sysctl -p
loads the settings fromsysctl.conf
.
â Richard Neumann
Sep 26 '17 at 14:33
Thank you, I've made the changes and edited my question. But, it doesn't work yet
â Eenoku
Sep 26 '17 at 14:43
Could you, please, describe a little what do you mean by your last paragraph exactly?
â Eenoku
Sep 26 '17 at 15:14
Ok, NAT is set up, now I have a problem with DNS probably... I've edited my question...
â Eenoku
Sep 26 '17 at 15:31
1
1
Just to add. Run "sysctl net.ipv4.ip_forward = 1" to make the change live and "sysctl -p /etc/sysctl.conf" to make the changes persistent after reboot.
â Raman Sailopal
Sep 26 '17 at 14:27
Just to add. Run "sysctl net.ipv4.ip_forward = 1" to make the change live and "sysctl -p /etc/sysctl.conf" to make the changes persistent after reboot.
â Raman Sailopal
Sep 26 '17 at 14:27
sysctl -p
loads the settings from sysctl.conf
.â Richard Neumann
Sep 26 '17 at 14:33
sysctl -p
loads the settings from sysctl.conf
.â Richard Neumann
Sep 26 '17 at 14:33
Thank you, I've made the changes and edited my question. But, it doesn't work yet
â Eenoku
Sep 26 '17 at 14:43
Thank you, I've made the changes and edited my question. But, it doesn't work yet
â Eenoku
Sep 26 '17 at 14:43
Could you, please, describe a little what do you mean by your last paragraph exactly?
â Eenoku
Sep 26 '17 at 15:14
Could you, please, describe a little what do you mean by your last paragraph exactly?
â Eenoku
Sep 26 '17 at 15:14
Ok, NAT is set up, now I have a problem with DNS probably... I've edited my question...
â Eenoku
Sep 26 '17 at 15:31
Ok, NAT is set up, now I have a problem with DNS probably... I've edited my question...
â Eenoku
Sep 26 '17 at 15:31
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f394551%2fhow-to-connect-to-the-internet-through-another-pc%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
@RichardNeumann I added the output into my question
â Eenoku
Sep 26 '17 at 14:55
I updated my answer.
â Richard Neumann
Sep 26 '17 at 15:05