Recently, Ubuntu Server 14.04 in my company got broken. We used that server as default gateway, users have access to file server (Windows 2012), internet and VPN. I made connection with file server and internet but I have problem with VPN.
File /etc/network/interfaces
on old server looked like this:
auto lo eth2 eth1 eth2:0 eth2:1 eth2:2
iface lo inet loopback
iface eth2 inet static
address 192.168.101.201
netmask 255.255.255.0
network 192.168.101.0
broadcast 192.168.101.255
dns-nameservers 8.8.8.8
iface eth2:0 inet static
address 192.168.102.201
netmask 255.255.255.0
broadcast 192.168.102.255
network 192.168.102.0
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0
gateway 192.168.1.1
post-up iptables-restore < /etc/iptables.up.rules
iface eth2:1 inet static
address 192.168.10.201
netmask 255.255.255.0
broadcast 192.168.10.255
network 192.168.10.0
iface eth2:2 inet static
address 10.26.97.201
netmask 255.255.255.0
broadcast 10.26.97.255
network 10.26.97.0
up route add -host 10.26.60.1 gw 10.26.97.1
On Ubuntu 22.10 I configured etc/netplan/00-installer-config.yaml
like this:
network:
ethernets:
enp3s1:
addresses:
- 192.168.1.2/24
gateway4: 192.168.1.1
dhcp4: false
dhcp6: false
optional: true
nameservers:
addresses: [192.168.101.99]
search: [iasu.local]
enp2s0:
addresses:
- 192.168.101.201/24
- 192.168.102.201/24
dhcp4: false
optional: true
nameservers:
search: [iasu.local]
addresses:
- 192.168.101.99
- 8.8.8.8
version: 2
File /etc/iptables/rules.v4
looks like this:
# Generated by iptables-save v1.8.7 on Tue Feb 14 14:41:10 2023
*mangle
:PREROUTING ACCEPT [56475:51506045]
:INPUT ACCEPT [1684:158193]
:FORWARD ACCEPT [54586:51318730]
:OUTPUT ACCEPT [1564:201453]
:POSTROUTING ACCEPT [56327:51546519]
COMMIT
# Completed on Tue Feb 14 14:41:10 2023
# Generated by iptables-save v1.8.7 on Tue Feb 14 14:41:10 2023
*filter
:INPUT ACCEPT [1684:158193]
:FORWARD ACCEPT [54586:51318730]
:OUTPUT ACCEPT [1545:199261]
COMMIT
# Completed on Tue Feb 14 14:41:10 2023
# Generated by iptables-save v1.8.7 on Tue Feb 14 14:41:10 2023
*nat
:PREROUTING ACCEPT [820:100362]
:INPUT ACCEPT [38:4630]
:OUTPUT ACCEPT [75:9186]
:POSTROUTING ACCEPT [83:9602]
-A POSTROUTING -s 192.168.101.0/24 -o enp3s1 -j MASQUERADE
-A POSTROUTING -s 192.168.102.0/24 -o enp3s1 -j MASQUERADE
COMMIT
# Completed on Tue Feb 14 14:41:10 2023
To access web site using VPN I have to enter these parameters in TCP/IP settings VPN settings on my Windows computer, then in web browser I have to type http://10.26.60.1/arhiv to access website
VPN web site.
I have to allow access to all users to file server, internet and VPN web application on Ubuntu 22.10.
Default gateway on all computers is 192.168.101.201
or 192.168.102.201
.