You are not logged in.
Pages: 1
hi guys,
im trying to make to lans routeable using arch,
eth0 is 149.153.8.1
eth1 is 149.153.9.1
i want to able to ping each lan from the other,
was trying to add routes but didnt work, also tried using iptables to forward packets, neither worked. maybe i was close to getting it right or maybe im way off but after 4 hours im askin for help!!
heres the iptables i tried:
http://bbs.archlinux.org/viewtopic.php? … =ipforward
heres the route add i tried:
ifconfig eth0 149.153.8.0
route add -net 149.153.8.0 netmask 255.255.255.0 gw 149.153.8.1 dev eth0
ifconfig eth0 149.153.9.0
route add -net 149.153.9.0 netmask 255.255.255.0 gw 149.153.9.1 dev eth1
Offline
you can't assign network addresses to interfaces
ifconfig eth0 149.153.8.1 netmask 255.255.255.0 broadcast 149.153.8.255 up
moreover adding routes to networks in which you already have interfaces is pointless, it's done automagically, just make sure that you have ip forwarding
sysctl net.ipv4.ip_forward=1
default iptables policies are to forward, so if you have not changed anything routing should work, otherwise
iptables -t filter -A -s 149.153.8.0/24 -d 149.153.9.0/24 -j ACCEPT
and identical entry for the second network
Offline
sorry was very quick writing that last night, made a few typos on my ifconfig
ifconfig eth0 149.153.8.1 netmask 255.255.255.0 broadcast 149.153.8.255 up
ifconfig eth1 149.153.9.1 netmask 255.255.255.0 broadcast 149.153.9.255 up
interfaces are ok
sysctl net.ipv4.ip_forward=1
is set
iptables -F
to clear the iptables
iptables -A -s 149.153.8.0/24 -d 149.153.9.0/24 -j ACCEPT
Bad argument `149.153.8.0/24'
it wont accept that network as a source??
Offline
I missed the chain name
iptables -A FORWARD -s 149.153.8.0/24 -d 149.153.9.0/24 -j ACCEPT
Offline
that command worked, but still not able to ping from lan to lan
when my ip is 149.153.8.2, i can ping 149.153.9.1 on the arch machine, but thats it
iptables -F
iptables -A FORWARD -s 149.153.8.0/24 -d 149.153.9.0/24 -j ACCEPT
iptables -A FORWARD -s 149.153.9.0/24 -d 149.153.8.0/24 -j ACCEPT
i also tried:
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
i dont know if they make a difference or not.
how do i automatically set net.ipv4.ip_forward=1
/etc/sysctl.conf was empty, but i put "net.ipv4.ip_forward=1" in there anyhow, but does automatically set to 1
Offline
make sure machines on lan, say 149.153.8.0 have a route to 149.153.9.0 set to 149.153.8.1, or make 149.153.8.1 a default gateway, the icmp echo may go through but there's no return path for icmp reply
Offline
should i have the default gateways for machines in :
machines in lan 149.153.8.0
route add default gw 149.153.8.1
for lan 149.153.9.0
route add default gw 149.153.9.1
???
Offline
ok trying that now
Offline
yup its working now!
cheers!
I have those rules saved in /etc/iptables/iptables.rules
and have iptables in the daemon array
iptables fails to start but the rules still work
Offline
wait got it now,
thanx for the help demonus!!!
Offline
Pages: 1