Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 20067  / 1 Year ago, sat, april 8, 2023, 8:20:46

While I order a hp server for my Ubuntu server, I am currently temporarily using my laptop as a server instead. I installed Ubuntu 13.10 and other programs like Webmin, etc, etc while being connected to my router through wi-fi. Additionally, through a wi-fi connection, I have hosted numerous websites, game servers and an ftp server.



The issue is that when I try to connect the laptop to the same router through ethernet, the local ip changes. This means that no services, such as Webmin, work locally or publicly. When I go back to using wi-fi, the issue is solved, however, because the wi-fi connection cannot maintain the traffic to and from the server, I need to use ethernet connection to keep up with the demand.



I have portforwarded the ports I use from my wi-fi local ip to my ethernet local ip but I have no luck so far since the problem is on the local side, not from local to public.



My question is, how can I configure my services to the new IP?



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#NetworkManager#auto wlan0
#NetworkManager#iface wlan0 inet dhcp
#NetworkManager# wpa-ssid routername
#NetworkManager# wpa-psk routerpassword


The result of ip ad is:



$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:1c:23:3a:24:db brd ff:ff:ff:ff:ff:ff
inet 192.168.***.***/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.***.***/24 brd 192.168.1.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet6 fe80::21c:23ff:fe3a:24db/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 00:19:d2:03:0c:f8 brd ff:ff:ff:ff:ff:ff
inet6 fe80::219:d2ff:fe03:cf8/64 scope link
valid_lft forever preferred_lft forever

$ ip r
default via 192.168.***.*** dev eth0 proto static
192.168.***.***/24 dev eth0 proto kernel scope link src 192.168.***.*** metric 1

$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: off
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes

More From » networking

 Answers
5

Assuming you need a CLI method:



Use your favourite editor to edit /etc/network/interfaces with root permissions.



sudo nano /etc/network/interfaces


(lines starting with # are just comments, they are not effective, you can leave them as they are, you also keep the lines with lo as they are)



# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.100 # use the address you really want
netmask 255.255.255.0
gateway 192.168.0.254 # use the address of your router


You will have to restart the interface sudo ifdown eth0 (may throw an error, ignore that), then sudo ifup etho - you can check if the settings are effective with ip ad.



For a detailed outline see



Ubuntu Server Guide - chapter networking


[#26864] Sunday, April 9, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
polcomposte

Total Points: 421
Total Questions: 92
Total Answers: 109

Location: Uzbekistan
Member since Mon, Jul 20, 2020
4 Years ago
;