Find the answer to your Linux question:
Results 1 to 4 of 4
Hi Guys, I'm wanting my ubuntu setup to 'get' it's IP details during bootup, i.e. before login. This is so that I can logon via NX from my laptop without ...
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    3

    Assigning ip on boot up

    Hi Guys,

    I'm wanting my ubuntu setup to 'get' it's IP details during bootup, i.e. before login.

    This is so that I can logon via NX from my laptop without having to logon via the ubuntu machine first.

    Cheers,
    Paul

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,102
    Two aproaches:
    a) Assign a static IP to the ubuntu machine.
    This can be done with the NetworkManager
    b) I *assume*, there is a dhcp server in your network.
    You can probably provide it the MAC address of your ubuntu network card
    and configure it, so that a dhcpm request with that MAC will always get the same IP as a dhcp response
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Apr 2010
    Posts
    3
    Hi Thanks for the reply, sorry it took me so long to come back to you been a busy 5 days.

    Anyway to your answers

    a) Static IP is already assigned, it's just that it doesn't 'assign' it until I actually log in.
    b) In other words always give a certain MAC address the same IP? Not an issue as the IP is static like I mentioned above.

    I should of mentioned I have already I've got a static IP, and I've modified /etc/network/interfaces to assign all the necessary details to wlan0

    Code:
    auto lo
    iface lo inet loopback
    
    auto wlan0
    iface wlan0 inet static
    wireless-essid xxxxxx
    wireless-key xxxxxxxxxxxx
    wireless-channel 13
    address 192.168.0.3
    netmask 255.255.255.0
    gateway 192.168.0.1
    I create an initialisation script, which *should* restart the network on boot and therefore assign all the appropriate details.
    Code:
    sudo gedit /etc/init.d/wireless-network
    With this content
    Code:
    /etc/init.d/networking restart
    Set it's permissions
    Code:
    sudo chmod +x /etc/init.d/wireless-network
    Created a symbolic link
    Code:
    sudo ln -s /etc/init.d/wireless-network /etc/rcS.d/S40wireless-network
    Rebooted
    Code:
    reboot
    Ok so it boots up ok and it's sitting on the login screen, when I try to ping it however it doesn't reply! What's wrong??

    Any ideas? My wireless card is a USB Netgear dongle btw, so could it just be the order in which things are run? I.e. is it trying to run the above script before it recognises the USB dongle? How could I check this?

    Thanks in advance,

    Paul

  4. #4
    Just Joined!
    Join Date
    Apr 2010
    Posts
    3
    So I did a bit of debugging of my script and my re-directed output looks like. Did an ifconfig as well

    Code:
     * Reconfiguring network interfaces...
       ...done.
    eth0      Link encap:Ethernet  HWaddr 00:01:2e:27:bc:92  
              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:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Interrupt:22 Base address:0x4000 
    
    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:16436  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)
    So when it runs the script, wlan0 hasn't registered yet, suggestions?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...