0

I have setup a MaaS server with eth0 going to the internet and eth1 an internal switch connecting the the MaaS nodes. I and can commission and deploy nodes on Trusty Ubuntu but those nodes can only perform nslookup on external servers but not ping. I suspect the default gateway may be miss-configured but have no idea what it should be if it is.

Any idea what the correct configuration should be for this instance:

MaaS Server

graeme@MAAS:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:15:5d:00:07:04
          inet addr:192.168.0.4  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::215:5dff:fe00:704/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:933 errors:0 dropped:3 overruns:0 frame:0
          TX packets:796 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:814964 (814.9 KB)  TX bytes:81546 (81.5 KB)

eth1      Link encap:Ethernet  HWaddr 00:15:5d:00:07:05
          inet addr:10.1.1.100  Bcast:10.1.1.255  Mask:255.255.255.0
          inet6 addr: fe80::215:5dff:fe00:705/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:999 (999.0 B)  TX bytes:1842 (1.8 KB)

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:13351 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13351 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3635226 (3.6 MB)  TX bytes:3635226 (3.6 MB)

virbr0    Link encap:Ethernet  HWaddr 92:7f:58:38:c8:79
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

graeme@MAAS:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
10.1.1.0        0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
graeme@MAAS:~$ sudo cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.4
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 10.1.1.100 192.168.0.1

auto eth1
iface eth1 inet static
address 10.1.1.100
netmask 255.255.255.0
graeme@MAAS:~$ nslookup google.com
Server:         10.1.1.100
Address:        10.1.1.100#53

Non-authoritative answer:
Name:   google.com
Address: 216.58.198.110

graeme@MAAS:~$ ping google.com
PING google.com (216.58.198.110) 56(84) bytes of data.
64 bytes from lhr25s07-in-f14.1e100.net (216.58.198.110): icmp_seq=1 ttl=54 time=19.9 ms
64 bytes from lhr25s07-in-f14.1e100.net (216.58.198.110): icmp_seq=2 ttl=54 time=18.6 ms
^C
--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 18.651/19.324/19.997/0.673 ms

Node Server

ubuntu@node-1-tidy-balls:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:15:5d:00:07:03
          inet addr:10.1.1.151  Bcast:10.1.1.255  Mask:255.255.255.0
          inet6 addr: fe80::215:5dff:fe00:703/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1809 errors:0 dropped:0 overruns:0 frame:0
          TX packets:256 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:151375 (151.3 KB)  TX bytes:35520 (35.5 KB)

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:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1184 (1.1 KB)  TX bytes:1184 (1.1 KB)

ubuntu@node-1-tidy-balls:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.1.1.100      0.0.0.0         UG    0      0        0 eth0
10.1.1.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
ubuntu@node-1-tidy-balls:~$ sudo cat /etc/network/interfaces
auto lo
iface lo inet loopback
    dns-nameservers 10.1.1.100
    dns-search maas
auto eth0
iface eth0 inet static
    gateway 10.1.1.100
    address 10.1.1.151/24
    mtu 1500

ubuntu@node-1-tidy-balls:~$ nslookup google.com
Server:         10.1.1.100
Address:        10.1.1.100#53

Non-authoritative answer:
Name:   google.com
Address: 216.58.198.110

ubuntu@node-1-tidy-balls:~$ ping google.com
PING google.com (216.58.198.110) 56(84) bytes of data.
^C
--- google.com ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4032ms

The ping on the Node had to canceled as it didn't return anything after a minute.

  • Did you set up ip forwarding on your maas server? Your DNS server responding isn't unusual, that's able to respond on your lan network. However, without you passing traffic through your maas server you have no ability to route traffic to outside hosts. – user508889 Apr 15 '16 at 14:35
  • No I haven't setup IP forwarding on my MaaS server, a quick Google found this help.ubuntu.com/community/… Will update my question in around 5 hours if this doesn't work. – A Dark Divided Gem Apr 15 '16 at 14:39
  • That's a thorough guide, you should be able to simply follow my 'guide'/answer. :) – user508889 Apr 15 '16 at 14:52
0

On your MaaS server...

First add the rules to your interface, post up and down.

auto eth1
iface eth1 inet static
address 10.1.1.100
netmask 255.255.255.0
    post-up iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 192.168.0.4
    post-down iptables -t nat -D POSTROUTING -o eth0 -j SNAT --to-source 192.168.0.4

Then you need to enable IP forwarding. Edit /etc/sysctl.conf by adding the following line.

net.ipv4.ip_forward=1

That will take affect on restarting, but you can also trigger it on the fly by issuing...

echo 1 > /proc/sys/net/ipv4/ip_forward
| improve this answer | |
  • Thanks but after adding those settings I wasn't able to ping Google from the MaaS server itself. In the end I followed the instructions here wiki.cloudbase.it/… and go it to work – A Dark Divided Gem Apr 15 '16 at 15:05
  • Ahh, I had an IP incorrectly adjusted for your network, *192.168.1.4. Did you catch that or copy and paste? – user508889 Apr 15 '16 at 15:08
  • glad you got it working! – user508889 Apr 15 '16 at 15:09
  • Thanks for your help in pointing me in the right direction – A Dark Divided Gem Apr 15 '16 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.