Ubuntu 18.04 network configuration


(Maciek Szelągowski) #1

Hello, can someone check my network configuration:

I would like to get wan address from DHCP (this is working)

and run dhcp server with static address from all lan ports with (router IP 192.168.1.1)

Static IP is working but how to run dhcp server?

Tried one for Ubuntu but doesn’t work …

My kernel is 4.14.69 from Frank-W


(Frank W.) #2

Currently i don’t see your config :slight_smile: i also don’t know which dhcp-server you use…

In my wiki you’ll instructions for configuring dnsmasq as dhcp-server. You have to bridge lan-ports or setup different config for each. Don’t forget to set static ip for bridge/lan-ports and the dhcp-range should match that config


(Maciek Szelągowski) #3

sorry, this is my config:

# ifupdown has been replaced by netplan(5) on this system.  See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
#    sudo apt install ifupdown
auto lo
iface lo inet loopback
dns-nameservers 192.168.0.1

auto eth0
iface eth0 inet manual
pre-up ip link set $IFACE up
post-down ip link set $IFACE down

auto lan0
iface lan0 inet static
address 192.168.1.1
netmask 255.255.255.0
pre-up ip link set $IFACE up
post-down ip link set $IFACE down

allow-hotplug eth1
auto eth1
iface eth1 inet dhcp
pre-up ip link set $IFACE up
post-down ip link set $IFACE down

auto wan
iface wan inet dhcp
pre-up ip link set $IFACE up
post-down ip link set $IFACE down

(Frank W.) #4

This is interface configuration not for dhcp-server

https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:network:start#dhcp

Btw.

Only 1 of this lines makes sense:

allow-hotplug eth1
auto eth1

Since ethx is always connected auto ethx is the right one…allow hotplug is used for ports which may not be connected (to avoid waiting for intwrface on bootup)