Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to setup dhcp and static IP I have 2 lan card, Ubuntu 12.04 and it is a laptop the wireless interface I want to give a static IP and lan to have a dynamic ip how should I go about making changes in /etc/network/interfaces file the wlan0 is wireless interface and eth0 is lan card that is what ifconfig reports

till now I tried

auto lo
iface lo inet static
        address 192.168.1.7
        netmask 255.255.255.0
        gateway 192.168.1.1
        network 192.168.1.0
        broadcast 192.168.1.255
        dns-nameservers 127.0.0.1
        dns-search home.lan
        dns-domain home.lan

and

auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
  address 192.168.1.7
  netmask 255.255.255.0
  gateway 192.168.1.1
  network 192.168.1.0
        broadcast 192.168.1.255
        dns-nameservers 127.0.0.1
        dns-search home.lan
        dns-domain home.lan

these both seem to have broken one or the other service.

share|improve this question
    

1 Answer 1

Seems like your off to a good start but there are more steps and auto generated files that need to be worked on. Also properly taking the network down and up is key. sudo service network restart is depreciated and I would not use it.

A guide to point you in the right direction can be found below. I would skip the removing dchp client and adlib what makes sense: http://lani78.wordpress.com/2012/07/19/change-to-static-ip-on-the-ubuntu-precise-pangolin-server/

share|improve this answer
2  
Please include essential parts of the linked article in your answer. External links may die at some point. –  gronostaj Dec 24 '13 at 21:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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