LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   help with changing to different networks (https://www.linuxquestions.org/questions/linux-wireless-networking-41/help-with-changing-to-different-networks-218030/)

scottlinux 08-15-2004 06:11 PM

help with changing to different networks
 
Hey guys what is the best way to change to a different ssid/renew ip address etc from the command line?

I tried doing
$ iwconfig eth1 essid <new ssid>
and then
$ ifconfig eth1
and that seem to work, but I'm not sure if that's the best way to do it.

I seem to also be having host and display problems also when I switched to a new network:

stmiller@stm0103:~> mozilla
DISPLAY empty or unusable
DISPLAY=:0.0

I couldn't open mozilla or gaim. The browser program Links worked fine from the terminal, had an ip address and everything.

I tried setting
$ DISPLAY=<ipaddress>
and
$ DISPLAY=<stm0103>

but nothing seemed to work. Tried as root and not as root.

Any help is greatly appreciated. Thanks!

Using Suse 9.1

nickI-S 08-17-2004 08:07 AM

I am new Linux WiFi too, (but not to Linux and networking)

I think simplest robust approach is something like:

ifconfig eth1 down # maybe not necessary but should tell DHCP to undo anything
# it did for old nework
iwconfig eth1 essid newssid # Wireless bit to "link" to new network
ifconfig eth1 up # Trigger DHCP negotiate on new network.

The ifconfig steps may be unnecessary (or perhaps too strong), as DHCP may
renegotiate as link comes/goes as a result of iwconfig step.

Your DISPLAY stuff is a different class of problem.
Should really be in an XFree86 thread rather than here, but ...

Local display is usually via a UNIX domain socket which is unaffected by network.
So normaly you have

export DISPLAY=:0

The "nothing" before the colon is the UNIX domain.

If you want to connect via TCP/IP socket then put an address before the :
Something like:

export DISPLAY=192.168.0.42:0
or
export DISPLAY=hostname:0

The thing after the colon is the display number - if you have only one
graphics card then you usually only have one and it is number 0.

But note X is session based - so if network goes down / changes address
X session is lost.

scottlinux 08-17-2004 10:11 AM

Thank you for all your help!

Doing $ export DISPLAY=<newhostname>:0

works, but I have to restart the X server as everything seems to freeze if I don't. Kind of a pain, but oh well.


All times are GMT -5. The time now is 07:29 AM.