How do i find my IP address in Linux

Associate
Joined
28 Oct 2002
Posts
1,510
The reason for asking is i am trying to set up my router with my dual boot Ubuntu/WinXP system.

Does Linux use the same IP as windows? Probably not? Which is presumably why the specified ports with the winXP IP haven't opened in my Linux Azureus?

Any suggestions?

Thanks

Diss
 
Soldato
Joined
10 Jan 2004
Posts
21,921
Location
All over
If your Windows install uses a static IP, then you would need to set the same in the Linux install yes. Better option would be to setup a DHCP reservation on the router.

But yes, Una is right, ifconfig will tell you :)
 
Associate
OP
Joined
28 Oct 2002
Posts
1,510
got my router sorted owever linux has a different IP each time it boots - is there anyway to set it to the same as my WinXP IP?

thanks

Diss
 
Soldato
Joined
9 Dec 2004
Posts
5,696
Location
Dorset
As said, have you tried a DHCP reservation? You should be able to tell your router to only give it a certain IP.

Otherwise, depending on your Distro an IP can be statically set quite easily. What distribution are you using? check out /etc/sysconfig/network/ (or similar - depending on distro) for some pointers. In there are the network scripts (setting IP's, gateways etc).

If your running redhat for example, you could edit your network script for device eth0 in; /etc/sysconfig/network-scripts/ifcfg-eth0 to read something like;

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.22
NETMASK=255.255.255.0
NETWORK=192.168.0.0
HWADDR=Mac_address_here
TYPE=Ethernet
ONBOOT=yes

^ that might be right ?

I'm quite lazy so I usually do it through the GUI.
 
Last edited:
Associate
OP
Joined
28 Oct 2002
Posts
1,510
hi again

its Ubuntu

I couldn't find a similar config file - however there is a gnome GUI where i can select my eth0 properties and that is just set to DHCP (which i assume assigns a different IP each time) - the following fields are blank:
IP
Subnet
Gateway

so presumably i can just fill these in with the desired values

Diss
 
Soldato
Joined
17 Oct 2002
Posts
3,015
Diss said:
hi again

its Ubuntu

I couldn't find a similar config file - however there is a gnome GUI where i can select my eth0 properties and that is just set to DHCP (which i assume assigns a different IP each time) - the following fields are blank:
IP
Subnet
Gateway

so presumably i can just fill these in with the desired values

Diss

in case you're wondering what to put in there it should be (usually):

IP: 192.168.1.xxx
Subnet: 255.255.255.0
Gateway: your routers IPs, often 192.168.1.1
 
Associate
OP
Joined
28 Oct 2002
Posts
1,510
thanks punky

i thought that was it but haven't tried it yet nad its nice to know for sure before i mess around with it

cheers

Diss
 
Back
Top Bottom