728x90

ubuntu 고정아이피

$nano  /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
#source-directory /etc/network/interfaces.d

# The loopback network interface
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address 172.30.1.100
netmask 255.255.255.0
network 172.30.1.0
broadcast 172.30.1.255
gateway 172.30.1.254
dns-nameservers 168.126.63.1 168.126.63.2
# The primary network interface
#NetworkManager#auto eth0
#NetworkManager#iface eth0 inet dhcp

 

728x90

'Server > Linux' 카테고리의 다른 글

ubuntu 고정아이피  (0) 2023.04.01
iptable  (0) 2023.03.29
저용량, 저사양 리눅스  (0) 2023.03.29
apache <-> tomcat 연동  (0) 2023.03.29
Linux SSH Tunneling  (0) 2023.03.29
728x90

ubuntu 고정아이피

$nano  /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
#source-directory /etc/network/interfaces.d

# The loopback network interface
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address 172.30.1.100
netmask 255.255.255.0
network 172.30.1.0
broadcast 172.30.1.255
gateway 172.30.1.254
dns-nameservers 168.126.63.1 168.126.63.2
# The primary network interface
#NetworkManager#auto eth0
#NetworkManager#iface eth0 inet dhcp

 

728x90

'Server > Linux' 카테고리의 다른 글

ubuntu 고정아이피  (0) 2023.04.01
iptable  (0) 2023.03.29
저용량, 저사양 리눅스  (0) 2023.03.29
apache <-> tomcat 연동  (0) 2023.03.29
Linux SSH Tunneling  (0) 2023.03.29
728x90

iptables 모두 초기화

ubuntu@cloud:~$ sudo iptables -F
ubuntu@cloud:~$ sudo iptables -X
ubuntu@cloud:~$ sudo iptables -Z

방화벽 열기

ubuntu@cloud:~$ sudo iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
ubuntu@cloud:~$ sudo iptables -I INPUT 1 -p tcp --dport 5432 -j ACCEPT
728x90

'Server > Linux' 카테고리의 다른 글

ubuntu 고정아이피  (0) 2023.04.01
ubuntu 고정아이피  (0) 2023.04.01
저용량, 저사양 리눅스  (0) 2023.03.29
apache <-> tomcat 연동  (0) 2023.03.29
Linux SSH Tunneling  (0) 2023.03.29
728x90

alpine linux

 

저용량, 저사양 리눅스

https://www.alpinelinux.org/

 

index | Alpine Linux

 

www.alpinelinux.org

 

728x90

'Server > Linux' 카테고리의 다른 글

ubuntu 고정아이피  (0) 2023.04.01
iptable  (0) 2023.03.29
apache <-> tomcat 연동  (0) 2023.03.29
Linux SSH Tunneling  (0) 2023.03.29
iptable port forwarding  (0) 2023.03.29
728x90

아파치 http 서버와 tomcat 연동을 하기위해

mod_jk라는 아파치 모듈을 사용한다.

아래는 실제 구성한 설정 사진이다.

참고용으로 남긴다.

 

728x90

'Server > Linux' 카테고리의 다른 글

ubuntu 고정아이피  (0) 2023.04.01
iptable  (0) 2023.03.29
저용량, 저사양 리눅스  (0) 2023.03.29
Linux SSH Tunneling  (0) 2023.03.29
iptable port forwarding  (0) 2023.03.29
728x90

Linux SSH Tunneling 

공인아이피가 없는 외부접근이 안되는 컴퓨터를 외부접근이 가능한 서버로 연결

[ssh설정]

$ sudo nano /etc/ssh/sshd_config

AllowTcpForwarding yes
GatewayPorts yes

ssh 재시작
$ sudo systemctl restart sshd

[iptables 방화벽 해제]

sudo iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

[예제]

예) 기숙사에 인는 컴퓨터에 접근하고 싶다.

A : 기숙사 컴퓨터 (인터넷은 되나 외부 연결이 안되어 있다.)

B : 외부접근이 가능한 서버 (아이피 : 1.1.1.1 임시설명을 위해)

 

1.1.1.1:8080 으로접근하면 A 컴퓨터의 8080으로 연결해준다.

ssh -i D:\dev\ssh\ocl\oracleCloudOpenSsh.ppk ubuntu@ksmcloud.duckdns.org -R 8080:localhost:8080

 

 

728x90

'Server > Linux' 카테고리의 다른 글

ubuntu 고정아이피  (0) 2023.04.01
iptable  (0) 2023.03.29
저용량, 저사양 리눅스  (0) 2023.03.29
apache <-> tomcat 연동  (0) 2023.03.29
iptable port forwarding  (0) 2023.03.29
728x90

 서버의 특정 포트로 들어오는 트래픽을 특정 ip 포트로 전달할때

sudo iptables -P FORWARD ACCEPT

sudo iptables -t nat -A PREROUTING -p tcp --dport 1111 -j DNAT --to-destination 1.1.1.1:22

sudo netfilter-persistent save

sudo iptables -nL -v -t nat

sudo service iptables restart

* 참고
iptables -L : iptables 룰 조회
iptables -nL : -n 옵션은 IP 를 숫자로 표현
iptables -nL -v : -v 옵션은 해당 룰을 hit 하는 패킷 표시
iptables -nL -v --line : 룰의 라인 번호 표시. input, delete 시 유용하다.
iptables -t nat -nL : nat 테이블 조회

 

728x90

'Server > Linux' 카테고리의 다른 글

ubuntu 고정아이피  (0) 2023.04.01
iptable  (0) 2023.03.29
저용량, 저사양 리눅스  (0) 2023.03.29
apache <-> tomcat 연동  (0) 2023.03.29
Linux SSH Tunneling  (0) 2023.03.29

+ Recent posts