Jump to content
Not connected, Your IP: 3.145.79.214
Sign in to follow this  
frankwit

Ubuntu 14 as a router..what am I doing wrong?

Recommended Posts

Hi All,

I seem to be doing something wrong, but I cannot figure out what..

 

Mac Mini 2 eth ports Ubuntu 14.04 desktop eth0 as WAN eth1 as LAN,  NO wifi

 

Airvpn working to the outside  world, 

 

DHCP an DNS working on the internal side 172.xxx.xxx.xxx range

However the internal connected Raspberry gets it DHCP address  and the PI DOES  resolve ip-adresses but won't ping...

100% packet loss....

even when disconnected form Airvpn eth1 wil not ping outside of it's own range. 

 

Any help Much appreciated !

 

 

ifconfig on the mac-mini

 

eth0      Link encap:Ethernet  HWaddr xxxxxxxxxxxx 

          inet addr:192.168.1.11  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::426c:8fff:fe03:d9a8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:676093 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1124729 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:177998285 (177.9 MB)  TX bytes:1566505397 (1.5 GB)
          Interrupt:16 
 
eth1      Link encap:Ethernet  HWaddr 00:xxxxxxxxxxx
          inet addr:172.17.207.121  Bcast:172.17.207.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:4cff:fe36:1399/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4882 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2971 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:650373 (650.3 KB)  TX bytes:1196377 (1.1 MB)
 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:28680 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28680 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:71999461 (71.9 MB)  TX bytes:71999461 (71.9 MB)
 
tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.4.10.46  P-t-P:10.4.10.46  Mask:255.255.0.0
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:26 errors:0 dropped:0 overruns:0 frame:0
          TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:8383 (8.3 KB)  TX bytes:3713 (3.7 KB)
 
root@frank-Macmini:/home/frank/p2pool# ping google.com
PING google.com (216.58.210.78) 56(84) bytes of data.
64 bytes from lhr14s24-in-f14.1e100.net (216.58.210.78): icmp_seq=1 ttl=57 time=18.5 ms
64 bytes from lhr14s24-in-f14.1e100.net (216.58.210.78): icmp_seq=2 ttl=57 time=18.4 ms
64 bytes from lhr14s24-in-f14.1e100.net (216.58.210.78): icmp_seq=3 ttl=57 time=17.4 ms
64 bytes from lhr14s24-in-f14.1e100.net (216.58.210.78): icmp_seq=4 ttl=57 time=18.0 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 17.426/18.142/18.598/0.468 ms
 
and for the PI:
 
pi@raspberrypi ~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:xxxxxxx  
          inet addr:172.17.207.1  Bcast:172.17.207.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8303 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10394 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2457180 (2.3 MiB)  TX bytes:1520422 (1.4 MiB)
 
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:34 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2652 (2.5 KiB)  TX bytes:2652 (2.5 KiB)
 
pi@raspberrypi ~ $ ping google.com
PING google.com (216.58.208.78) 56(84) bytes of data.
^C
--- google.com ping statistics ---
12 packets transmitted, 0 received, 100% packet loss, time 11005ms
 
IPtables:
 
# Generated by iptables-save v1.4.21 on Tue Jan  5 13:58:24 2016
*filter
:INPUT ACCEPT [106256:16543662]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [26509:243970113]
-A FORWARD -i eth1 -j ACCEPT
-A FORWARD -i eth1 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i eth0 -o eth1 -j ACCEPT
COMMIT
*nat
:PREROUTING ACCEPT [500:30748]
:INPUT ACCEPT [58:3710]
:OUTPUT ACCEPT [87:6770]
:POSTROUTING ACCEPT [87:6770]
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Tue Jan  5 13:58:24 2016
 
 

Share this post


Link to post

Make sure forwarding is on @ sysctl.conf

nano -w /etc/sysctl.conf

net.ipv4.ip_forward = 1

Reload sysctl if needed. sysctl -p

 

 

It May also need:

iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

 

 

And:

-A FORWARD -i tun0 -o eth1 -j ACCEPT
-A FORWARD -i eth1 -o tun0 -j ACCEPT
 

 

If its not running a dhcp setup on the lan / eth1 then manual setup of the dns for the machines connecting to the router could be needed.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image
Sign in to follow this  

×
×
  • Create New...