1

I'm setting up an Ubuntu Server 14.04 with a wired connection (p4p1) and creating an ad-hoc wireless network. Here's my interfaces file:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto p4p1
iface p4p1 inet dhcp

# WiFi
auto wlan0
iface wlan0 inet dhcp
wireless-mode ad-hoc
wireless-channel 4
wireless-essid Augmented Learning
wireless-key 1234567890
address 192.168.0.2
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.2

Things are running smooth when one of the two interface is up, but when both are up, I can neither access Internet (via p4p1) nor access my ad-hoc network (with wlan0).

What should I do to run them both at the same time ? I don't need to share the connection.

Thanks,

  • 2
    I'm not sure I have sufficient knowledge to answer, but I believe more experienced users would like to see the output of ifconfig. – Andrea Lazzarotto Aug 2 '14 at 13:16
1
+50

One thing you should not do is point the gateway to your own IP. The gateway tells the system how to route to any IP address not in any of the subnets to which it is directly connected. Normally this is the route to "the Internet", so should not be present for a connection to an internal network unless the route to the Internet is on a host on that network. So remove the gateway line from your definition of wlan0.

There may be multiple things wrong here, so this might not be the only change needed to fix your problem.

  • Commenting the gateway line worked perfectly, thank you! – NorTicUs Aug 6 '14 at 13:11
-2

Maybe i know how you could use a file called asleep.d it can be downloaded here.

https://app.box.com/s/5nj2xuhby5kqk1y3o7wb

you just copy it over to /etc/pm

  • 2
    Why would I put the network manager to sleep ? Could you explain a bit more what does this script does and why? – NorTicUs Aug 6 '14 at 12:54
  • it could maybe work this way that it's unsleep the network by making it false. – Michael Aug 7 '14 at 9:24

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.