Configure Linux PC as router

The name of the pictureThe name of the pictureThe name of the pictureClash 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


WAN router - routing table



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.










share|improve this question

















  • 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














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


WAN router - routing table



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.










share|improve this question

















  • 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












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


WAN router - routing table



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.










share|improve this question













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


WAN router - routing table



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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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












  • 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















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay