Results 1 to 10 of 10

Thread: Cannot connect to internet after setting static ip address opensuse leap

  1. #1

    Default Cannot connect to internet after setting static ip address opensuse leap

    I had to set static address on wlan0 so I can do port forwarding on my ZTE ZXHN H298N Hyperoptic router. Found IPv4 Address and Subnet using :~> ifconfig - inet addr = 192.168.1.104 Mask = 255.255.255.0 In /etc/sysconfig/network/ifcfg-wlan0changed (i)BOOTPROTO = 'static' (ii)'IPADDR' = 192.168..1.104 <-- read from ifconfig (iii)'NETMASK'= 255.255.255.0 <-- subnet read from ifconfig (iv)BROADCAST = 192.168.1.255 <-- read from ifconfigRestarted network for changes to take effect: :~> sudo systemctl restart network


    Now I cannot connect to internet, and so unable to do online port checking. When I open web browser I see message "can't establish connection to server". There were no problems connecting to internet prior to setting static ip address. Any thoughts? All suggestions will be greatly welcome.



  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,357
    Blog Entries
    15

    Default Re: Cannot connect to internet after setting static ip address opensuse leap

    Hi
    The ifconfig command is deprecated, use ip addr instead... anyway Use YaST Network Settings to set you static ip address, netmask, DNS severs (on the Hostname/DNS) tab and then also your default gateway address on the Routing tab. Just setting the ip address isn't enough
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,685
    Blog Entries
    3

    Default Re: Cannot connect to internet after setting static ip address opensuse leap

    Instead of editing "/etc/sysconfig/network/ifcfg-wlan0", you would do better to use:
    Yast --> System --> Network Settings

    Select your device, and select "Edit" to set static ip.

    While still in Yast Network Settings, click on the "Routing" tab and set a default route. And then click on the "Hostname/DNS" tab and set a DNS server.

    Normally, you get the default route and DNS via DHCP. But since you are using a static address instead of DHCP, you will need to set those yourself.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  4. #4
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    3,333

    Default Re: Cannot connect to internet after setting static ip address opensuse leap

    Quote Originally Posted by nrickert View Post
    Instead of editing "/etc/sysconfig/network/ifcfg-wlan0", you would do better to use:
    Yast --> System --> Network Settings

    Select your device, and select "Edit" to set static ip.

    While still in Yast Network Settings, click on the "Routing" tab and set a default route. And then click on the "Hostname/DNS" tab and set a DNS server.

    Normally, you get the default route and DNS via DHCP. But since you are using a static address instead of DHCP, you will need to set those yourself.
    I am using wicked. Will static addressing speed up configuration at boot time? Current configuration uses DHCP and is slow:

    Code:
    Apr 04 13:53:00 ... systemd[1]: Starting wicked managed network interfaces...
    Apr 04 13:53:16 ... wicked[1155]: lo              up
    Apr 04 13:53:16 ...  wicked[1155]: enp0s25         enslaved
    Apr 04 13:53:16 ... wicked[1155]: br0             up
    Apr 04 13:53:16  systemd[1]: Started wicked managed network interfaces.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,841

    Default Re: Cannot connect to internet after setting static ip address opensuse leap

    Quote Originally Posted by karlmistelberger View Post
    I am using wicked. Will static addressing speed up configuration at boot time? Current configuration uses DHCP and is slow:
    Normally the choice for using DHCP or not is made on other grounds then initialisation speed.

    I do not think that doing the DHCP broadcast and getting the answers on a LAN will take a lot of time. Or is the DHCP server a bit busy?

    BTW, I am not sure I can read from what you post that using DHCP is "slow". Maybe I do not understand what I see there without further explanation.
    Henk van Velden

  6. #6
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    3,333

    Default Re: Cannot connect to internet after setting static ip address opensuse leap

    Quote Originally Posted by hcvv View Post
    Normally the choice for using DHCP or not is made on other grounds then initialisation speed.

    I do not think that doing the DHCP broadcast and getting the answers on a LAN will take a lot of time. Or is the DHCP server a bit busy?

    BTW, I am not sure I can read from what you post that using DHCP is "slow". Maybe I do not understand what I see there without further explanation.
    Somebody gave me the hint, but I also don't think he is right. From last boot:

    Code:
    erlangen:~ # systemd-analyze
    Startup finished in 1.874s (kernel) + 840ms (initrd) + 18.165s (userspace) = 20.880s
    graphical.target reached after 18.161s in userspace
    erlangen:~ # systemd-analyze critical-chain |grep +
    The time the unit takes to start is printed after the "+" character.
    └─display-manager.service @16.638s +1.522s
      └─apache2.service @16.514s +114ms
          └─ntpd.service @16.465s +43ms
              └─wicked.service @1.140s +15.320s
                └─wickedd-nanny.service @1.131s +8ms
                  └─wickedd.service @1.122s +7ms
                    └─wickedd-auto4.service @1.091s +29ms
                                └─systemd-update-utmp.service @1.021s +3ms
                                  └─auditd.service @1.004s +16ms
                                    └─systemd-tmpfiles-setup.service @983ms +19ms
                                        └─home\x2dHDD.mount @742ms +237ms
                                            └─lvm2-monitor.service @176ms +561ms
    erlangen:~ #
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,841

    Default Re: Cannot connect to internet after setting static ip address opensuse leap

    I am no expert in analyzing this. but 15 secs for starting the network seems indeed a bit much.
    Bit is it DHCP?

    BTW, why didn't you start a new thread with a new title that tells about your problem instead of hanging this at the end of an old thread about a different subject (connecting to the Internet)?

    I came here by incident. I do not think this is the best way to advertise your problem.
    Henk van Velden

  8. #8
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,685
    Blog Entries
    3

    Default Re: Cannot connect to internet after setting static ip address opensuse leap

    Quote Originally Posted by karlmistelberger View Post
    Will static addressing speed up configuration at boot time?
    The amount of speed up is probably too small to notice.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: Cannot connect to internet after setting static ip address opensuse leap

    From the original post,
    A static address is configured.
    Yes, it's advisable to use YaST but not critical.

    To the @OP,
    If your router can provide DHCP to your LAN, then you have an easy alternative to setting up your openSUSE with a static address...

    Most DHCP servers have a feature supporting "Reserved Leases."
    What this means is that if you configure your openSUSE as a DHCP client,
    When your openSUSE boots up, it will query any available DHCP server for an IP address (and will provide a MAC address for identification).
    Your DHCP Server will receive the query, look up your machine's MAC address in its table of Reserved Leases, find a match and respond with the fixed, assigned address for your machine.
    If you didn't set up a Reserved Lease on your DHCP server, then the response would assign any available IP address.

    Try the above,
    If you can set that up, then you'll have the fixed address like static addressing while also the ease of a DHCP client setup.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #10
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: Cannot connect to internet after setting static ip address opensuse leap

    Regarding speed...
    Unless your network has some kind of problem, speed should not typically be an issue.
    You might consider you could have an IP address conflict... If multiple machines have the same address, or if you configured your static IP address the same as an active DHCP lease.

    In other words, if you configure a static address, it should be configured <outside> the DHCP scope (range of IP addresses).
    Personally, when I break this rule I configure my static addresses at the highest end of the range to avoid conflicts since DHCP normally assigns IP addresses in the lowest available address first.

    You should also know that DHCP leases have a TTL (Time to live) or lifetime which is variable and be configured.
    And, at the half-life of the lease, then the DHCP server will issue a lease renewal of the client connects.
    If the client doesn't renew during the second half of the life of the lease, then the IP address is returned to the available pool for re-issuing.

    Bottom line is that if you can configure Reserved Leases as I described in my previous post instead of Static addresses, you'll likely not create any IP address conflicts that would slow your DHCP.

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Posting Permissions

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