a question about Slirp usage
Hi,
I came across this tool slirp, which seems very powerful and interesting, and fits my needs perfectly. However, with all the information (very little) I can find online, I could not get it working.
e.g. I have tried the instructions in the doc HOWTO-TEST in the package slirp on Ubuntu - 20.04 and Debian bullseye
#pppd nodefaultroute noauth nobsdcomp nodetach debug :10.1.2.1 pty "ssh -t <email address hidden> slirp ppp"
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/pts/2
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xdc7000b9> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <mru 1500> <magic 0xed08dc07> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <mru 1500> <magic 0xed08dc07> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xdc7000b9> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0xdc7000b9]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
rcvd [LCP EchoRep id=0x0 magic=0xed08dc07]
rcvd [IPCP ConfReq id=0x1 <addr 10.0.0.4> <compress VJ 0f 01>]
sent [IPCP ConfNak id=0x1 <addr 10.1.2.1>]
rcvd [CCP ConfReq id=0x1]
sent [CCP ConfAck id=0x1]
rcvd [CCP ConfRej id=0x1 <deflate 15> <deflate(old#) 15>]
sent [CCP ConfReq id=0x2]
rcvd [IPCP ConfNak id=0x1 <addr 10.0.2.15>]
sent [IPCP ConfReq id=0x2 <compress VJ 0f 01> <addr 10.0.2.15>]
rcvd [IPCP ConfReq id=0x2 <addr 10.1.2.1> <compress VJ 0f 01>]
sent [IPCP ConfAck id=0x2 <addr 10.1.2.1> <compress VJ 0f 01>]
rcvd [CCP ConfAck id=0x2]
rcvd [IPCP ConfAck id=0x2 <compress VJ 0f 01> <addr 10.0.2.15>]
local IP address 10.0.2.15
remote IP address 10.1.2.1
Script /etc/ppp/ip-up started (pid 3219)
Script /etc/ppp/ip-up finished (pid 3219), status = 0x0
The interface is up, but the network is not working:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.211.55.1 0.0.0.0 UG 100 0 0 eth0
10.1.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
10.211.55.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.211.55.1 0.0.0.0 255.255.255.255 UH 100 0 0 eth0
ICMP is not working
# ping 10.1.2.1
PING 10.1.2.1 (10.1.2.1) 56(84) bytes of data.
^C
--- 10.1.2.1 ping statistics ---
8 packets transmitted, 0 received, 100% packet loss, time 7168ms
TCP is not working either
# route add -host www.google.com dev ppp0
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.211.55.1 0.0.0.0 UG 100 0 0 eth0
10.1.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
10.211.55.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.211.55.1 0.0.0.0 255.255.255.255 UH 100 0 0 eth0
142.251.43.4 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
# telnet 142.251.43.4 80
Trying 142.251.43.4...
^C
But if I add 10.0.2.0/24 to route to ppp0, ICMP is working
# route add -net 10.0.2.0/24 dev ppp0
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.211.55.1 0.0.0.0 UG 100 0 0 eth0
10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 ppp0
10.1.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
10.211.55.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.211.55.1 0.0.0.0 255.255.255.255 UH 100 0 0 eth0
142.251.43.4 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
# ping 10.0.2.2
PING 10.0.2.2 (10.0.2.2) 56(84) bytes of data.
64 bytes from 10.0.2.2: icmp_seq=1 ttl=255 time=148 ms
64 bytes from 10.0.2.2: icmp_seq=2 ttl=255 time=151 ms
64 bytes from 10.0.2.2: icmp_seq=3 ttl=255 time=150 ms
64 bytes from 10.0.2.2: icmp_seq=4 ttl=255 time=155 ms
64 bytes from 10.0.2.2: icmp_seq=5 ttl=255 time=153 ms
^C
--- 10.0.2.2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4013ms
rtt min/avg/max/mdev = 148.017/
TCP forwarding is still not working, nor is 10.0.2.2 itself.
I spent a lot of time on finding the answer, it seems all the info is from the last century, and it is not working anymore.
Any suggestion is appreciated.
Best regards,
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu slirp Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Hao Li for more information if necessary.