How do i find my router assigned ip address and make static?

Usually a router assigns an ip that looks similar to 192.168.0.2 . I’m wondering where in OpenSuse i can find this. And also i was wondering what i should set subnet mask and hostname to under “Network Card Setup”, so i can have a static ip with my router?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What is your intention here? If it’s simply to have an IP address on your
internal network that is static then you can set the mask (most-likely) to
255.255.255.0 and you can probably set your hostname to anything in the
world that Yast will take. You will also need a gateway which will be the
IP address of your router and probably 192.168.0.1 or 192.168.1.254 (same
values, by the way, for both of these as when you are doing DHCP). If you
are trying to have an outside-addressable setup (often referred-to by its
static IP address) then none of this is really related but since that’s a
common request I thought I would throw that out there too.

Good luck.

k3ntegra wrote:
> Usually a router assigns an ip that looks similar to 192.168.0.2 . I’m
> wondering where in OpenSuse i can find this. And also i was wondering
> what i should set subnet mask and hostname to under “Network Card
> Setup”, so i can have a static ip with my router?
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJJ3TN3AAoJEF+XTK08PnB54a8P/RbYprsYwHv6PH9jQ3+0g+tg
ieVAHIV6gQb4VrzlCSfhbNvbgUHja+VnRuZPfb2iTvB3Qry2gI3mJx0ONCBgsASv
deOVVDLsGS+2aOuF41SHrMp2cWFz09fn5oBOODo1YgW6q4BgH5LiV2W1u0rlUBvm
ciYr4bc0sX1R/dIBx7ibRu/a+PnGf+939U73M2V8TO2qHPnZhspDEBmb+gKgQ6MW
QOMYAEuZ/0B1ATdJGdte7WksD8mOeTIuei8xOsApO/cZ5vnEOoi5nobT49sZ3MR+
8RXQZZl4HFvkgQkiQOsjH/DUPv7KwyuaOnu3O1m3TeO7gZkPn6s81rCASS62CbEW
9Sd2UCqPZuTkgSDL2/+NCvB+hc9kODDqq9A+ogR5RS7GgRQB+BQpNsmqubkepyNc
qwkY+Jyx1zb6kOU8Gx9BHT2LSDAbVPJUctOkW5AQosjQvXp8kXYpOIXo+UnjPd3n
tHMi5XUDdhuQ2OSfub2WIzG7i8rSuqA0vkcj9a1riAYqhIT5cPIoUso3t8uwgw/e
2ymPRq3ig2J5VLoEYNkheyU2FsbLUUc1WwNQMF4qjp9QwwZLGAHrTH2nhQDdo6f0
qoIepPk04dKy4cDiIBMFmJHtFRRTfmddXE94MXfZ5ojEb1NWYJPCuhiNBRqbIJZ1
46lUF3JQLFATdqTHYeiO
=c7RY
-----END PGP SIGNATURE-----

If your intention is to always have the same IP address, some routers offer you the ability to make a permanent reservation on the IP address that was handed out via DHCP. So you can continue to use DHCP to get an address, but with the assurance that it will always be the same address, so you can use port forwarding, run services for the LAN, etc. Worth looking at your router’s web pages to see if the feature is offered.

Well in that case im just interested in finding the ip address assigned by my router so i can portforward that ip address…

Just look at the output of /sbin/ip addr. It will be under eth0, on the line starting inet:. But be aware that the router could assign you a different address next time, although the assignment tends to stick for a long time, or even forever, if there are lots of free addresses. Hence my post about seeing if the router will let you pin down the address.

k3ntegra wrote:
> Well in that case im just interested in finding the ip address assigned
> by my router so i can portforward that ip address…

If you just want to know what address has been assigned, open a terminal and
enter the command


/sbin/ifconfig

I typed that into the terminal exactly and got a message stating

“Could not find the program ‘ifconfig’”

Yet when i go to /sbin , the file ifconfig is right there :frowning:

You have to be root to run ifconfig. Try


sudo /sbin/ifconfig

Not really, if you just want to display the configuration. But it’s possible that he has strict permissions and the program is not executable by a normal user. However ifconfig itself doesn’t require root privileges to display information, only to modify interfaces.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

No, you don’t… you just have to have it in your path to call it without
specifying the path but you definitely don’t need to be root to run it.

Regardless of that you should be using the ‘ip’ command anyway:

ip addr sh
ip route sh
cat /etc/resolv.conf

Good luck.

smpoole7 wrote:
> You have to be root to run ifconfig. Try
>
>
> Code:
> --------------------
>
> sudo /sbin/ifconfig
>
> --------------------
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJJ3VBxAAoJEF+XTK08PnB5TtcP/3aoPomw0TymtSjPI2GDZR3T
FoEw/s43Zly8uEUiUtKHOrYiwjdejHLl9ljCU6PVZm0CD0QTUJFdMB5DnH5UQsNp
i6TEiK47I0znMKBucw0qjIgBX+zcBsdh7u2fWY8WRb0BU3oCXeyEUvivlxV0evyv
z0ILSyOcRmuS/d295ubwz218/X9UUp+fc9ZMECPpcoNWJSP7S7pyhksLBxTzrupC
Xdz99LX+CAm4pLvz3Ks97NUjVxHHzD/TIL83SBu6B5N5okW3ZYxjZBEC4E9B7Nv7
jCyD4KAoKtCU8EYYU0YdOmQE009zGFIOt0FJzsn8rVY+KEN7NkmV9F7T9S9Vgun9
CdTYCT8o0smOy1nNtDXwsc0RtZec5+raiKuEN2bo5MbRJX0SjahPiJuo7CBN8foA
AEt5Y2rh9/o7UPMOhk347AmNjQCz9f18daJ9KOhlEpsBzvEQh7kn0woRLdHY71Ns
xiV4mhc7ly0WYOaD41NGmxdP5I9C906WGXpUgrX5GV+aRW2qOB8kiR3zjp4KxZoA
/f3PbrKlMfDFT/pCVHWlVIXiH501YY/N0Zw7WmC+K5xAz8XoSGpnMocrMyvxdGKW
zVzbNYEwA8EreKBYdeTRwHhUgnp2+/Vpq3slKi1Qff+WR/dbLAzbkt+wt6wW6fIG
/j4TPoTGv/ZKGoxjy98D
=mm+j
-----END PGP SIGNATURE-----

Yeah i typed that , then the terminal box was able to go away and i saw a bouncing ball next to my cursor, but nothing was able to load.

ip addr sh
ip route sh
cat /etc/resolv.conf

I typed that and the terminal box just went away quickly…

BTW i manually oppened resolv.conf file saw the following

Please remove (at least) this line when you modify the file!

search hsd1.md.comcast.net.
nameserver 192.168.0.1

I guess that’s the ip address, but isn’t the last number supposed to be after a 1? or 2 at the least?

Edit: I just checked it in windows xp and i was right, my ip is supposed to be 192.168.0.2.

But i’d still really like to know how i can find this in OpenSuse.

You have to open a terminal instead of typing it into krunner.

Start “konsole” or “xterm” and apply the commands there.

thanks alot bro, i’ll be sure to rep when i can.

On a typical Opensuse system, it’s in /sbin/ifconfig, and you can’t run it unless you’re root. On my 11.1 laptop here at work, I can cd into /sbin and try to run “ifconfig,” but I’ll get,


Program 'ifconfig' is present in package 'net-tools', which is installed on your system.

Absolute path to 'ifconfig' is '/sbin/ifconfig', so it might be intended to be run only by user with superuser privileges (eg. root).

bash: ifconfig: command not found

… and it doesn’t run.

Wherefore and whence, if you want use “ifconfig” on a typical Opensuse system, the easiest, quickest and most fool-proof way is just to enter “sudo ifconfig.”

There you go. :slight_smile:

$ cd /sbin
$ ./ifconfig
eth0 Link encap:Ethernet …

What you encountered is not proof that you need to be root to run it, it’s simply a $PATH issue. As you should know, cd to the directory doesn’t help locate the program for execution if . (dot) is not in $PATH.

Notice that the message from the “command-not-found” utility says “might”, because they know that some programs in /sbin can be meaningfully run by non-root users. Just because a program is in /sbin, doesn’t mean that non-root users can’t run it and get results for some operations.

Another program that doesn’t require root privilege to run if you just want to display results is route. Do:

/sbin/route

and you will see. It’s so useful to me to run ifconfig/ip and route without having to su, that I have symlinks from ~/bin (which is on my $PATH) to those programs in /sbin.

smpoole7 wrote:
> ken_yap;1970327 Wrote:
>> Not really, if you just want to display the configuration.
>
> On a typical Opensuse system, it’s in /sbin/ifconfig, and you can’t run
> it unless you’re root. On my 11.1 laptop here at work, I can cd into
> /sbin and try to run “ifconfig,” but I’ll get,
>
>
> Code:
> --------------------
>
> Program ‘ifconfig’ is present in package ‘net-tools’, which is installed on your system.
>
> Absolute path to ‘ifconfig’ is ‘/sbin/ifconfig’, so it might be intended to be run only by user with superuser privileges (eg. root).
>
> bash: ifconfig: command not found
>
> --------------------
>
>
> … and it doesn’t run.
>
> Wherefore and whence, if you want use “ifconfig” on a typical Opensuse
> system, the easiest, quickest and most fool-proof way is just to enter
> “sudo ifconfig.”
>
> There you go. :slight_smile:

Two wrong pieces of information here. First of all, ifconfig will run for an
unprivileged user. You just do not have access to all the features. The second
part that is wrong is that “sudo ifconfig” will not work in most cases because
/sbin is not in the path. Thus the two forms of the command are “/sbin/ifconfig”
if you do not need the privileged operations, or “sudo /sbin/ifconfig” if you
do. Only if you first do a “su” and log in as root can you do a bare “ifconfig”,
but I do not recommend that. As root, there are too many ways to screw up your
system.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Agreed to this and to Larry. By just going into a directory and running a
command in that directory you are assuming that the current working
directory is in your PATH statement, which is a huge no-no. Add ‘./’ to
‘ifconfig’ and it will work as any old user, though with the caveats
others have mentioned (you can’t change system things).

cd /sbin
…/ifconfig

Or just:
/sbin/ifconfig

Good luck.

ken yap wrote:
> smpoole7;1970644 Wrote:
>> On my 11.1 laptop here at work, I can cd into /sbin and try to run
>> “ifconfig,” but I’ll get,
>>
> Code:
> --------------------
> > >
> > Program ‘ifconfig’ is present in package ‘net-tools’, which is installed on your system.
> >
> > Absolute path to ‘ifconfig’ is ‘/sbin/ifconfig’, so it might be intended to be run only by user with superuser privileges (eg. root).
> >
> > bash: ifconfig: command not found
> >
> --------------------
>
>> $ cd /sbin
>> $ ./ifconfig
>> eth0 Link encap:Ethernet …
>
> What you encountered is not proof that you need to be root to run it,
> it’s simply a $PATH issue. As you should know, cd to the directory
> doesn’t help locate the program for execution if . (dot) is not in
> $PATH.
>
> Notice that the message from the “command-not-found” utility says
> “might”, because they know that some programs in /sbin can be
> meaningfully run by non-root users. Just because a program is in /sbin,
> doesn’t mean that non-root users can’t run it and get results for -some-
> operations.
>
> Another program that doesn’t require root privilege to run if you just
> want to display results is route. Do:
>
>
> Code:
> --------------------
> /sbin/route
> --------------------
>
>
> and you will see. It’s so useful to me to run ifconfig/ip and route
> without having to su, that I have symlinks from ~/bin (which is on my
> $PATH) to those programs in /sbin.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJJ3itZAAoJEF+XTK08PnB5aPEQAM7yuRM3CpcWilW2X+ZaywSn
C+qN5DnQ51j+hvUyupZU1vWWqdksZJHA8N9+s+u7IYzUaj0W2OjFUEBwD99lUNC8
Vo5MHeYqgF8bdI8bAslgoT68n/W2JcRqB+cVHQ6xs1CcC4f0SzRhNU5A4romKzH0
U9yHcO50msrt8f9Ge8+02FXfjGCZmh4RMjbRCW1NwpEL9rtQ6Kdmw7EwrEkllCAr
Uk5QU2lZz8//ksovjIZpoacb7UzGUc79IO5DeAsMYPJPmsFC7Q0UbkAXYPbjI+oY
d9QRTsUxmPp+R8JuZNHAS7uhpOMcjtTPh7Qc3AlvzPAsCX6traOZvtKbDj1wrfQ9
PqubdoSGJ21izQudDu/bXBMequyIp/qsX161R093OFe/VKjRnxaU3v+wSFwN8anJ
fSjhObM7FjDI59dgIu2GnkZQ35uHbIFj4fFrdguP0tA6GKyj6flhnr8AYsZ55XKF
6ePiokxrozRwMxBBQDMyJKZG5rsWM2oUGP5JfveMK64HtTE1gx963WrUbyOn51C6
Wb8xK1ORto+ORBSjrG1KzyLVB3WB+QL57hvX6s2/UYwEi0mv6fw9ph+DDmNhNzxD
XCFYe6AUqFbwcDX+yocUPiAoJkk/LYeX/dkabntHknEoxc/Lb30/CKiniJ0wKH9v
lYa66QCCgUI9ta3VZ1/i
=Z5kd
-----END PGP SIGNATURE-----