Estou executando a instância do Amazon EC2 com o Red Hat Enterprise Linux, onde tenho duas interfaces de rede.
Agora:
-
O eth0 está atualmente ativo com o ip público, onde estou logado remotamente via SSH, para configurar a VPN (assim que a VPN terminar, não poderei mais acessar remotamente esse IP e interface)
-
eth1 está sendo exibida
(usando amazon eu atribuí-lo com outro novo ip público, mas não pode pingar nem eu posso fazer login nele usando SSH)
-
assim que eu tiver o eth1 up e remotamente acessível, eu tenho que configurar o cliente VPN no eth0 para conectar a outro servidor remoto
Como posso aumentar a eth1 para que eu tenha acesso remoto em eth1 e eth0 pode ser dedicado para o host VPN IPSec para hospedar?
[ec2-user@ip-10-0-0-41 ~]$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 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
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 0e:29:01:a8:c6:98 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.41/24 brd 10.0.0.255 scope global eth0
inet6 fe80::c29:1ff:fea8:c698/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 0e:29:01:a9:6e:32 brd ff:ff:ff:ff:ff:ff
EDITAR:
$ system-config-network-tui
eth1 is added as dhcp
$ ifup eth1
Determining IP information for eth1...
EDITAR:
$ ssh [email protected] - fails
$ ssh [email protected] - allow to login
$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 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
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 0e:29:01:a8:c6:98 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.41/24 brd 10.0.0.255 scope global eth0
inet6 fe80::c29:1ff:fea8:c698/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 0e:29:01:a9:6e:32 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.110/24 brd 10.0.0.255 scope global eth1
inet6 fe80::c29:1ff:fea9:6e32/64 scope link
valid_lft forever preferred_lft forever
EDITAR:
$ yum install openswan
$ cat /etc/ipsec.conf
version 2.0 # conforms to second version of ipsec.conf specification
config setup
protostack=netkey
nat_traversal=yes
virtual_private=
oe=off
include /etc/ipsec.d/*.conf
$ cat /etc/ipsec.d/test.conf
### Administrator given this to setup
# Phase1: Encryption: AES128 Integrity: MD5 IKE Lifetime: 28800 sec.
# Phase2: Encryption: AES128 Integrity: MD5 IPsec lifetime: 3600 sec.
### Red hat we use Phase 1 and Phase 2 for IPSec
conn test
type=tunnel
authby=secret
pfs=no
# Lifetime: 1440 sec
ike=aes128-md5;modp1024!
# Lifetime: 3600 sec
phase2alg=aes128-md5;modp1024
aggrmode=no
left=194.x.x.x
right=54.x.x.x
leftsubnet=10.109.0.0/24
rightsubnet=10.0.0.0/24
#auto=start
$ service ipsec restart && ipsec auto --add test
ipsec_setup: Stopping Openswan IPsec...
ipsec_setup: Starting Openswan IPsec U2.6.32/K2.6.32-358.6.2.el6.x86_64...
ipsec_setup: /usr/libexec/ipsec/addconn Non-fips mode set in /proc/sys/crypto/fips_enabled
/usr/libexec/ipsec/addconn Non-fips mode set in /proc/sys/crypto/fips_enabled
$ ipsec auto --up test
022 "test": We cannot identify ourselves with either end of this connection.
- Se adicionar funciona sem erro, o arquivo de configuração está correto, o restante é outros problemas para o túnel.