Install&Setting
 
 
 
 
 
 
 
 
 
 
Install Ubuntu
Firewall with UFW
NAT - dhcp
V
F
N

Ubuntu Server installation

refer
https://www3.ntu.edu.sg/home/ehchua/programming/howto/UbuntuServer_HowTo.html#zz-1.1


Firewall with UFW
apt install ufw
vim /etc/default/ufw
make sure "IPV6=yes"

ufw enable
ufw allow ssh
ufw allow 22
ufw allow 6000:6007/tcp /* Specific Port Ranges */
ufw allow 6000:6007/udp

ufw status verbose /* display inactive or active
ufw status numbered /* get a list of your firewall rules

ufw disable
ufw reset

ufw allow from 203.0.113.4 /* Specific IP Addresses */
ufw allow from 203.0.113.4 to any port 22 /*allow 203.0.113.4 to connect to port 22 (SSH) */
ufw allow in on eth0 to any port 80
/*if your server has a public network interface called eth0, you could allow HTTP traffic port 80

ufw deny from 203.0.113.4 /*deny all connections from 203.0.113.4
ufw deny http

refer
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-18-04

NAT

ip addr show  /* current ip# */
dhclient -r; sudo dhclient /* release * renew ip dhcp */
Static IP Address
vim /etc/network/interfaces.

# eth0 for the first network card with static IP address
auto eth0
iface eth0 inet static
address x.x.x.x
netmask 255.255.255.0
gateway x.x.x.x
dns-nameservers x.x.x.x x.x.x.x
ifup eth0
ifdown eth0


update network config using Netplan

V
 

F
 

N
 


Copyright© 2025 Xibase Company