Setting Ubuntu server as router can't access internet
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
1
down vote
favorite
Im trying to simulate a network (router, firewall, PCs and server) with several virtual machines running Ubuntu Server. I have followed several tutorials, questions on this froum and so on but I can't get it working.
My setup
-> One virtual machine that is suppoused to be the router with 2 network interfaces
- enp0s3 -> connected with my machine (where I have internet)
- enp0s8 -> connected into a private network
-> One virtual machine that is suppoused to be the firewall with 3 network interfaces
enp0s3 -> connected in the same private network
the other 2 are for server and pc but not using them right now
So far I've got
/etc/network/interfaces device one (router)
auto enp0s3
iface enp0s3 inet dhcp
auto enp0s8
iface enp0s8 inet static
address 10.20.0.1
netmask 255.255.192.0
network 10.20.0.0
broadcast 10.20.63.255
gateway 10.20.0.1
iptable
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE ALL -- anywhere anywhere
I have aswell uncommented the line net.ipv4.ip_forward=1
in /etc/sysctl.conf
/etc/network/interfaces device two (firewall)
(I just copied the one that is connected with the router)
auto enp0s3
iface enp0s3 inet static
address 10.20.0.2
netmask 255.255.192.0
network 10.20.0.0
broadcast 10.20.63.255
gateway 10.20.0.1
.....
iptable is empty in this one (Im not sure if I have to set anything)
Router has connection with internet, both devices communicate with each other (ping).
My problem
I'm trying to Access google (ping 8.8.8.8) with my firewall device but it says:
connect: Network is unreachable
What am I missing? Why can't I Access the internet in my second device?
P.S: I have both adapters set in the same network in VirtualBox
networking iptables router
add a comment |Â
up vote
1
down vote
favorite
Im trying to simulate a network (router, firewall, PCs and server) with several virtual machines running Ubuntu Server. I have followed several tutorials, questions on this froum and so on but I can't get it working.
My setup
-> One virtual machine that is suppoused to be the router with 2 network interfaces
- enp0s3 -> connected with my machine (where I have internet)
- enp0s8 -> connected into a private network
-> One virtual machine that is suppoused to be the firewall with 3 network interfaces
enp0s3 -> connected in the same private network
the other 2 are for server and pc but not using them right now
So far I've got
/etc/network/interfaces device one (router)
auto enp0s3
iface enp0s3 inet dhcp
auto enp0s8
iface enp0s8 inet static
address 10.20.0.1
netmask 255.255.192.0
network 10.20.0.0
broadcast 10.20.63.255
gateway 10.20.0.1
iptable
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE ALL -- anywhere anywhere
I have aswell uncommented the line net.ipv4.ip_forward=1
in /etc/sysctl.conf
/etc/network/interfaces device two (firewall)
(I just copied the one that is connected with the router)
auto enp0s3
iface enp0s3 inet static
address 10.20.0.2
netmask 255.255.192.0
network 10.20.0.0
broadcast 10.20.63.255
gateway 10.20.0.1
.....
iptable is empty in this one (Im not sure if I have to set anything)
Router has connection with internet, both devices communicate with each other (ping).
My problem
I'm trying to Access google (ping 8.8.8.8) with my firewall device but it says:
connect: Network is unreachable
What am I missing? Why can't I Access the internet in my second device?
P.S: I have both adapters set in the same network in VirtualBox
networking iptables router
The iptables output does not give enough information. If you have only masquerading without other iptables settings, that is not enough.
â nobody
Apr 1 at 19:35
its the only one I have, what else do I need?
â Alex_Crw45
Apr 1 at 20:35
I am not 100% sure any more, but I think you have to take care of established and related connections. Take a look here tldp.org/HOWTO/html_single/Masquerading-Simple-HOWTO and here billauer.co.il/ipmasq-html.html. Next is more detailed tutorial, where I learned iptables from frozentux.net/iptables-tutorial/iptables-tutorial.html. The data on iptables, you have provided does not give information about interfaces. Provide configuration or commands not just the part of output.
â nobody
Apr 3 at 5:15
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Im trying to simulate a network (router, firewall, PCs and server) with several virtual machines running Ubuntu Server. I have followed several tutorials, questions on this froum and so on but I can't get it working.
My setup
-> One virtual machine that is suppoused to be the router with 2 network interfaces
- enp0s3 -> connected with my machine (where I have internet)
- enp0s8 -> connected into a private network
-> One virtual machine that is suppoused to be the firewall with 3 network interfaces
enp0s3 -> connected in the same private network
the other 2 are for server and pc but not using them right now
So far I've got
/etc/network/interfaces device one (router)
auto enp0s3
iface enp0s3 inet dhcp
auto enp0s8
iface enp0s8 inet static
address 10.20.0.1
netmask 255.255.192.0
network 10.20.0.0
broadcast 10.20.63.255
gateway 10.20.0.1
iptable
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE ALL -- anywhere anywhere
I have aswell uncommented the line net.ipv4.ip_forward=1
in /etc/sysctl.conf
/etc/network/interfaces device two (firewall)
(I just copied the one that is connected with the router)
auto enp0s3
iface enp0s3 inet static
address 10.20.0.2
netmask 255.255.192.0
network 10.20.0.0
broadcast 10.20.63.255
gateway 10.20.0.1
.....
iptable is empty in this one (Im not sure if I have to set anything)
Router has connection with internet, both devices communicate with each other (ping).
My problem
I'm trying to Access google (ping 8.8.8.8) with my firewall device but it says:
connect: Network is unreachable
What am I missing? Why can't I Access the internet in my second device?
P.S: I have both adapters set in the same network in VirtualBox
networking iptables router
Im trying to simulate a network (router, firewall, PCs and server) with several virtual machines running Ubuntu Server. I have followed several tutorials, questions on this froum and so on but I can't get it working.
My setup
-> One virtual machine that is suppoused to be the router with 2 network interfaces
- enp0s3 -> connected with my machine (where I have internet)
- enp0s8 -> connected into a private network
-> One virtual machine that is suppoused to be the firewall with 3 network interfaces
enp0s3 -> connected in the same private network
the other 2 are for server and pc but not using them right now
So far I've got
/etc/network/interfaces device one (router)
auto enp0s3
iface enp0s3 inet dhcp
auto enp0s8
iface enp0s8 inet static
address 10.20.0.1
netmask 255.255.192.0
network 10.20.0.0
broadcast 10.20.63.255
gateway 10.20.0.1
iptable
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE ALL -- anywhere anywhere
I have aswell uncommented the line net.ipv4.ip_forward=1
in /etc/sysctl.conf
/etc/network/interfaces device two (firewall)
(I just copied the one that is connected with the router)
auto enp0s3
iface enp0s3 inet static
address 10.20.0.2
netmask 255.255.192.0
network 10.20.0.0
broadcast 10.20.63.255
gateway 10.20.0.1
.....
iptable is empty in this one (Im not sure if I have to set anything)
Router has connection with internet, both devices communicate with each other (ping).
My problem
I'm trying to Access google (ping 8.8.8.8) with my firewall device but it says:
connect: Network is unreachable
What am I missing? Why can't I Access the internet in my second device?
P.S: I have both adapters set in the same network in VirtualBox
networking iptables router
networking iptables router
asked Apr 1 at 16:46
Alex_Crw45
61
61
The iptables output does not give enough information. If you have only masquerading without other iptables settings, that is not enough.
â nobody
Apr 1 at 19:35
its the only one I have, what else do I need?
â Alex_Crw45
Apr 1 at 20:35
I am not 100% sure any more, but I think you have to take care of established and related connections. Take a look here tldp.org/HOWTO/html_single/Masquerading-Simple-HOWTO and here billauer.co.il/ipmasq-html.html. Next is more detailed tutorial, where I learned iptables from frozentux.net/iptables-tutorial/iptables-tutorial.html. The data on iptables, you have provided does not give information about interfaces. Provide configuration or commands not just the part of output.
â nobody
Apr 3 at 5:15
add a comment |Â
The iptables output does not give enough information. If you have only masquerading without other iptables settings, that is not enough.
â nobody
Apr 1 at 19:35
its the only one I have, what else do I need?
â Alex_Crw45
Apr 1 at 20:35
I am not 100% sure any more, but I think you have to take care of established and related connections. Take a look here tldp.org/HOWTO/html_single/Masquerading-Simple-HOWTO and here billauer.co.il/ipmasq-html.html. Next is more detailed tutorial, where I learned iptables from frozentux.net/iptables-tutorial/iptables-tutorial.html. The data on iptables, you have provided does not give information about interfaces. Provide configuration or commands not just the part of output.
â nobody
Apr 3 at 5:15
The iptables output does not give enough information. If you have only masquerading without other iptables settings, that is not enough.
â nobody
Apr 1 at 19:35
The iptables output does not give enough information. If you have only masquerading without other iptables settings, that is not enough.
â nobody
Apr 1 at 19:35
its the only one I have, what else do I need?
â Alex_Crw45
Apr 1 at 20:35
its the only one I have, what else do I need?
â Alex_Crw45
Apr 1 at 20:35
I am not 100% sure any more, but I think you have to take care of established and related connections. Take a look here tldp.org/HOWTO/html_single/Masquerading-Simple-HOWTO and here billauer.co.il/ipmasq-html.html. Next is more detailed tutorial, where I learned iptables from frozentux.net/iptables-tutorial/iptables-tutorial.html. The data on iptables, you have provided does not give information about interfaces. Provide configuration or commands not just the part of output.
â nobody
Apr 3 at 5:15
I am not 100% sure any more, but I think you have to take care of established and related connections. Take a look here tldp.org/HOWTO/html_single/Masquerading-Simple-HOWTO and here billauer.co.il/ipmasq-html.html. Next is more detailed tutorial, where I learned iptables from frozentux.net/iptables-tutorial/iptables-tutorial.html. The data on iptables, you have provided does not give information about interfaces. Provide configuration or commands not just the part of output.
â nobody
Apr 3 at 5:15
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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%2faskubuntu.com%2fquestions%2f1021094%2fsetting-ubuntu-server-as-router-cant-access-internet%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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
The iptables output does not give enough information. If you have only masquerading without other iptables settings, that is not enough.
â nobody
Apr 1 at 19:35
its the only one I have, what else do I need?
â Alex_Crw45
Apr 1 at 20:35
I am not 100% sure any more, but I think you have to take care of established and related connections. Take a look here tldp.org/HOWTO/html_single/Masquerading-Simple-HOWTO and here billauer.co.il/ipmasq-html.html. Next is more detailed tutorial, where I learned iptables from frozentux.net/iptables-tutorial/iptables-tutorial.html. The data on iptables, you have provided does not give information about interfaces. Provide configuration or commands not just the part of output.
â nobody
Apr 3 at 5:15