Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: how to set up ad-hoc network

  1. #1

    Default how to set up ad-hoc network

    Hey guys,

    I am new to linux - first day.

    I used to have a shell script on my freebsd box to configure an adhoc network
    I am using the intel pro wireless 2200bg wireless nic
    The driver is ipw2200

    Could someone help me translate this script to run on linux?

    ifconfig iwi0 ssid wiretap
    ifconfig iwi0 mediaopt adhoc
    ifconfig iwi0 up
    ifconfig iwi0 192.168.2.34

    I am running in "OPEN" mode. If you need more info please let me know.

    Thanks

    G

  2. #2

    Default Re: how to set up ad-hoc network

    Reading

    Code:
    man iwconfig
    should help.
    Never attribute to malice that which can be adequately explained by stupidity. (R.J. Hanlon)

  3. #3

    Default Re: how to set up ad-hoc network

    thanks that did it

    iwconfig eth0 essid wiretap
    iwconfig eth0 mode Ad-Hoc
    iwconfig eth0 up
    iwconfig eth0 192.168.2.55

  4. #4

    Default Re: how to set up ad-hoc network

    I don't think so, these commands

    Code:
    iwconfig eth0 up
    iwconfig eth0 192.168.2.55
    certainly don't work with iwconfig.
    Never attribute to malice that which can be adequately explained by stupidity. (R.J. Hanlon)

  5. #5

    Default Re: how to set up ad-hoc network

    so would I use ip like this?

    ip link set dev eth0 up
    ip addr add 192.168.2.89 eth0

  6. #6

    Default Re: how to set up ad-hoc network

    If you want, why not, but using iwconfig for the purely wireless related commands (setting ssid/mode/etc.) and ifconfig for the others would also work.
    Never attribute to malice that which can be adequately explained by stupidity. (R.J. Hanlon)

  7. #7

    Default Re: how to set up ad-hoc network

    help this has gotten bad. I created a new script
    Code:
    iwconfig eth0 mode Ad-Hoc
    iwconfig eth0 essid wiretap
    iwconfig eth0 chan 11
    ifconfig eth0 up
    ifconfig eth0 192.168.2.55
    ip route add  default via 192.168.2.254
    but it doesnt work :/

    I need some more help. What is the command to scan for wireless networks? in bsd its ifconfig eth0 scan but I need the linux equiv

    here is the output from some commands
    Code:
    # iwconfig eth0
    eth0      IEEE 802.11b  ESSID:"wiretap"  
              Mode:Ad-Hoc  Frequency:2.462 GHz  Cell: 02:18:41:89:98:FD   
              Bit Rate:11 Mb/s   Tx-Power=20 dBm   Sensitivity=8/0  
              Retry limit:7   RTS thr:off   Fragment thr:off
              Encryption key:off
              Power Management:off
              Link Quality=65/100  Signal level=-62 dBm  Noise level=-85 dBm
              Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
              Tx excessive retries:0  Invalid misc:5   Missed beacon:0
    
    # ifconfig eth0 
    eth0      Link encap:Ethernet  HWaddr 00:13:CE:7F:4D:68  
              inet addr:192.168.2.55  Bcast:192.168.2.255  Mask:255.255.255.0
              inet6 addr: fe80::213:ceff:fe7f:4d68/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:276 errors:0 dropped:5 overruns:0 frame:0
              TX packets:12 errors:0 dropped:121 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:11239 (10.9 Kb)  TX bytes:22624 (22.0 Kb)
              Interrupt:23 Base address:0xa000 Memory:b0107000-b0107fff
    note that in iwconfig is should be saying 11g not 11b but I cant manually change.

    Code:
    # netstat -rn
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
    192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
    127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
    0.0.0.0         192.168.2.254   0.0.0.0         UG        0 0          0 eth0
    
    # netstat -i eth0
    Kernel Interface table
    Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR   TX-OK TX-ERR TX-DRP TX-OVR Flg
    eth0   1500   0     519      0      0      5      15      0      0    121 BMRU
    
    # ping 192.168.2.254
    PING 192.168.2.254 (192.168.2.254) 56(84) bytes of data.
    64 bytes from 192.168.2.254: icmp_seq=1 ttl=64 time=16.4 ms
    64 bytes from 192.168.2.254: icmp_seq=2 ttl=64 time=6.19 ms
    64 bytes from 192.168.2.254: icmp_seq=3 ttl=64 time=5.45 ms
    ^C
    --- 192.168.2.254 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2005ms
    rtt min/avg/max/mdev = 5.455/9.382/16.496/5.040 ms
    
    linux-p0a1:/home/chrisd # ping 128.112.128.112
    PING 128.112.128.112 (128.112.128.112) 56(84) bytes of data.
    ^C
    --- 128.112.128.112 ping statistics ---
    7 packets transmitted, 0 received, 100% packet loss, time 5999ms
    
    linux-p0a1:/home/chrisd # nslookup www.google.com
    ;; connection timed out; no servers could be reached
    I can ping both to and from the router <--> laptop

    However I cannot telnet or ssh, so somewhere in there lies the problem. Anyone can please help?

    Thanks

  8. #8

    Default Re: how to set up ad-hoc network

    If you have a router then why an Ad-Hoc network setup?

    And why don't you use the configuration tools provided by your distribution?

    P.S.

    Without name servers (/etc/resolv.conf) there is also no way for that last command to work (which needs DNS).
    Never attribute to malice that which can be adequately explained by stupidity. (R.J. Hanlon)

  9. #9

    Default Re: how to set up ad-hoc network

    maybe router is not the right term. what is the right term access point?

    I also manually added 4.2.2.5 to my /etc/resolv.conf that didnt work.

    I have to configure it manually because the tools that come with this distribution 11.1 / KDE dont have an option for ad-hoc.

    Also I should be able to telnet/ssh from the phone to the laptop, but I cannot because it times out.

    Thanks in advance

  10. #10

    Default Re: how to set up ad-hoc network

    Well, iwconfig shows that you are connected to "wiretap" and pings to the "router" also work.

    Using the "traditional method with ifup" (instead of NetworkManager) in YaST will give you the possibility to set up an Ad-hoc network.

    BTW:

    Does your laptop actually run sshd and are the ports open (firewall)?
    Never attribute to malice that which can be adequately explained by stupidity. (R.J. Hanlon)

Page 1 of 2 12 LastLast

Posting Permissions

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