Configure Linux PC as router
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Consider the below network configuration.
wan ----[WAN router] <----> [eth1 (PC2) eth0]<---->[eth0 (PC1)]
wan ----[WAN router 192.168.169.1] <--> [192.168.169.5 (PC2) 10.1.2.3] <--> [10.1.2.2 (PC1)]
I am trying access internet from PC1 through PC2. PC2 is connected to a 3g router. I am using Olive V-R15 Pocket Rocket. I have added static routes as below for my objective.
In PC1:-
#set 10.1.2.3 as default gateway
sudo route add default gw 10.1.2.3 eth0
In PC2:-
#set 192.168.169.1 as default gateway
sudo route add default gw 192.168.169.1 eth1
In WAN router:-
#Add static route to 10.1.2.0/24 via 192.168.169.5
With the above configuration i can able to ping WAN router IP (192.168.169.1)
from PC1. But when i tried to ping 8.8.8.8
(aka www.google.com), i couldn't. i did a traceroute at PC1 and here is the output.
traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 10.1.2.3 (10.1.2.3) 27.179 ms 27.117 ms 28.014 ms
2 192.168.169.1 (192.168.169.1) 28.334 ms 28.655 ms 29.831 ms
3 220.224.141.145 (220.224.141.145) 129.838 ms 130.853 ms 132.844 ms
4 * * *
5 * * *
6 *^C (tracroute failed)
I don't why i can able ping till WAN router but not beyond that. I can do IP masquerading in PC2 for my requirement. But i would like to know what am i doing wrong with this method. Could someone clarify me? Thank you.
networking routing
add a comment |Â
up vote
1
down vote
favorite
Consider the below network configuration.
wan ----[WAN router] <----> [eth1 (PC2) eth0]<---->[eth0 (PC1)]
wan ----[WAN router 192.168.169.1] <--> [192.168.169.5 (PC2) 10.1.2.3] <--> [10.1.2.2 (PC1)]
I am trying access internet from PC1 through PC2. PC2 is connected to a 3g router. I am using Olive V-R15 Pocket Rocket. I have added static routes as below for my objective.
In PC1:-
#set 10.1.2.3 as default gateway
sudo route add default gw 10.1.2.3 eth0
In PC2:-
#set 192.168.169.1 as default gateway
sudo route add default gw 192.168.169.1 eth1
In WAN router:-
#Add static route to 10.1.2.0/24 via 192.168.169.5
With the above configuration i can able to ping WAN router IP (192.168.169.1)
from PC1. But when i tried to ping 8.8.8.8
(aka www.google.com), i couldn't. i did a traceroute at PC1 and here is the output.
traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 10.1.2.3 (10.1.2.3) 27.179 ms 27.117 ms 28.014 ms
2 192.168.169.1 (192.168.169.1) 28.334 ms 28.655 ms 29.831 ms
3 220.224.141.145 (220.224.141.145) 129.838 ms 130.853 ms 132.844 ms
4 * * *
5 * * *
6 *^C (tracroute failed)
I don't why i can able ping till WAN router but not beyond that. I can do IP masquerading in PC2 for my requirement. But i would like to know what am i doing wrong with this method. Could someone clarify me? Thank you.
networking routing
3
your routing looks OK to me.. Maybe you are not NATting the connection?
â Silent-Bob
Oct 26 '15 at 12:06
I agree with @Silent-Bob. It's likely the 10.1.2.0/24 network is not being NATted on the WAN router before sending it out to the 'net. This traffic will be dropped if not by your ISP, somewhere up the chain. Even if it did make it to Google, there would be no route back. Either NAT to 192.168.169.x on PC2, or make WAN router NAT the 10.1.2.0/24 block to the WAN IP.
â stevieb
Oct 26 '15 at 14:12
I know how to NAT on PC2. But is it possible to add NAT on commercial routers for user defined subnet?
â Kumar
Oct 26 '15 at 16:13
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Consider the below network configuration.
wan ----[WAN router] <----> [eth1 (PC2) eth0]<---->[eth0 (PC1)]
wan ----[WAN router 192.168.169.1] <--> [192.168.169.5 (PC2) 10.1.2.3] <--> [10.1.2.2 (PC1)]
I am trying access internet from PC1 through PC2. PC2 is connected to a 3g router. I am using Olive V-R15 Pocket Rocket. I have added static routes as below for my objective.
In PC1:-
#set 10.1.2.3 as default gateway
sudo route add default gw 10.1.2.3 eth0
In PC2:-
#set 192.168.169.1 as default gateway
sudo route add default gw 192.168.169.1 eth1
In WAN router:-
#Add static route to 10.1.2.0/24 via 192.168.169.5
With the above configuration i can able to ping WAN router IP (192.168.169.1)
from PC1. But when i tried to ping 8.8.8.8
(aka www.google.com), i couldn't. i did a traceroute at PC1 and here is the output.
traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 10.1.2.3 (10.1.2.3) 27.179 ms 27.117 ms 28.014 ms
2 192.168.169.1 (192.168.169.1) 28.334 ms 28.655 ms 29.831 ms
3 220.224.141.145 (220.224.141.145) 129.838 ms 130.853 ms 132.844 ms
4 * * *
5 * * *
6 *^C (tracroute failed)
I don't why i can able ping till WAN router but not beyond that. I can do IP masquerading in PC2 for my requirement. But i would like to know what am i doing wrong with this method. Could someone clarify me? Thank you.
networking routing
Consider the below network configuration.
wan ----[WAN router] <----> [eth1 (PC2) eth0]<---->[eth0 (PC1)]
wan ----[WAN router 192.168.169.1] <--> [192.168.169.5 (PC2) 10.1.2.3] <--> [10.1.2.2 (PC1)]
I am trying access internet from PC1 through PC2. PC2 is connected to a 3g router. I am using Olive V-R15 Pocket Rocket. I have added static routes as below for my objective.
In PC1:-
#set 10.1.2.3 as default gateway
sudo route add default gw 10.1.2.3 eth0
In PC2:-
#set 192.168.169.1 as default gateway
sudo route add default gw 192.168.169.1 eth1
In WAN router:-
#Add static route to 10.1.2.0/24 via 192.168.169.5
With the above configuration i can able to ping WAN router IP (192.168.169.1)
from PC1. But when i tried to ping 8.8.8.8
(aka www.google.com), i couldn't. i did a traceroute at PC1 and here is the output.
traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 10.1.2.3 (10.1.2.3) 27.179 ms 27.117 ms 28.014 ms
2 192.168.169.1 (192.168.169.1) 28.334 ms 28.655 ms 29.831 ms
3 220.224.141.145 (220.224.141.145) 129.838 ms 130.853 ms 132.844 ms
4 * * *
5 * * *
6 *^C (tracroute failed)
I don't why i can able ping till WAN router but not beyond that. I can do IP masquerading in PC2 for my requirement. But i would like to know what am i doing wrong with this method. Could someone clarify me? Thank you.
networking routing
networking routing
asked Oct 26 '15 at 11:36
Kumar
11814
11814
3
your routing looks OK to me.. Maybe you are not NATting the connection?
â Silent-Bob
Oct 26 '15 at 12:06
I agree with @Silent-Bob. It's likely the 10.1.2.0/24 network is not being NATted on the WAN router before sending it out to the 'net. This traffic will be dropped if not by your ISP, somewhere up the chain. Even if it did make it to Google, there would be no route back. Either NAT to 192.168.169.x on PC2, or make WAN router NAT the 10.1.2.0/24 block to the WAN IP.
â stevieb
Oct 26 '15 at 14:12
I know how to NAT on PC2. But is it possible to add NAT on commercial routers for user defined subnet?
â Kumar
Oct 26 '15 at 16:13
add a comment |Â
3
your routing looks OK to me.. Maybe you are not NATting the connection?
â Silent-Bob
Oct 26 '15 at 12:06
I agree with @Silent-Bob. It's likely the 10.1.2.0/24 network is not being NATted on the WAN router before sending it out to the 'net. This traffic will be dropped if not by your ISP, somewhere up the chain. Even if it did make it to Google, there would be no route back. Either NAT to 192.168.169.x on PC2, or make WAN router NAT the 10.1.2.0/24 block to the WAN IP.
â stevieb
Oct 26 '15 at 14:12
I know how to NAT on PC2. But is it possible to add NAT on commercial routers for user defined subnet?
â Kumar
Oct 26 '15 at 16:13
3
3
your routing looks OK to me.. Maybe you are not NATting the connection?
â Silent-Bob
Oct 26 '15 at 12:06
your routing looks OK to me.. Maybe you are not NATting the connection?
â Silent-Bob
Oct 26 '15 at 12:06
I agree with @Silent-Bob. It's likely the 10.1.2.0/24 network is not being NATted on the WAN router before sending it out to the 'net. This traffic will be dropped if not by your ISP, somewhere up the chain. Even if it did make it to Google, there would be no route back. Either NAT to 192.168.169.x on PC2, or make WAN router NAT the 10.1.2.0/24 block to the WAN IP.
â stevieb
Oct 26 '15 at 14:12
I agree with @Silent-Bob. It's likely the 10.1.2.0/24 network is not being NATted on the WAN router before sending it out to the 'net. This traffic will be dropped if not by your ISP, somewhere up the chain. Even if it did make it to Google, there would be no route back. Either NAT to 192.168.169.x on PC2, or make WAN router NAT the 10.1.2.0/24 block to the WAN IP.
â stevieb
Oct 26 '15 at 14:12
I know how to NAT on PC2. But is it possible to add NAT on commercial routers for user defined subnet?
â Kumar
Oct 26 '15 at 16:13
I know how to NAT on PC2. But is it possible to add NAT on commercial routers for user defined subnet?
â Kumar
Oct 26 '15 at 16:13
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f238674%2fconfigure-linux-pc-as-router%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
3
your routing looks OK to me.. Maybe you are not NATting the connection?
â Silent-Bob
Oct 26 '15 at 12:06
I agree with @Silent-Bob. It's likely the 10.1.2.0/24 network is not being NATted on the WAN router before sending it out to the 'net. This traffic will be dropped if not by your ISP, somewhere up the chain. Even if it did make it to Google, there would be no route back. Either NAT to 192.168.169.x on PC2, or make WAN router NAT the 10.1.2.0/24 block to the WAN IP.
â stevieb
Oct 26 '15 at 14:12
I know how to NAT on PC2. But is it possible to add NAT on commercial routers for user defined subnet?
â Kumar
Oct 26 '15 at 16:13